brianmario/mysql2 — Issue #243: Single query option to skip row caching persists in the connection query_options
Author: smangelsdorf
Created: 2012-01-30 23:51:57+00:00
State: open

Seems incorrect to me:

irb(main):006:0> Bundler.setup.specs.find{|s| s.name =~ /mysql2/}.version
=> #
[....]
irb(main):010:0> ActiveRecord::Base.connection.raw_connection.query_options[:cache_rows]
=> true
irb(main):011:0> ActiveRecord::Base.connection.raw_connection.query('select 1 from dual', :cache_rows => false)
=> #
irb(main):012:0> ActiveRecord::Base.connection.raw_connection.query_options[:cache_rows]
=> false

It's being overwritten in [ext/mysql2/client.c](https://github.com/brianmario/mysql2/blob/master/ext/mysql2/client.c) quite deliberately, but I'm not sure that this is the correct way for the API to behave.