com php-src: Fix tests for MariaDB: ext/mysqli/tests/mysqli_c hange_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_st atements.phpt ext/pdo_mysql/tests/pdo_mysql_multi_s
tmt_nextrowset.phpt
| From: | Nikita Popov | Date: | Mon, 02 Nov 2020 08:58:46 +0000 |
| Subject: | com php-src: Fix tests for MariaDB: ext/mysqli/tests/mysqli_c hange_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_st atements.phpt ext/pdo_mysql/tests/pdo_mysql_multi_s tmt_nextrowset.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-114011@lists.php.net to get a copy of this message | ||
Commit: cf38a6f51f204eefd7b3c9bcfa2ae95acf1fc1e6
Author: Dharman <tekiela246@gmail.com> Wed, 28 Oct 2020 14:15:07 +0000
Committer: Nikita Popov <nikita.ppv@gmail.com> Mon, 2 Nov 2020 09:58:46 +0100
Parents: 526c624dc4e2569b39b8098e4ee97c1d22f84e12
Branches: PHP-8.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cf38a6f51f204eefd7b3c9bcfa2ae95acf1fc1e6
Log:
Fix tests for MariaDB
Closes GH-6390.
Changed paths:
M ext/mysqli/tests/mysqli_change_user_new.phpt
M ext/mysqli/tests/mysqli_change_user_old.phpt
M ext/pdo_mysql/tests/bug_38546.phpt
M ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements.phpt
M ext/pdo_mysql/tests/pdo_mysql_multi_stmt_nextrowset.phpt
Diff:
diff --git a/ext/mysqli/tests/mysqli_change_user_new.phpt
b/ext/mysqli/tests/mysqli_change_user_new.phpt
index bff89fb8ddd..d36f667314f 100644
--- a/ext/mysqli/tests/mysqli_change_user_new.phpt
+++ b/ext/mysqli/tests/mysqli_change_user_new.phpt
@@ -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
diff --git a/ext/mysqli/tests/mysqli_change_user_old.phpt
b/ext/mysqli/tests/mysqli_change_user_old.phpt
index bc7dec03e69..045479037ce 100644
--- a/ext/mysqli/tests/mysqli_change_user_old.phpt
+++ b/ext/mysqli/tests/mysqli_change_user_old.phpt
@@ -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!
diff --git a/ext/pdo_mysql/tests/bug_38546.phpt b/ext/pdo_mysql/tests/bug_38546.phpt
index 238bccb035e..8122c05317a 100644
--- a/ext/pdo_mysql/tests/bug_38546.phpt
+++ b/ext/pdo_mysql/tests/bug_38546.phpt
@@ -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
(
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements..phpt
b/ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements.phpt
index 62de8ad1ca3..f268117821d 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements.phpt
@@ -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) {
diff --git a/ext/pdo_mysql/tests/pdo_mysql_multi_stmt_nextrowset.phpt
b/ext/pdo_mysql/tests/pdo_mysql_multi_stmt_nextrowset.phpt
index a1f1644cf36..e17a2331097 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_multi_stmt_nextrowset.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_multi_stmt_nextrowset.phpt
@@ -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