Skip to content

Commit 6e56949

Browse files
committed
test database is already in use
1 parent c9ef244 commit 6e56949

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

spec/mysql2/result_spec.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292

9393
context "#fields" do
9494
before(:each) do
95-
@client.query "USE test"
9695
@test_result = @client.query("SELECT * FROM mysql2_test ORDER BY id DESC LIMIT 1")
9796
end
9897

@@ -116,7 +115,6 @@
116115
end
117116

118117
it "should set the actual count of rows after streaming" do
119-
@client.query "USE test"
120118
result = @client.query("SELECT * FROM mysql2_test", :stream => true, :cache_rows => false)
121119
result.count.should eql(0)
122120
result.each {|r| }
@@ -129,7 +127,6 @@
129127
end
130128

131129
it "#count should be zero for rows after streaming when there were no results" do
132-
@client.query "USE test"
133130
result = @client.query("SELECT * FROM mysql2_test WHERE null_test IS NOT NULL", :stream => true, :cache_rows => false)
134131
result.count.should eql(0)
135132
result.each.to_a
@@ -161,7 +158,6 @@
161158

162159
context "row data type mapping" do
163160
before(:each) do
164-
@client.query "USE test"
165161
@test_result = @client.query("SELECT * FROM mysql2_test ORDER BY id DESC LIMIT 1").first
166162
end
167163

@@ -347,7 +343,6 @@
347343
result['enum_test'].encoding.should eql(Encoding.find('utf-8'))
348344

349345
client2 = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => 'ascii'))
350-
client2.query "USE test"
351346
result = client2.query("SELECT * FROM mysql2_test ORDER BY id DESC LIMIT 1").first
352347
result['enum_test'].encoding.should eql(Encoding.find('us-ascii'))
353348
client2.close
@@ -377,7 +372,6 @@
377372
result['set_test'].encoding.should eql(Encoding.find('utf-8'))
378373

379374
client2 = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => 'ascii'))
380-
client2.query "USE test"
381375
result = client2.query("SELECT * FROM mysql2_test ORDER BY id DESC LIMIT 1").first
382376
result['set_test'].encoding.should eql(Encoding.find('us-ascii'))
383377
client2.close
@@ -460,7 +454,6 @@
460454
result[field].encoding.should eql(Encoding.find('utf-8'))
461455

462456
client2 = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => 'ascii'))
463-
client2.query "USE test"
464457
result = client2.query("SELECT * FROM mysql2_test ORDER BY id DESC LIMIT 1").first
465458
result[field].encoding.should eql(Encoding.find('us-ascii'))
466459
client2.close

0 commit comments

Comments
 (0)