diff --git a/lib/mysql2/client.rb b/lib/mysql2/client.rb index 8ba220e..ee1a36b 100644 --- a/lib/mysql2/client.rb +++ b/lib/mysql2/client.rb @@ -9,7 +9,7 @@ module Mysql2 :database_timezone => :local, # timezone Mysql2 will assume datetime objects are stored in :application_timezone => nil, # timezone Mysql2 will convert to before handing the object back to the caller :cache_rows => true, # tells Mysql2 to use it's internal row cache for results - :connect_flags => REMEMBER_OPTIONS + :connect_flags => REMEMBER_OPTIONS | LONG_PASSWORD | LONG_FLAG | TRANSACTIONS | PROTOCOL_41 | SECURE_CONNECTION } def initialize(opts = {}) diff --git a/spec/mysql2/client_spec.rb b/spec/mysql2/client_spec.rb index 304a39f..8927410 100644 --- a/spec/mysql2/client_spec.rb +++ b/spec/mysql2/client_spec.rb @@ -23,10 +23,10 @@ describe Mysql2::Client do end end client = klient.new :flags => Mysql2::Client::FOUND_ROWS - client.connect_args.last.last.should == Mysql2::Client::FOUND_ROWS + (client.connect_args.last.last & Mysql2::Client::FOUND_ROWS).should be_true end - it "should default flags to 0" do + it "should default flags to (REMEMBER_OPTIONS, LONG_PASSWORD, LONG_FLAG, TRANSACTIONS, PROTOCOL_41, SECURE_CONNECTION)" do klient = Class.new(Mysql2::Client) do attr_reader :connect_args def connect *args @@ -35,7 +35,12 @@ describe Mysql2::Client do end end client = klient.new - client.connect_args.last.last.should == 0 + (client.connect_args.last.last & (Mysql2::Client::REMEMBER_OPTIONS | + Mysql2::Client::LONG_PASSWORD | + Mysql2::Client::LONG_FLAG | + Mysql2::Client::TRANSACTIONS | + Mysql2::Client::PROTOCOL_41 | + Mysql2::Client::SECURE_CONNECTION)).should be_true end it "should have a global default_query_options hash" do