Skip to content

Commit

Permalink
Add test for changing $dbh->{mariadb_multi_statements} at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
pali committed Jul 14, 2023
1 parent 1c302db commit e8bbc0d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion t/76multi_statement.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ my $dbh = DbiTestConnect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 0, AutoCommit => 0,
mariadb_multi_statements => 1 });

plan tests => 77;
plan tests => 81;

ok (defined $dbh, "Connected to database with multi statement support");

Expand Down Expand Up @@ -125,4 +125,12 @@ $dbh->{mariadb_server_prepare}= 0;
ok(!eval { $sth->{mariadb_type} });
is($sth->rows, -1);

# Check that it is possible to turn off/on mariadb_multi_statements at runtime
$dbh->{mariadb_multi_statements} = 0;
ok(!$dbh->{mariadb_multi_statements});
ok(!eval { $dbh->do("SELECT 1; SELECT 1;") });
$dbh->{mariadb_multi_statements} = 1;
ok($dbh->{mariadb_multi_statements});
ok($dbh->do("SELECT 1; SELECT 1;"));

$dbh->disconnect();

0 comments on commit e8bbc0d

Please sign in to comment.