We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4afe17f + cd1d5ed commit 76d13e4Copy full SHA for 76d13e4
spec/mysql2/client_spec.rb
@@ -451,6 +451,15 @@ def connect *args
451
@multi_client = Mysql2::Client.new(DatabaseCredentials['root'].merge(:flags => Mysql2::Client::MULTI_STATEMENTS))
452
end
453
454
+ it "should raise an exception when one of multiple statements fails" do
455
+ result = @multi_client.query("SELECT 1 as 'set_1'; SELECT * FROM invalid_table_name;SELECT 2 as 'set_2';")
456
+ result.first['set_1'].should be(1)
457
+ lambda {
458
+ @multi_client.next_result
459
+ }.should raise_error(Mysql2::Error)
460
+ @multi_client.next_result.should be_false
461
+ end
462
+
463
it "returns multiple result sets" do
464
@multi_client.query( "select 1 as 'set_1'; select 2 as 'set_2'").first.should eql({ 'set_1' => 1 })
465
0 commit comments