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.
1 parent 3bac270 commit cd1d5edCopy full SHA for cd1d5ed
spec/mysql2/client_spec.rb
@@ -433,6 +433,15 @@ def connect *args
433
@multi_client = Mysql2::Client.new(DatabaseCredentials['root'].merge(:flags => Mysql2::Client::MULTI_STATEMENTS))
434
end
435
436
+ it "should raise an exception when one of multiple statements fails" do
437
+ result = @multi_client.query("SELECT 1 as 'set_1'; SELECT * FROM invalid_table_name;SELECT 2 as 'set_2';")
438
+ result.first['set_1'].should be(1)
439
+ lambda {
440
+ @multi_client.next_result
441
+ }.should raise_error(Mysql2::Error)
442
+ @multi_client.next_result.should be_false
443
+ end
444
+
445
it "returns multiple result sets" do
446
@multi_client.query( "select 1 as 'set_1'; select 2 as 'set_2'").first.should eql({ 'set_1' => 1 })
447
0 commit comments