mysql2 0.2.6-x86-mswin32-60 → 0.2.15-x86-mswin32-60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.rspec +1 -0
 - data/.rvmrc +1 -0
 - data/CHANGELOG.md +60 -1
 - data/Gemfile +3 -0
 - data/MIT-LICENSE +1 -1
 - data/README.md +326 -0
 - data/benchmark/active_record.rb +2 -4
 - data/benchmark/active_record_threaded.rb +42 -0
 - data/benchmark/escape.rb +3 -6
 - data/benchmark/query_with_mysql_casting.rb +3 -6
 - data/benchmark/query_without_mysql_casting.rb +13 -7
 - data/benchmark/sequel.rb +4 -6
 - data/benchmark/setup_db.rb +17 -13
 - data/benchmark/threaded.rb +44 -0
 - data/ext/mysql2/client.c +314 -80
 - data/ext/mysql2/client.h +3 -2
 - data/ext/mysql2/extconf.rb +9 -1
 - data/ext/mysql2/mysql2_ext.h +10 -0
 - data/ext/mysql2/result.c +128 -37
 - data/ext/mysql2/result.h +2 -2
 - data/ext/mysql2/wait_for_single_fd.h +36 -0
 - data/lib/active_record/connection_adapters/em_mysql2_adapter.rb +10 -9
 - data/lib/active_record/connection_adapters/mysql2_adapter.rb +9 -58
 - data/lib/active_record/fiber_patches.rb +37 -9
 - data/lib/mysql2.rb +7 -2
 - data/lib/mysql2/client.rb +9 -2
 - data/lib/mysql2/em.rb +10 -6
 - data/lib/mysql2/em_fiber.rb +31 -0
 - data/lib/mysql2/version.rb +3 -0
 - data/mysql2.gemspec +18 -78
 - data/spec/em/em_fiber_spec.rb +22 -0
 - data/spec/mysql2/client_spec.rb +179 -62
 - data/spec/mysql2/error_spec.rb +47 -3
 - data/spec/mysql2/result_spec.rb +78 -8
 - data/spec/spec_helper.rb +2 -2
 - data/tasks/benchmarks.rake +15 -3
 - data/tasks/compile.rake +23 -6
 - data/tasks/vendor_mysql.rake +6 -7
 - metadata +145 -48
 - data/README.rdoc +0 -240
 - data/VERSION +0 -1
 - data/tasks/jeweler.rake +0 -17
 
    
        data/spec/mysql2/error_spec.rb
    CHANGED
    
    | 
         @@ -3,13 +3,25 @@ require 'spec_helper' 
     | 
|
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            describe Mysql2::Error do
         
     | 
| 
       5 
5 
     | 
    
         
             
              before(:each) do
         
     | 
| 
       6 
     | 
    
         
            -
                @ 
     | 
| 
      
 6 
     | 
    
         
            +
                @client = Mysql2::Client.new :encoding => "utf8"
         
     | 
| 
      
 7 
     | 
    
         
            +
                begin
         
     | 
| 
      
 8 
     | 
    
         
            +
                  @client.query("HAHAHA")
         
     | 
| 
      
 9 
     | 
    
         
            +
                rescue Mysql2::Error => e
         
     | 
| 
      
 10 
     | 
    
         
            +
                  @error = e
         
     | 
| 
      
 11 
     | 
    
         
            +
                end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                @client2 = Mysql2::Client.new :encoding => "big5"
         
     | 
| 
      
 14 
     | 
    
         
            +
                begin
         
     | 
| 
      
 15 
     | 
    
         
            +
                  @client2.query("HAHAHA")
         
     | 
| 
      
 16 
     | 
    
         
            +
                rescue Mysql2::Error => e
         
     | 
| 
      
 17 
     | 
    
         
            +
                  @error2 = e
         
     | 
| 
      
 18 
     | 
    
         
            +
                end
         
     | 
| 
       7 
19 
     | 
    
         
             
              end
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
       9 
21 
     | 
    
         
             
              it "should respond to #error_number" do
         
     | 
| 
       10 
22 
     | 
    
         
             
                @error.should respond_to(:error_number)
         
     | 
| 
       11 
23 
     | 
    
         
             
              end
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
       13 
25 
     | 
    
         
             
              it "should respond to #sql_state" do
         
     | 
| 
       14 
26 
     | 
    
         
             
                @error.should respond_to(:sql_state)
         
     | 
| 
       15 
27 
     | 
    
         
             
              end
         
     | 
| 
         @@ -22,4 +34,36 @@ describe Mysql2::Error do 
     | 
|
| 
       22 
34 
     | 
    
         
             
              it "should alias #message to #error" do
         
     | 
| 
       23 
35 
     | 
    
         
             
                @error.should respond_to(:error)
         
     | 
| 
       24 
36 
     | 
    
         
             
              end
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
              if RUBY_VERSION =~ /1.9/
         
     | 
| 
      
 39 
     | 
    
         
            +
                it "#message encoding should match the connection's encoding, or Encoding.default_internal if set" do
         
     | 
| 
      
 40 
     | 
    
         
            +
                  if Encoding.default_internal.nil?
         
     | 
| 
      
 41 
     | 
    
         
            +
                    @error.message.encoding.should eql(@client.encoding)
         
     | 
| 
      
 42 
     | 
    
         
            +
                    @error2.message.encoding.should eql(@client2.encoding)
         
     | 
| 
      
 43 
     | 
    
         
            +
                  else
         
     | 
| 
      
 44 
     | 
    
         
            +
                    @error.message.encoding.should eql(Encoding.default_internal)
         
     | 
| 
      
 45 
     | 
    
         
            +
                    @error2.message.encoding.should eql(Encoding.default_internal)
         
     | 
| 
      
 46 
     | 
    
         
            +
                  end
         
     | 
| 
      
 47 
     | 
    
         
            +
                end
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                it "#error encoding should match the connection's encoding, or Encoding.default_internal if set" do
         
     | 
| 
      
 50 
     | 
    
         
            +
                  if Encoding.default_internal.nil?
         
     | 
| 
      
 51 
     | 
    
         
            +
                    @error.error.encoding.should eql(@client.encoding)
         
     | 
| 
      
 52 
     | 
    
         
            +
                    @error2.error.encoding.should eql(@client2.encoding)
         
     | 
| 
      
 53 
     | 
    
         
            +
                  else
         
     | 
| 
      
 54 
     | 
    
         
            +
                    @error.error.encoding.should eql(Encoding.default_internal)
         
     | 
| 
      
 55 
     | 
    
         
            +
                    @error2.error.encoding.should eql(Encoding.default_internal)
         
     | 
| 
      
 56 
     | 
    
         
            +
                  end
         
     | 
| 
      
 57 
     | 
    
         
            +
                end
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
                it "#sql_state encoding should match the connection's encoding, or Encoding.default_internal if set" do
         
     | 
| 
      
 60 
     | 
    
         
            +
                  if Encoding.default_internal.nil?
         
     | 
| 
      
 61 
     | 
    
         
            +
                    @error.sql_state.encoding.should eql(@client.encoding)
         
     | 
| 
      
 62 
     | 
    
         
            +
                    @error2.sql_state.encoding.should eql(@client2.encoding)
         
     | 
| 
      
 63 
     | 
    
         
            +
                  else
         
     | 
| 
      
 64 
     | 
    
         
            +
                    @error.sql_state.encoding.should eql(Encoding.default_internal)
         
     | 
| 
      
 65 
     | 
    
         
            +
                    @error2.sql_state.encoding.should eql(Encoding.default_internal)
         
     | 
| 
      
 66 
     | 
    
         
            +
                  end
         
     | 
| 
      
 67 
     | 
    
         
            +
                end
         
     | 
| 
      
 68 
     | 
    
         
            +
              end
         
     | 
| 
       25 
69 
     | 
    
         
             
            end
         
     | 
    
        data/spec/mysql2/result_spec.rb
    CHANGED
    
    | 
         @@ -3,7 +3,7 @@ require 'spec_helper' 
     | 
|
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            describe Mysql2::Result do
         
     | 
| 
       5 
5 
     | 
    
         
             
              before(:each) do
         
     | 
| 
       6 
     | 
    
         
            -
                @client = Mysql2::Client.new :host => "localhost", :username => "root"
         
     | 
| 
      
 6 
     | 
    
         
            +
                @client = Mysql2::Client.new :host => "localhost", :username => "root", :database => 'test'
         
     | 
| 
       7 
7 
     | 
    
         
             
              end
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
              before(:each) do
         
     | 
| 
         @@ -28,6 +28,24 @@ describe Mysql2::Result do 
     | 
|
| 
       28 
28 
     | 
    
         
             
                }.should_not raise_error(Mysql2::Error)
         
     | 
| 
       29 
29 
     | 
    
         
             
              end
         
     | 
| 
       30 
30 
     | 
    
         | 
| 
      
 31 
     | 
    
         
            +
              it "should respond to #count, which is aliased as #size" do
         
     | 
| 
      
 32 
     | 
    
         
            +
                r = @client.query "SELECT 1"
         
     | 
| 
      
 33 
     | 
    
         
            +
                r.should respond_to :count
         
     | 
| 
      
 34 
     | 
    
         
            +
                r.should respond_to :size
         
     | 
| 
      
 35 
     | 
    
         
            +
              end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
              it "should be able to return the number of rows in the result set" do
         
     | 
| 
      
 38 
     | 
    
         
            +
                r = @client.query "SELECT 1"
         
     | 
| 
      
 39 
     | 
    
         
            +
                r.count.should eql(1)
         
     | 
| 
      
 40 
     | 
    
         
            +
                r.size.should eql(1)
         
     | 
| 
      
 41 
     | 
    
         
            +
              end
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
              context "metadata queries" do
         
     | 
| 
      
 44 
     | 
    
         
            +
                it "should show tables" do
         
     | 
| 
      
 45 
     | 
    
         
            +
                  @result = @client.query "SHOW TABLES"
         
     | 
| 
      
 46 
     | 
    
         
            +
                end
         
     | 
| 
      
 47 
     | 
    
         
            +
              end
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
       31 
49 
     | 
    
         
             
              context "#each" do
         
     | 
| 
       32 
50 
     | 
    
         
             
                it "should yield rows as hash's" do
         
     | 
| 
       33 
51 
     | 
    
         
             
                  @result.each do |row|
         
     | 
| 
         @@ -79,6 +97,16 @@ describe Mysql2::Result do 
     | 
|
| 
       79 
97 
     | 
    
         
             
                  @test_result = @client.query("SELECT * FROM mysql2_test ORDER BY id DESC LIMIT 1").first
         
     | 
| 
       80 
98 
     | 
    
         
             
                end
         
     | 
| 
       81 
99 
     | 
    
         | 
| 
      
 100 
     | 
    
         
            +
                it "should return nil values for NULL and strings for everything else when :cast is false" do
         
     | 
| 
      
 101 
     | 
    
         
            +
                  result = @client.query('SELECT null_test, tiny_int_test, bool_cast_test, int_test, date_test, enum_test FROM mysql2_test WHERE bool_cast_test = 1 LIMIT 1', :cast => false).first
         
     | 
| 
      
 102 
     | 
    
         
            +
                  result["null_test"].should be_nil
         
     | 
| 
      
 103 
     | 
    
         
            +
                  result["tiny_int_test"].should  == "1"
         
     | 
| 
      
 104 
     | 
    
         
            +
                  result["bool_cast_test"].should == "1"
         
     | 
| 
      
 105 
     | 
    
         
            +
                  result["int_test"].should       == "10"
         
     | 
| 
      
 106 
     | 
    
         
            +
                  result["date_test"].should      == "2010-04-04"
         
     | 
| 
      
 107 
     | 
    
         
            +
                  result["enum_test"].should      == "val1"
         
     | 
| 
      
 108 
     | 
    
         
            +
                end
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
       82 
110 
     | 
    
         
             
                it "should return nil for a NULL value" do
         
     | 
| 
       83 
111 
     | 
    
         
             
                  @test_result['null_test'].class.should eql(NilClass)
         
     | 
| 
       84 
112 
     | 
    
         
             
                  @test_result['null_test'].should eql(nil)
         
     | 
| 
         @@ -150,27 +178,69 @@ describe Mysql2::Result do 
     | 
|
| 
       150 
178 
     | 
    
         | 
| 
       151 
179 
     | 
    
         
             
                it "should return Time for a DATETIME value when within the supported range" do
         
     | 
| 
       152 
180 
     | 
    
         
             
                  @test_result['date_time_test'].class.should eql(Time)
         
     | 
| 
       153 
     | 
    
         
            -
                  @test_result['date_time_test'].strftime("% 
     | 
| 
      
 181 
     | 
    
         
            +
                  @test_result['date_time_test'].strftime("%Y-%m-%d %H:%M:%S").should eql('2010-04-04 11:44:00')
         
     | 
| 
       154 
182 
     | 
    
         
             
                end
         
     | 
| 
       155 
183 
     | 
    
         | 
| 
       156 
     | 
    
         
            -
                 
     | 
| 
       157 
     | 
    
         
            -
                   
     | 
| 
       158 
     | 
    
         
            -
             
     | 
| 
      
 184 
     | 
    
         
            +
                if 1.size == 4 # 32bit
         
     | 
| 
      
 185 
     | 
    
         
            +
                  if RUBY_VERSION =~ /1.9/
         
     | 
| 
      
 186 
     | 
    
         
            +
                    klass = Time
         
     | 
| 
      
 187 
     | 
    
         
            +
                  else
         
     | 
| 
      
 188 
     | 
    
         
            +
                    klass = DateTime
         
     | 
| 
      
 189 
     | 
    
         
            +
                  end
         
     | 
| 
      
 190 
     | 
    
         
            +
             
     | 
| 
      
 191 
     | 
    
         
            +
                  it "should return DateTime when timestamp is < 1901-12-13 20:45:52" do
         
     | 
| 
      
 192 
     | 
    
         
            +
                                                  # 1901-12-13T20:45:52 is the min for 32bit Ruby 1.8
         
     | 
| 
      
 193 
     | 
    
         
            +
                    r = @client.query("SELECT CAST('1901-12-13 20:45:51' AS DATETIME) as test")
         
     | 
| 
      
 194 
     | 
    
         
            +
                    r.first['test'].class.should eql(klass)
         
     | 
| 
      
 195 
     | 
    
         
            +
                  end
         
     | 
| 
      
 196 
     | 
    
         
            +
             
     | 
| 
      
 197 
     | 
    
         
            +
                  it "should return DateTime when timestamp is > 2038-01-19T03:14:07" do
         
     | 
| 
      
 198 
     | 
    
         
            +
                                                  # 2038-01-19T03:14:07 is the max for 32bit Ruby 1.8
         
     | 
| 
      
 199 
     | 
    
         
            +
                    r = @client.query("SELECT CAST('2038-01-19 03:14:08' AS DATETIME) as test")
         
     | 
| 
      
 200 
     | 
    
         
            +
                    r.first['test'].class.should eql(klass)
         
     | 
| 
      
 201 
     | 
    
         
            +
                  end
         
     | 
| 
      
 202 
     | 
    
         
            +
                elsif 1.size == 8 # 64bit
         
     | 
| 
      
 203 
     | 
    
         
            +
                  if RUBY_VERSION =~ /1.9/
         
     | 
| 
      
 204 
     | 
    
         
            +
                    it "should return Time when timestamp is < 1901-12-13 20:45:52" do
         
     | 
| 
      
 205 
     | 
    
         
            +
                      r = @client.query("SELECT CAST('1901-12-13 20:45:51' AS DATETIME) as test")
         
     | 
| 
      
 206 
     | 
    
         
            +
                      r.first['test'].class.should eql(Time)
         
     | 
| 
      
 207 
     | 
    
         
            +
                    end
         
     | 
| 
      
 208 
     | 
    
         
            +
             
     | 
| 
      
 209 
     | 
    
         
            +
                    it "should return Time when timestamp is > 2038-01-19T03:14:07" do
         
     | 
| 
      
 210 
     | 
    
         
            +
                      r = @client.query("SELECT CAST('2038-01-19 03:14:08' AS DATETIME) as test")
         
     | 
| 
      
 211 
     | 
    
         
            +
                      r.first['test'].class.should eql(Time)
         
     | 
| 
      
 212 
     | 
    
         
            +
                    end
         
     | 
| 
      
 213 
     | 
    
         
            +
                  else
         
     | 
| 
      
 214 
     | 
    
         
            +
                    it "should return Time when timestamp is > 0138-12-31 11:59:59" do
         
     | 
| 
      
 215 
     | 
    
         
            +
                      r = @client.query("SELECT CAST('0139-1-1 00:00:00' AS DATETIME) as test")
         
     | 
| 
      
 216 
     | 
    
         
            +
                      r.first['test'].class.should eql(Time)
         
     | 
| 
      
 217 
     | 
    
         
            +
                    end
         
     | 
| 
      
 218 
     | 
    
         
            +
             
     | 
| 
      
 219 
     | 
    
         
            +
                    it "should return DateTime when timestamp is < 0139-1-1T00:00:00" do
         
     | 
| 
      
 220 
     | 
    
         
            +
                      r = @client.query("SELECT CAST('0138-12-31 11:59:59' AS DATETIME) as test")
         
     | 
| 
      
 221 
     | 
    
         
            +
                      r.first['test'].class.should eql(DateTime)
         
     | 
| 
      
 222 
     | 
    
         
            +
                    end
         
     | 
| 
      
 223 
     | 
    
         
            +
             
     | 
| 
      
 224 
     | 
    
         
            +
                    it "should return Time when timestamp is > 2038-01-19T03:14:07" do
         
     | 
| 
      
 225 
     | 
    
         
            +
                      r = @client.query("SELECT CAST('2038-01-19 03:14:08' AS DATETIME) as test")
         
     | 
| 
      
 226 
     | 
    
         
            +
                      r.first['test'].class.should eql(Time)
         
     | 
| 
      
 227 
     | 
    
         
            +
                    end
         
     | 
| 
      
 228 
     | 
    
         
            +
                  end
         
     | 
| 
       159 
229 
     | 
    
         
             
                end
         
     | 
| 
       160 
230 
     | 
    
         | 
| 
       161 
231 
     | 
    
         
             
                it "should return Time for a TIMESTAMP value when within the supported range" do
         
     | 
| 
       162 
232 
     | 
    
         
             
                  @test_result['timestamp_test'].class.should eql(Time)
         
     | 
| 
       163 
     | 
    
         
            -
                  @test_result['timestamp_test'].strftime("% 
     | 
| 
      
 233 
     | 
    
         
            +
                  @test_result['timestamp_test'].strftime("%Y-%m-%d %H:%M:%S").should eql('2010-04-04 11:44:00')
         
     | 
| 
       164 
234 
     | 
    
         
             
                end
         
     | 
| 
       165 
235 
     | 
    
         | 
| 
       166 
236 
     | 
    
         
             
                it "should return Time for a TIME value" do
         
     | 
| 
       167 
237 
     | 
    
         
             
                  @test_result['time_test'].class.should eql(Time)
         
     | 
| 
       168 
     | 
    
         
            -
                  @test_result['time_test'].strftime("% 
     | 
| 
      
 238 
     | 
    
         
            +
                  @test_result['time_test'].strftime("%Y-%m-%d %H:%M:%S").should eql('2000-01-01 11:44:00')
         
     | 
| 
       169 
239 
     | 
    
         
             
                end
         
     | 
| 
       170 
240 
     | 
    
         | 
| 
       171 
241 
     | 
    
         
             
                it "should return Date for a DATE value" do
         
     | 
| 
       172 
242 
     | 
    
         
             
                  @test_result['date_test'].class.should eql(Date)
         
     | 
| 
       173 
     | 
    
         
            -
                  @test_result['date_test'].strftime("% 
     | 
| 
      
 243 
     | 
    
         
            +
                  @test_result['date_test'].strftime("%Y-%m-%d").should eql('2010-04-04')
         
     | 
| 
       174 
244 
     | 
    
         
             
                end
         
     | 
| 
       175 
245 
     | 
    
         | 
| 
       176 
246 
     | 
    
         
             
                it "should return String for an ENUM value" do
         
     | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    | 
         @@ -1,13 +1,12 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # encoding: UTF-8
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
         
     | 
| 
       4 
3 
     | 
    
         
             
            require 'rspec'
         
     | 
| 
       5 
4 
     | 
    
         
             
            require 'mysql2'
         
     | 
| 
       6 
5 
     | 
    
         
             
            require 'timeout'
         
     | 
| 
       7 
6 
     | 
    
         | 
| 
       8 
7 
     | 
    
         
             
            RSpec.configure do |config|
         
     | 
| 
       9 
8 
     | 
    
         
             
              config.before(:all) do
         
     | 
| 
       10 
     | 
    
         
            -
                client = Mysql2::Client.new :database => 'test'
         
     | 
| 
      
 9 
     | 
    
         
            +
                client = Mysql2::Client.new :host => "localhost", :username => "root", :database => 'test'
         
     | 
| 
       11 
10 
     | 
    
         
             
                client.query %[
         
     | 
| 
       12 
11 
     | 
    
         
             
                  CREATE TABLE IF NOT EXISTS mysql2_test (
         
     | 
| 
       13 
12 
     | 
    
         
             
                    id MEDIUMINT NOT NULL AUTO_INCREMENT,
         
     | 
| 
         @@ -46,6 +45,7 @@ RSpec.configure do |config| 
     | 
|
| 
       46 
45 
     | 
    
         
             
                    PRIMARY KEY (id)
         
     | 
| 
       47 
46 
     | 
    
         
             
                  )
         
     | 
| 
       48 
47 
     | 
    
         
             
                ]
         
     | 
| 
      
 48 
     | 
    
         
            +
                client.query "DELETE FROM mysql2_test;"
         
     | 
| 
       49 
49 
     | 
    
         
             
                client.query %[
         
     | 
| 
       50 
50 
     | 
    
         
             
                  INSERT INTO mysql2_test (
         
     | 
| 
       51 
51 
     | 
    
         
             
                    null_test, bit_test, tiny_int_test, bool_cast_test, small_int_test, medium_int_test, int_test, big_int_test,
         
     | 
    
        data/tasks/benchmarks.rake
    CHANGED
    
    | 
         @@ -1,8 +1,20 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            BENCHMARKS = Dir["#{File.dirname(__FILE__)}/../benchmark/*.rb"].map do |path|
         
     | 
| 
      
 2 
     | 
    
         
            +
              File.basename(path, '.rb')
         
     | 
| 
      
 3 
     | 
    
         
            +
            end.select { |x| x != 'setup_db' }
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
       1 
5 
     | 
    
         
             
            namespace :bench do
         
     | 
| 
       2 
     | 
    
         
            -
               
     | 
| 
       3 
     | 
    
         
            -
                :query_without_mysql_casting, :sequel, :allocations,
         
     | 
| 
       4 
     | 
    
         
            -
                :thread_alone].each do |feature|
         
     | 
| 
      
 6 
     | 
    
         
            +
              BENCHMARKS.each do |feature|
         
     | 
| 
       5 
7 
     | 
    
         
             
                  desc "Run #{feature} benchmarks"
         
     | 
| 
       6 
8 
     | 
    
         
             
                  task(feature){ ruby "benchmark/#{feature}.rb" }
         
     | 
| 
       7 
9 
     | 
    
         
             
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              task :all do
         
     | 
| 
      
 12 
     | 
    
         
            +
                BENCHMARKS.each do |feature|
         
     | 
| 
      
 13 
     | 
    
         
            +
                  ruby "benchmark/#{feature}.rb"
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              task :setup do
         
     | 
| 
      
 18 
     | 
    
         
            +
                ruby 'benchmark/setup_db'
         
     | 
| 
      
 19 
     | 
    
         
            +
              end
         
     | 
| 
       8 
20 
     | 
    
         
             
            end
         
     | 
    
        data/tasks/compile.rake
    CHANGED
    
    | 
         @@ -1,8 +1,7 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            gem 'rake-compiler', '~> 0.7.1'
         
     | 
| 
       2 
1 
     | 
    
         
             
            require "rake/extensiontask"
         
     | 
| 
       3 
2 
     | 
    
         | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
      
 3 
     | 
    
         
            +
            CONNECTOR_VERSION = "6.0.2" #"mysql-connector-c-noinstall-6.0.2-win32.zip"
         
     | 
| 
      
 4 
     | 
    
         
            +
            CONNECTOR_MIRROR = ENV['CONNECTOR_MIRROR'] || ENV['MYSQL_MIRROR'] || "http://mysql.he.net/"
         
     | 
| 
       6 
5 
     | 
    
         | 
| 
       7 
6 
     | 
    
         
             
            def gemspec
         
     | 
| 
       8 
7 
     | 
    
         
             
              @clean_gemspec ||= eval(File.read(File.expand_path('../../mysql2.gemspec', __FILE__)))
         
     | 
| 
         @@ -10,12 +9,12 @@ end 
     | 
|
| 
       10 
9 
     | 
    
         | 
| 
       11 
10 
     | 
    
         
             
            Rake::ExtensionTask.new("mysql2", gemspec) do |ext|
         
     | 
| 
       12 
11 
     | 
    
         
             
              # reference where the vendored MySQL got extracted
         
     | 
| 
       13 
     | 
    
         
            -
               
     | 
| 
      
 12 
     | 
    
         
            +
              connector_lib = File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', "mysql-connector-c-noinstall-#{CONNECTOR_VERSION}-win32"))
         
     | 
| 
       14 
13 
     | 
    
         | 
| 
       15 
14 
     | 
    
         
             
              # DRY options feed into compile or cross-compile process
         
     | 
| 
       16 
15 
     | 
    
         
             
              windows_options = [
         
     | 
| 
       17 
     | 
    
         
            -
                "--with-mysql-include=#{ 
     | 
| 
       18 
     | 
    
         
            -
                "--with-mysql-lib=#{ 
     | 
| 
      
 16 
     | 
    
         
            +
                "--with-mysql-include=#{connector_lib}/include",
         
     | 
| 
      
 17 
     | 
    
         
            +
                "--with-mysql-lib=#{connector_lib}/lib"
         
     | 
| 
       19 
18 
     | 
    
         
             
              ]
         
     | 
| 
       20 
19 
     | 
    
         | 
| 
       21 
20 
     | 
    
         
             
              # automatically add build options to avoid need of manual input
         
     | 
| 
         @@ -29,6 +28,24 @@ Rake::ExtensionTask.new("mysql2", gemspec) do |ext| 
     | 
|
| 
       29 
28 
     | 
    
         
             
                # inject 1.8/1.9 pure-ruby entry point when cross compiling only
         
     | 
| 
       30 
29 
     | 
    
         
             
                ext.cross_compiling do |spec|
         
     | 
| 
       31 
30 
     | 
    
         
             
                  spec.files << 'lib/mysql2/mysql2.rb'
         
     | 
| 
      
 31 
     | 
    
         
            +
                  spec.post_install_message = <<-POST_INSTALL_MESSAGE
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
            ======================================================================================================
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
              You've installed the binary version of #{spec.name}.
         
     | 
| 
      
 36 
     | 
    
         
            +
              It was built using MySQL Connector/C version #{CONNECTOR_VERSION}.
         
     | 
| 
      
 37 
     | 
    
         
            +
              It's recommended to use the exact same version to avoid potential issues.
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
              At the time of building this gem, the necessary DLL files where available
         
     | 
| 
      
 40 
     | 
    
         
            +
              in the following download:
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
              http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-#{CONNECTOR_VERSION}-win32.zip/from/pick
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
              And put lib\\libmysql.dll file in your Ruby bin directory, for example C:\\Ruby\\bin
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
            ======================================================================================================
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                  POST_INSTALL_MESSAGE
         
     | 
| 
       32 
49 
     | 
    
         
             
                end
         
     | 
| 
       33 
50 
     | 
    
         
             
              end
         
     | 
| 
       34 
51 
     | 
    
         | 
    
        data/tasks/vendor_mysql.rake
    CHANGED
    
    | 
         @@ -4,9 +4,8 @@ require 'rake/extensioncompiler' 
     | 
|
| 
       4 
4 
     | 
    
         
             
            # download mysql library and headers
         
     | 
| 
       5 
5 
     | 
    
         
             
            directory "vendor"
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
     | 
    
         
            -
            file "vendor/mysql-noinstall-#{ 
     | 
| 
       8 
     | 
    
         
            -
               
     | 
| 
       9 
     | 
    
         
            -
              url = "http://dev.mysql.com/get/Downloads/MySQL-#{base_version}/#{File.basename(t.name)}/from/#{MYSQL_MIRROR}/"
         
     | 
| 
      
 7 
     | 
    
         
            +
            file "vendor/mysql-connector-c-noinstall-#{CONNECTOR_VERSION}-win32.zip" => ["vendor"] do |t|
         
     | 
| 
      
 8 
     | 
    
         
            +
              url = "http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-#{CONNECTOR_VERSION}-win32.zip/from/#{CONNECTOR_MIRROR}/"
         
     | 
| 
       10 
9 
     | 
    
         
             
              when_writing "downloading #{t.name}" do
         
     | 
| 
       11 
10 
     | 
    
         
             
                cd File.dirname(t.name) do
         
     | 
| 
       12 
11 
     | 
    
         
             
                  sh "wget -c #{url} || curl -C - -O #{url}"
         
     | 
| 
         @@ -14,11 +13,11 @@ file "vendor/mysql-noinstall-#{MYSQL_VERSION}-win32.zip" => ['vendor'] do |t| 
     | 
|
| 
       14 
13 
     | 
    
         
             
              end
         
     | 
| 
       15 
14 
     | 
    
         
             
            end
         
     | 
| 
       16 
15 
     | 
    
         | 
| 
       17 
     | 
    
         
            -
            file "vendor/mysql-#{ 
     | 
| 
      
 16 
     | 
    
         
            +
            file "vendor/mysql-connector-c-noinstall-#{CONNECTOR_VERSION}-win32/include/mysql.h" => ["vendor/mysql-connector-c-noinstall-#{CONNECTOR_VERSION}-win32.zip"] do |t|
         
     | 
| 
       18 
17 
     | 
    
         
             
              full_file = File.expand_path(t.prerequisites.last)
         
     | 
| 
       19 
18 
     | 
    
         
             
              when_writing "creating #{t.name}" do
         
     | 
| 
       20 
19 
     | 
    
         
             
                cd "vendor" do
         
     | 
| 
       21 
     | 
    
         
            -
                  sh "unzip #{full_file} mysql-#{ 
     | 
| 
      
 20 
     | 
    
         
            +
                  sh "unzip #{full_file} mysql-connector-c-noinstall-#{CONNECTOR_VERSION}-win32/bin/** mysql-connector-c-noinstall-#{CONNECTOR_VERSION}-win32/include/** mysql-connector-c-noinstall-#{CONNECTOR_VERSION}-win32/lib/**"
         
     | 
| 
       22 
21 
     | 
    
         
             
                end
         
     | 
| 
       23 
22 
     | 
    
         
             
                # update file timestamp to avoid Rake perform this extraction again.
         
     | 
| 
       24 
23 
     | 
    
         
             
                touch t.name
         
     | 
| 
         @@ -26,10 +25,10 @@ file "vendor/mysql-#{MYSQL_VERSION}-win32/include/mysql.h" => ["vendor/mysql-noi 
     | 
|
| 
       26 
25 
     | 
    
         
             
            end
         
     | 
| 
       27 
26 
     | 
    
         | 
| 
       28 
27 
     | 
    
         
             
            # clobber expanded packages
         
     | 
| 
       29 
     | 
    
         
            -
            CLOBBER.include("vendor/mysql-#{ 
     | 
| 
      
 28 
     | 
    
         
            +
            CLOBBER.include("vendor/mysql-connector-c-noinstall-#{CONNECTOR_VERSION}-win32")
         
     | 
| 
       30 
29 
     | 
    
         | 
| 
       31 
30 
     | 
    
         
             
            # vendor:mysql
         
     | 
| 
       32 
     | 
    
         
            -
            task 'vendor:mysql' => ["vendor/mysql-#{ 
     | 
| 
      
 31 
     | 
    
         
            +
            task 'vendor:mysql' => ["vendor/mysql-connector-c-noinstall-#{CONNECTOR_VERSION}-win32/include/mysql.h"]
         
     | 
| 
       33 
32 
     | 
    
         | 
| 
       34 
33 
     | 
    
         
             
            # hook into cross compilation vendored mysql dependency
         
     | 
| 
       35 
34 
     | 
    
         
             
            if RUBY_PLATFORM =~ /mingw|mswin/ then
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,47 +1,138 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            --- !ruby/object:Gem::Specification 
     | 
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: mysql2
         
     | 
| 
       3 
     | 
    
         
            -
            version: !ruby/object:Gem::Version 
     | 
| 
       4 
     | 
    
         
            -
               
     | 
| 
       5 
     | 
    
         
            -
              prerelease:  
     | 
| 
       6 
     | 
    
         
            -
              segments: 
         
     | 
| 
       7 
     | 
    
         
            -
              - 0
         
     | 
| 
       8 
     | 
    
         
            -
              - 2
         
     | 
| 
       9 
     | 
    
         
            -
              - 6
         
     | 
| 
       10 
     | 
    
         
            -
              version: 0.2.6
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.15
         
     | 
| 
      
 5 
     | 
    
         
            +
              prerelease: 
         
     | 
| 
       11 
6 
     | 
    
         
             
            platform: x86-mswin32-60
         
     | 
| 
       12 
     | 
    
         
            -
            authors: 
     | 
| 
      
 7 
     | 
    
         
            +
            authors:
         
     | 
| 
       13 
8 
     | 
    
         
             
            - Brian Lopez
         
     | 
| 
       14 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       15 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       16 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2011-11-09 00:00:00.000000000 Z
         
     | 
| 
      
 13 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 14 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 15 
     | 
    
         
            +
              name: eventmachine
         
     | 
| 
      
 16 
     | 
    
         
            +
              requirement: &70324214809220 !ruby/object:Gem::Requirement
         
     | 
| 
      
 17 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 18 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 19 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 20 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 21 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 22 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 23 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 24 
     | 
    
         
            +
              version_requirements: *70324214809220
         
     | 
| 
      
 25 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 26 
     | 
    
         
            +
              name: rake-compiler
         
     | 
| 
      
 27 
     | 
    
         
            +
              requirement: &70324214807620 !ruby/object:Gem::Requirement
         
     | 
| 
      
 28 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 29 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 30 
     | 
    
         
            +
                - - ~>
         
     | 
| 
      
 31 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 32 
     | 
    
         
            +
                    version: 0.7.7
         
     | 
| 
      
 33 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 34 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 35 
     | 
    
         
            +
              version_requirements: *70324214807620
         
     | 
| 
      
 36 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 37 
     | 
    
         
            +
              name: rake
         
     | 
| 
      
 38 
     | 
    
         
            +
              requirement: &70324214806020 !ruby/object:Gem::Requirement
         
     | 
| 
      
 39 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 40 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 41 
     | 
    
         
            +
                - - =
         
     | 
| 
      
 42 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 43 
     | 
    
         
            +
                    version: 0.8.7
         
     | 
| 
      
 44 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 45 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 46 
     | 
    
         
            +
              version_requirements: *70324214806020
         
     | 
| 
      
 47 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 48 
     | 
    
         
            +
              name: rspec
         
     | 
| 
      
 49 
     | 
    
         
            +
              requirement: &70324214805220 !ruby/object:Gem::Requirement
         
     | 
| 
      
 50 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 51 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 52 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 53 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 54 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 55 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 56 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 57 
     | 
    
         
            +
              version_requirements: *70324214805220
         
     | 
| 
      
 58 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 59 
     | 
    
         
            +
              name: activerecord
         
     | 
| 
      
 60 
     | 
    
         
            +
              requirement: &70324214804240 !ruby/object:Gem::Requirement
         
     | 
| 
      
 61 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 62 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 63 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 64 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 65 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 66 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 67 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 68 
     | 
    
         
            +
              version_requirements: *70324214804240
         
     | 
| 
      
 69 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 70 
     | 
    
         
            +
              name: mysql
         
     | 
| 
      
 71 
     | 
    
         
            +
              requirement: &70324214803680 !ruby/object:Gem::Requirement
         
     | 
| 
      
 72 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 73 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 74 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 75 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 76 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 77 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 78 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 79 
     | 
    
         
            +
              version_requirements: *70324214803680
         
     | 
| 
      
 80 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 81 
     | 
    
         
            +
              name: do_mysql
         
     | 
| 
      
 82 
     | 
    
         
            +
              requirement: &70324214803140 !ruby/object:Gem::Requirement
         
     | 
| 
      
 83 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 84 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 85 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 86 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 87 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 88 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 89 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 90 
     | 
    
         
            +
              version_requirements: *70324214803140
         
     | 
| 
      
 91 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 92 
     | 
    
         
            +
              name: sequel
         
     | 
| 
      
 93 
     | 
    
         
            +
              requirement: &70324214802580 !ruby/object:Gem::Requirement
         
     | 
| 
      
 94 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 95 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 96 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 97 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 98 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 99 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 100 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 101 
     | 
    
         
            +
              version_requirements: *70324214802580
         
     | 
| 
      
 102 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 103 
     | 
    
         
            +
              name: faker
         
     | 
| 
      
 104 
     | 
    
         
            +
              requirement: &70324214801940 !ruby/object:Gem::Requirement
         
     | 
| 
      
 105 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 106 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 107 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 108 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 109 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 110 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 111 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 112 
     | 
    
         
            +
              version_requirements: *70324214801940
         
     | 
| 
       22 
113 
     | 
    
         
             
            description: 
         
     | 
| 
       23 
114 
     | 
    
         
             
            email: seniorlopez@gmail.com
         
     | 
| 
       24 
115 
     | 
    
         
             
            executables: []
         
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
116 
     | 
    
         
             
            extensions: []
         
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
            - README.rdoc
         
     | 
| 
       30 
     | 
    
         
            -
            files: 
         
     | 
| 
      
 117 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 118 
     | 
    
         
            +
            files:
         
     | 
| 
       31 
119 
     | 
    
         
             
            - .gitignore
         
     | 
| 
       32 
120 
     | 
    
         
             
            - .rspec
         
     | 
| 
      
 121 
     | 
    
         
            +
            - .rvmrc
         
     | 
| 
       33 
122 
     | 
    
         
             
            - CHANGELOG.md
         
     | 
| 
      
 123 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
       34 
124 
     | 
    
         
             
            - MIT-LICENSE
         
     | 
| 
       35 
     | 
    
         
            -
            - README. 
     | 
| 
      
 125 
     | 
    
         
            +
            - README.md
         
     | 
| 
       36 
126 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       37 
     | 
    
         
            -
            - VERSION
         
     | 
| 
       38 
127 
     | 
    
         
             
            - benchmark/active_record.rb
         
     | 
| 
      
 128 
     | 
    
         
            +
            - benchmark/active_record_threaded.rb
         
     | 
| 
       39 
129 
     | 
    
         
             
            - benchmark/allocations.rb
         
     | 
| 
       40 
130 
     | 
    
         
             
            - benchmark/escape.rb
         
     | 
| 
       41 
131 
     | 
    
         
             
            - benchmark/query_with_mysql_casting.rb
         
     | 
| 
       42 
132 
     | 
    
         
             
            - benchmark/query_without_mysql_casting.rb
         
     | 
| 
       43 
133 
     | 
    
         
             
            - benchmark/sequel.rb
         
     | 
| 
       44 
134 
     | 
    
         
             
            - benchmark/setup_db.rb
         
     | 
| 
      
 135 
     | 
    
         
            +
            - benchmark/threaded.rb
         
     | 
| 
       45 
136 
     | 
    
         
             
            - examples/eventmachine.rb
         
     | 
| 
       46 
137 
     | 
    
         
             
            - examples/threaded.rb
         
     | 
| 
       47 
138 
     | 
    
         
             
            - ext/mysql2/client.c
         
     | 
| 
         @@ -51,6 +142,7 @@ files: 
     | 
|
| 
       51 
142 
     | 
    
         
             
            - ext/mysql2/mysql2_ext.h
         
     | 
| 
       52 
143 
     | 
    
         
             
            - ext/mysql2/result.c
         
     | 
| 
       53 
144 
     | 
    
         
             
            - ext/mysql2/result.h
         
     | 
| 
      
 145 
     | 
    
         
            +
            - ext/mysql2/wait_for_single_fd.h
         
     | 
| 
       54 
146 
     | 
    
         
             
            - lib/active_record/connection_adapters/em_mysql2_adapter.rb
         
     | 
| 
       55 
147 
     | 
    
         
             
            - lib/active_record/connection_adapters/mysql2_adapter.rb
         
     | 
| 
       56 
148 
     | 
    
         
             
            - lib/active_record/fiber_patches.rb
         
     | 
| 
         @@ -58,9 +150,12 @@ files: 
     | 
|
| 
       58 
150 
     | 
    
         
             
            - lib/mysql2.rb
         
     | 
| 
       59 
151 
     | 
    
         
             
            - lib/mysql2/client.rb
         
     | 
| 
       60 
152 
     | 
    
         
             
            - lib/mysql2/em.rb
         
     | 
| 
      
 153 
     | 
    
         
            +
            - lib/mysql2/em_fiber.rb
         
     | 
| 
       61 
154 
     | 
    
         
             
            - lib/mysql2/error.rb
         
     | 
| 
       62 
155 
     | 
    
         
             
            - lib/mysql2/result.rb
         
     | 
| 
      
 156 
     | 
    
         
            +
            - lib/mysql2/version.rb
         
     | 
| 
       63 
157 
     | 
    
         
             
            - mysql2.gemspec
         
     | 
| 
      
 158 
     | 
    
         
            +
            - spec/em/em_fiber_spec.rb
         
     | 
| 
       64 
159 
     | 
    
         
             
            - spec/em/em_spec.rb
         
     | 
| 
       65 
160 
     | 
    
         
             
            - spec/mysql2/client_spec.rb
         
     | 
| 
       66 
161 
     | 
    
         
             
            - spec/mysql2/error_spec.rb
         
     | 
| 
         @@ -69,52 +164,54 @@ files: 
     | 
|
| 
       69 
164 
     | 
    
         
             
            - spec/spec_helper.rb
         
     | 
| 
       70 
165 
     | 
    
         
             
            - tasks/benchmarks.rake
         
     | 
| 
       71 
166 
     | 
    
         
             
            - tasks/compile.rake
         
     | 
| 
       72 
     | 
    
         
            -
            - tasks/jeweler.rake
         
     | 
| 
       73 
167 
     | 
    
         
             
            - tasks/rspec.rake
         
     | 
| 
       74 
168 
     | 
    
         
             
            - tasks/vendor_mysql.rake
         
     | 
| 
       75 
169 
     | 
    
         
             
            - lib/mysql2/1.8/mysql2.so
         
     | 
| 
       76 
170 
     | 
    
         
             
            - lib/mysql2/1.9/mysql2.so
         
     | 
| 
       77 
171 
     | 
    
         
             
            - lib/mysql2/mysql2.rb
         
     | 
| 
       78 
     | 
    
         
            -
            has_rdoc: true
         
     | 
| 
       79 
172 
     | 
    
         
             
            homepage: http://github.com/brianmario/mysql2
         
     | 
| 
       80 
173 
     | 
    
         
             
            licenses: []
         
     | 
| 
       81 
     | 
    
         
            -
             
     | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
       83 
     | 
    
         
            -
             
     | 
| 
      
 174 
     | 
    
         
            +
            post_install_message: ! "\n======================================================================================================\n\n
         
     | 
| 
      
 175 
     | 
    
         
            +
              \ You've installed the binary version of mysql2.\n  It was built using MySQL Connector/C
         
     | 
| 
      
 176 
     | 
    
         
            +
              version 6.0.2.\n  It's recommended to use the exact same version to avoid potential
         
     | 
| 
      
 177 
     | 
    
         
            +
              issues.\n\n  At the time of building this gem, the necessary DLL files where available\n
         
     | 
| 
      
 178 
     | 
    
         
            +
              \ in the following download:\n\n  http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick\n\n
         
     | 
| 
      
 179 
     | 
    
         
            +
              \ And put lib\\libmysql.dll file in your Ruby bin directory, for example C:\\Ruby\\bin\n\n======================================================================================================\n\n"
         
     | 
| 
      
 180 
     | 
    
         
            +
            rdoc_options:
         
     | 
| 
       84 
181 
     | 
    
         
             
            - --charset=UTF-8
         
     | 
| 
       85 
     | 
    
         
            -
            require_paths: 
     | 
| 
      
 182 
     | 
    
         
            +
            require_paths:
         
     | 
| 
       86 
183 
     | 
    
         
             
            - lib
         
     | 
| 
       87 
     | 
    
         
            -
             
     | 
| 
       88 
     | 
    
         
            -
            required_ruby_version: !ruby/object:Gem::Requirement 
         
     | 
| 
      
 184 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
       89 
185 
     | 
    
         
             
              none: false
         
     | 
| 
       90 
     | 
    
         
            -
              requirements: 
     | 
| 
       91 
     | 
    
         
            -
              - -  
     | 
| 
       92 
     | 
    
         
            -
                - !ruby/object:Gem::Version 
     | 
| 
       93 
     | 
    
         
            -
                   
     | 
| 
       94 
     | 
    
         
            -
                  segments: 
     | 
| 
      
 186 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 187 
     | 
    
         
            +
              - - ! '>='
         
     | 
| 
      
 188 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 189 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 190 
     | 
    
         
            +
                  segments:
         
     | 
| 
       95 
191 
     | 
    
         
             
                  - 0
         
     | 
| 
       96 
     | 
    
         
            -
                   
     | 
| 
       97 
     | 
    
         
            -
            required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
| 
      
 192 
     | 
    
         
            +
                  hash: -3932854765410334453
         
     | 
| 
      
 193 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       98 
194 
     | 
    
         
             
              none: false
         
     | 
| 
       99 
     | 
    
         
            -
              requirements: 
     | 
| 
       100 
     | 
    
         
            -
              - -  
     | 
| 
       101 
     | 
    
         
            -
                - !ruby/object:Gem::Version 
     | 
| 
       102 
     | 
    
         
            -
                   
     | 
| 
       103 
     | 
    
         
            -
                  segments: 
     | 
| 
      
 195 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 196 
     | 
    
         
            +
              - - ! '>='
         
     | 
| 
      
 197 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 198 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 199 
     | 
    
         
            +
                  segments:
         
     | 
| 
       104 
200 
     | 
    
         
             
                  - 0
         
     | 
| 
       105 
     | 
    
         
            -
                   
     | 
| 
      
 201 
     | 
    
         
            +
                  hash: -3932854765410334453
         
     | 
| 
       106 
202 
     | 
    
         
             
            requirements: []
         
     | 
| 
       107 
     | 
    
         
            -
             
     | 
| 
       108 
203 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       109 
     | 
    
         
            -
            rubygems_version: 1. 
     | 
| 
      
 204 
     | 
    
         
            +
            rubygems_version: 1.8.10
         
     | 
| 
       110 
205 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       111 
206 
     | 
    
         
             
            specification_version: 3
         
     | 
| 
       112 
207 
     | 
    
         
             
            summary: A simple, fast Mysql library for Ruby, binding to libmysql
         
     | 
| 
       113 
     | 
    
         
            -
            test_files: 
     | 
| 
      
 208 
     | 
    
         
            +
            test_files:
         
     | 
| 
      
 209 
     | 
    
         
            +
            - examples/eventmachine.rb
         
     | 
| 
      
 210 
     | 
    
         
            +
            - examples/threaded.rb
         
     | 
| 
      
 211 
     | 
    
         
            +
            - spec/em/em_fiber_spec.rb
         
     | 
| 
       114 
212 
     | 
    
         
             
            - spec/em/em_spec.rb
         
     | 
| 
       115 
213 
     | 
    
         
             
            - spec/mysql2/client_spec.rb
         
     | 
| 
       116 
214 
     | 
    
         
             
            - spec/mysql2/error_spec.rb
         
     | 
| 
       117 
215 
     | 
    
         
             
            - spec/mysql2/result_spec.rb
         
     | 
| 
      
 216 
     | 
    
         
            +
            - spec/rcov.opts
         
     | 
| 
       118 
217 
     | 
    
         
             
            - spec/spec_helper.rb
         
     | 
| 
       119 
     | 
    
         
            -
            - examples/eventmachine.rb
         
     | 
| 
       120 
     | 
    
         
            -
            - examples/threaded.rb
         
     |