Skip to content

Commit 3b2410e

Browse files
committed
Fix test
follow-up to 7a95e94 for MySQL < 5.6
1 parent e277763 commit 3b2410e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

ext/mysqli/tests/mysqli_report_wo_ps.phpt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ if (mysqli_get_server_version($link) >= 50600)
4848
mysqli_multi_query($link, "BAR; FOO;");
4949
mysqli_query($link, "FOO");
5050
mysqli_change_user($link, "0123456789-10-456789-20-456789-30-456789-40-456789-50-456789-60-456789-70-456789-80-456789-90-456789", "password", $db);
51-
mysqli_kill($link, -1);
51+
try {
52+
mysqli_kill($link, -1);
53+
} catch (\ValueError $e) {
54+
echo $e->getMessage() . \PHP_EOL;
55+
}
5256

5357
// mysqli_ping() cannot be tested, because one would need to cause an error inside the C function to test it
5458
mysqli_real_query($link, "FOO");
@@ -64,7 +68,11 @@ if (mysqli_get_server_version($link) >= 50600)
6468
mysqli_multi_query($link, "BAR; FOO;");
6569
mysqli_query($link, "FOO");
6670
mysqli_change_user($link, "This might work if you accept anonymous users in your setup", "password", $db);
67-
mysqli_kill($link, -1);
71+
try {
72+
mysqli_kill($link, -1);
73+
} catch (\ValueError $e) {
74+
echo $e->getMessage() . \PHP_EOL;
75+
}
6876
mysqli_real_query($link, "FOO");
6977
mysqli_select_db($link, "Oh lord, let this be an unknown database name");
7078

@@ -106,12 +114,10 @@ Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; ch
106114
Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
107115

108116
Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s) in %s on line %d
109-
110-
Warning: mysqli_kill(): processid should have positive value in %s on line %d
117+
mysqli_kill(): Argument #2 ($connection_id) must be greater than 0
111118

112119
Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
113-
114-
Warning: mysqli_kill(): processid should have positive value in %s on line %d
120+
mysqli_kill(): Argument #2 ($connection_id) must be greater than 0
115121
[011] Access denied for user '%s'@'%s' (using password: YES)
116122
[014] Access denied for user '%s'@'%s' (using password: YES)
117123
done!

0 commit comments

Comments
 (0)