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:
module ActiveRecord
class Base
def self.mysql_connection(config)
...
# last line of method - add 65536 flag
ConnectionAdapters::MysqlAdapter.new(mysql, logger, [host,
username, password, database, port, socket, 65536], config)
end
end
end
This has worked for me, and I have not read about a fix in 2.x to
handle this.
On Aug 27, 3:09�pm, Chris Dekker <rails-mailing-l...@andreas-s.net>
Thanks, but that link did not help me.
For MYSQL it doesn't even work. Stored procedures are called through
'CALL', not 'EXECUTE'.
Also as I wrote in my third post, I already get the stored procedure to
execute, the problem seems to lie in the closing / freeing of the result
set.
Calling .free on the returned result set does not solve anything. Tested
on both the latest 5.0 and 5.1 MySQL databases with the newest 2.8.1
mysql gem
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:
module ActiveRecord
class Base
def self.mysql_connection(config)
...
# last line of method - add 65536 flag
ConnectionAdapters::MysqlAdapter.new(mysql, logger, [host,
username, password, database, port, socket, 65536], config)
end
end
end
This has worked for me, and I have not read about a fix in 2.x to
handle this.
I've submitted a patch to Rails 2.3.4 fixing this problem - any support
for my ticket is appreciated!
$ script/console
Loading development environment (Rails 2.3.5)
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning:
Gem::Dependency#version_requirements is deprecated and will be removed
on or after August 2010. Use #requirement
ActiveRecord::StatementInvalid: Mysql::Error: Commands out of sync; you
can't run this command now: CALL proc01
from
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract_adapter.rb:219:in
`log'
from
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:323:in
`execute'
from (irb):5