Fogive me if I’m entering this conversation in the middle, but I’m
having problems using stored procedures with the latest patch (on rails
2.3.4) and with rails 2.3.5 (which, from my understanding, has the mysql
When I use find_by_sql(“call sp()”), I get the error:
Mysql::Error: Commands out of sync; you can’t run this command now: SHOW
When I use connection.execute or connection.select_all to call the
stored procedure, I get a hash returned. That’s great that it works, but
I really need an AR result set, so I can use the getter methods already
peppered throughout my application.
If find_by_sql is not supposed to work with stored procedures, is there
at least a way to convert the hash returned by the connection.execute
method to an AR result object?
Justin B. wrote:
E. Litwin wrote:
I’ve still had to hack the mysql_adapter to set a flag upon opening
the MySQL database connection in order to be able to use SPs:
# last line of method - add 65536 flag
ConnectionAdapters::MysqlAdapter.new(mysql, logger, [host,
username, password, database, port, socket, 65536], config)
This has worked for me, and I have not read about a fix in 2.x to
I’ve submitted a patch to Rails 2.3.4 fixing this problem - any support
for my ticket is appreciated!