Skip to content

Commit b5a6f3d

Browse files
committed
Fix tests failing on MariaDB
This only fixes: - `t/40server_prepare.t` - `t/99compression.t` There is at least one other test that needs fixing. Tested locally with MariaDB Server 11.7.2
1 parent 96eef72 commit b5a6f3d

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

lib/DBD/mysql.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ In this case DBD::mysql fallbacks to normal non-prepared statement and tries aga
12611261
12621262
=item mysql_server_prepare_disable_fallback
12631263
1264-
This option disable fallback to normal non-prepared statement when mysql server
1264+
This option disables fallback to normal non-prepared statement when mysql server
12651265
does not support execution of current statement as prepared.
12661266
12671267
Useful when you want to be sure that statement is going to be executed as

t/40server_prepare.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ my $dbname = $dbh->selectrow_arrayref("SELECT DATABASE()")->[0];
8888
$dbh->{mysql_server_prepare_disable_fallback} = 1;
8989
my $error_handler_called = 0;
9090
$dbh->{HandleError} = sub { $error_handler_called = 1; die $_[0]; };
91-
eval { $dbh->prepare("USE $dbname") };
91+
eval { $dbh->prepare('PREPARE stmt FROM "SELECT 1"') };
9292
$dbh->{HandleError} = undef;
93-
ok($error_handler_called, 'USE is not supported with mysql_server_prepare_disable_fallback=1');
93+
ok($error_handler_called, 'PREPARE statement is not supported with mysql_server_prepare_disable_fallback=1');
9494

9595
$dbh->{mysql_server_prepare_disable_fallback} = 0;
9696
my $sth4;
97-
ok($sth4 = $dbh->prepare("USE $dbname"), 'USE is supported with mysql_server_prepare_disable_fallback=0');
97+
ok($sth4 = $dbh->prepare('PREPARE stmt FROM "SELECT 1"'), 'PREPARE statement is supported with mysql_server_prepare_disable_fallback=0');
9898
ok($sth4->execute());
9999
ok($sth4->finish());
100100

t/99compression.t

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ if ($dbh->{mysql_serverversion} < 80000) {
2121
plan skip_all => "test requires 8.x or newer";
2222
}
2323

24+
if ($dbh->{'mysql_serverinfo'} =~ 'MariaDB') {
25+
plan skip_all => "No zstd or Compression_algorithm on MariaDB";
26+
}
27+
2428
foreach my $compression ( "zlib", "zstd", "0", "1" ) {
2529
my ($dbh, $sth, $row);
2630

0 commit comments

Comments
 (0)