When I try to call a stored procedure from Rails, I get this exception:
ActiveRecord::StatementInvalid: Mysql::Error: PROCEDURE pipeline-ws_development.match_save_all can't return a result set in the given context: call match_save_all()
from /Users/otto/Projects/Futures/src/pipeline-ws/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:150:in `log'
from /Users/otto/Projects/Futures/src/pipeline-ws/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:281:in `execute'
from (irb):3
There is a page in the Rails Wiki that discusses a patch for the MySQL adapter that resolves this issue, but it's out-of-date and doesn't seem to work anymore.
The configuration code enables stored procedures correctly, but it still has the issue with the connection getting out of sync after a stored procedure call and the new call_sp
method doesn't work anymore.
Any suggestions for how to get this working?
This is the code I'm using:
ActiveRecord::Base.connection("call storedproc()")
It throws the same exception whether storedproc()
returns any results or not.