]> granicus.if.org Git - php/commitdiff
Fix tests for MariaDB
authorDharman <tekiela246@gmail.com>
Wed, 28 Oct 2020 14:15:07 +0000 (14:15 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 2 Nov 2020 08:58:46 +0000 (09:58 +0100)
Closes GH-6390.

ext/mysqli/tests/mysqli_change_user_new.phpt
ext/mysqli/tests/mysqli_change_user_old.phpt
ext/pdo_mysql/tests/bug_38546.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements.phpt
ext/pdo_mysql/tests/pdo_mysql_multi_stmt_nextrowset.phpt

index bff89fb8ddd961c5e756feebe5c5bb041a8b0362..d36f667314f529ca0a0b92fefbd773b693b6c399 100644 (file)
@@ -11,6 +11,9 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
 
 if (mysqli_get_server_version($link) < 50600)
     die("SKIP For MySQL >= 5.6.0");
+
+if (mysqli_get_server_version($link) >= 10_00_00)
+    die("SKIP Not applicable for MariaDB");
 ?>
 --FILE--
 <?php
index bc7dec03e69941ecd368b5d2cf3957315c4a9120..045479037ce966aa6827da93960eedc0d30e01de 100644 (file)
@@ -9,7 +9,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
     die(sprintf("SKIP Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
         $host, $user, $db, $port, $socket));
 
-if (mysqli_get_server_version($link) >= 50600)
+if (mysqli_get_server_version($link) >= 50600 && mysqli_get_server_version($link) < 10_00_00)
     die("SKIP For MySQL < 5.6.0");
 ?>
 --FILE--
@@ -102,10 +102,14 @@ if (mysqli_get_server_version($link) >= 50600)
 
     mysqli_close($link);
 
-    if (false !== ($tmp = @mysqli_change_user($link, $user, $passwd, $db)))
-        printf("[026] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
+    try {
+        mysqli_change_user($link, $user, $passwd, $db);
+    } catch (Error $exception) {
+        echo $exception->getMessage() . "\n";
+    }
 
     print "done!";
 ?>
 --EXPECT--
+mysqli object is already closed
 done!
index 238bccb035ede072ef8120159cfa852f5a318629..8122c05317a5dd0a6604e370ff0fe24dc2ccc098 100644 (file)
@@ -230,14 +230,14 @@ Array
     [3] => 2
 )
 
-Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'true' for column 'some_bool_1' at row 1 in %s
+Warning: PDOStatement::execute(): SQLSTATE[%s]: %s: 1366 Incorrect integer value: 'true' for column %s at row 1 in %s
 array(3) {
   [0]=>
-  string(5) "HY000"
+  string(5) "%s"
   [1]=>
   int(1366)
   [2]=>
-  string(65) "Incorrect integer value: 'true' for column 'some_bool_1' at row 1"
+  string(%d) "Incorrect integer value: 'true' for column %s at row 1"
 }
 Array
 (
index 62de8ad1ca37b63f76ada7ccb271e31df3b2056f..f268117821d21fff75cab8c3d2395e0601648794 100644 (file)
@@ -73,7 +73,7 @@ array(1) {
   }
 }
 
-Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO %s(id) VALUES (3)' at line 1 in %s on line %d
+Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 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 'INSERT INTO %s(id) VALUES (3)' at line 1 in %s on line %d
 bool(false)
 string(5) "42000"
 array(2) {
index a1f1644cf368797d8bdc07f5aedafff0a1b3a249..e17a233109791741e9ff6c2dfb5482cc7818ef2e 100644 (file)
@@ -175,7 +175,7 @@ array(3) {
 }
 bool(false)
 
-Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO test (id, label) VALUES (99, 'x')' at line 1 in %s on line %d
+Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 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 'INSERT INTO test (id, label) VALUES (99, 'x')' at line 1 in %s on line %d
 string(5) "42000"
 
 Testing with PDO::MYSQL_ATTR_MULTI_STATEMENTS set to true