Resend: find problems => patch


I’m fairly sure I sent a message like this last night but it has not
appeared on the list. I didn’t CC myself because I usually see
messages that I post. Anyway, pardon any resulting duplication.

I have just had this, and not that MySQL doesn’t actually display
where the errror is, only the code after it:

You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near
‘?"00149246 " LIMIT 1’ at line 1
query' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:119:inexecute’
select' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:97:inselect_all’
find_by_sql' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:343:infind’
find' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/deprecated_finders.rb:22:infind_first’

So I’d like to propose a patch of the following form:

— ./mysql_adapter.rb.orig 2005-11-09 19:15:20.575395000 -0800
+++ ./mysql_adapter.rb 2005-11-09 19:26:23.411710000 -0800
@@ -132,7 +132,7 @@
elsif exception.message.split(":").first =~ /Packets out of
raise ActiveRecord::StatementInvalid, “‘Packets out of order’
error was received from the database. Please update your mysql bindings
(gem update mysql) and read for more

  •      raise
  •      raise + ": SQL was: " + 


so we can see what the MySQL is when this fails. Is this a good idea,
right way to do this, etc?

    Thank you,