|
92 | 92 |
|
93 | 93 | context "#fields" do
|
94 | 94 | before(:each) do
|
95 |
| - @client.query "USE test" |
96 | 95 | @test_result = @client.query("SELECT * FROM mysql2_test ORDER BY id DESC LIMIT 1")
|
97 | 96 | end
|
98 | 97 |
|
|
116 | 115 | end
|
117 | 116 |
|
118 | 117 | it "should set the actual count of rows after streaming" do
|
119 |
| - @client.query "USE test" |
120 | 118 | result = @client.query("SELECT * FROM mysql2_test", :stream => true, :cache_rows => false)
|
121 | 119 | result.count.should eql(0)
|
122 | 120 | result.each {|r| }
|
|
129 | 127 | end
|
130 | 128 |
|
131 | 129 | it "#count should be zero for rows after streaming when there were no results" do
|
132 |
| - @client.query "USE test" |
133 | 130 | result = @client.query("SELECT * FROM mysql2_test WHERE null_test IS NOT NULL", :stream => true, :cache_rows => false)
|
134 | 131 | result.count.should eql(0)
|
135 | 132 | result.each.to_a
|
|
161 | 158 |
|
162 | 159 | context "row data type mapping" do
|
163 | 160 | before(:each) do
|
164 |
| - @client.query "USE test" |
165 | 161 | @test_result = @client.query("SELECT * FROM mysql2_test ORDER BY id DESC LIMIT 1").first
|
166 | 162 | end
|
167 | 163 |
|
|
347 | 343 | result['enum_test'].encoding.should eql(Encoding.find('utf-8'))
|
348 | 344 |
|
349 | 345 | client2 = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => 'ascii'))
|
350 |
| - client2.query "USE test" |
351 | 346 | result = client2.query("SELECT * FROM mysql2_test ORDER BY id DESC LIMIT 1").first
|
352 | 347 | result['enum_test'].encoding.should eql(Encoding.find('us-ascii'))
|
353 | 348 | client2.close
|
|
377 | 372 | result['set_test'].encoding.should eql(Encoding.find('utf-8'))
|
378 | 373 |
|
379 | 374 | client2 = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => 'ascii'))
|
380 |
| - client2.query "USE test" |
381 | 375 | result = client2.query("SELECT * FROM mysql2_test ORDER BY id DESC LIMIT 1").first
|
382 | 376 | result['set_test'].encoding.should eql(Encoding.find('us-ascii'))
|
383 | 377 | client2.close
|
|
460 | 454 | result[field].encoding.should eql(Encoding.find('utf-8'))
|
461 | 455 |
|
462 | 456 | client2 = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => 'ascii'))
|
463 |
| - client2.query "USE test" |
464 | 457 | result = client2.query("SELECT * FROM mysql2_test ORDER BY id DESC LIMIT 1").first
|
465 | 458 | result[field].encoding.should eql(Encoding.find('us-ascii'))
|
466 | 459 | client2.close
|
|
0 commit comments