summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-09-17 15:55:44 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-09-18 18:01:04 +0200
commit19314ff8874e7c0a04a97acf342341938c0ffa6c (patch)
tree4461fae47a1bb9f87005e579f60eeffed8e013fb
parent2d002258b800ee92dc99d577304e5f09fbb629b4 (diff)
downloadphp-git-19314ff8874e7c0a04a97acf342341938c0ffa6c.tar.gz
Fix some tests for libmysql
-rw-r--r--ext/mysqli/tests/bug66043.phpt29
-rw-r--r--ext/mysqli/tests/bug73800.phpt1
-rw-r--r--ext/mysqli/tests/bug77597.phpt1
-rw-r--r--ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt4
-rw-r--r--ext/mysqli/tests/mysqli_kill.phpt4
-rw-r--r--ext/mysqli/tests/mysqli_store_result_buffered_c.phpt5
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt1
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt2
8 files changed, 35 insertions, 12 deletions
diff --git a/ext/mysqli/tests/bug66043.phpt b/ext/mysqli/tests/bug66043.phpt
index 07714f217a..6b479a45ed 100644
--- a/ext/mysqli/tests/bug66043.phpt
+++ b/ext/mysqli/tests/bug66043.phpt
@@ -3,10 +3,6 @@ Bug #66043 (Segfault calling bind_param() on mysqli)
--SKIPIF--
<?php
require_once('skipif.inc');
-require_once("connect.inc");
-if ($IS_MYSQLND) {
- die("skip libmysql only test");
-}
require_once('skipifconnectfailure.inc');
?>
--FILE--
@@ -16,11 +12,34 @@ if (!$db = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
}
+if (!$db->query("DROP TABLE IF EXISTS test")) {
+ printf("[002] [%d] %s\n", mysqli_errno($db), mysqli_error($db));
+ die();
+}
+
+if (!$db->query("CREATE TABLE test(str TEXT)")) {
+ printf("[003] [%d] %s\n", mysqli_errno($db), mysqli_error($db));
+ die();
+}
+
+if (!$db->query("INSERT INTO test(str) VALUES ('Test')")) {
+ printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ die();
+}
+
$stmt = $db->stmt_init();
-$stmt->prepare("SELECT User FROM user WHERE password=\"\"");
+if (!$stmt->prepare("SELECT str FROM test")) {
+ printf("[004] [%d] %s\n", mysqli_errno($db), mysqli_error($db));
+ die();
+}
+
$stmt->execute();
$stmt->bind_result($testArg);
echo "Okey";
?>
+--CLEAN--
+<?php
+require_once("clean_table.inc");
+?>
--EXPECT--
Okey
diff --git a/ext/mysqli/tests/bug73800.phpt b/ext/mysqli/tests/bug73800.phpt
index af601c6e60..af3a5c8cfb 100644
--- a/ext/mysqli/tests/bug73800.phpt
+++ b/ext/mysqli/tests/bug73800.phpt
@@ -5,6 +5,7 @@ Bug #73800 (sporadic segfault with MYSQLI_OPT_INT_AND_FLOAT_NATIVE)
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
if (PHP_INT_SIZE != 8) die('skip requires 64-bit');
+if (!defined('MYSQLI_OPT_INT_AND_FLOAT_NATIVE')) die('skip requires mysqlnd');
?>
--FILE--
<?php
diff --git a/ext/mysqli/tests/bug77597.phpt b/ext/mysqli/tests/bug77597.phpt
index ef3cb0f952..52ae874454 100644
--- a/ext/mysqli/tests/bug77597.phpt
+++ b/ext/mysqli/tests/bug77597.phpt
@@ -4,6 +4,7 @@ Bug #77597: mysqli_fetch_field hangs scripts
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
+if (!defined('MYSQLI_STORE_RESULT_COPY_DATA')) die('skip requires mysqlnd');
?>
--FILE--
<?php
diff --git a/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt b/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt
index a9d54c4367..651520b70a 100644
--- a/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt
+++ b/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt
@@ -284,7 +284,7 @@ Magic, magic properties:
mysqli object is already closed
Property access is not allowed yet
Property access is not allowed yet
-mysqli->client_version = '80000'/integer
+mysqli->client_version = '%d'/integer
mysqli object is already closed
mysqli object is already closed
mysqli object is already closed
@@ -366,7 +366,7 @@ Magic, magic properties:
mysqli object is already closed
Property access is not allowed yet
Property access is not allowed yet
-mysqli->client_version = '80000'/integer
+mysqli->client_version = '%d'/integer
mysqli object is already closed
mysqli object is already closed
mysqli object is already closed
diff --git a/ext/mysqli/tests/mysqli_kill.phpt b/ext/mysqli/tests/mysqli_kill.phpt
index d1301ac550..40ca9eaa1a 100644
--- a/ext/mysqli/tests/mysqli_kill.phpt
+++ b/ext/mysqli/tests/mysqli_kill.phpt
@@ -95,7 +95,7 @@ object(mysqli)#%d (%d) {
["connect_error"]=>
NULL
["errno"]=>
- int(2006)
+ int(%d)
["error"]=>
string(%d) "%s"
["error_list"]=>
@@ -103,7 +103,7 @@ object(mysqli)#%d (%d) {
[0]=>
array(3) {
["errno"]=>
- int(2006)
+ int(%d)
["sqlstate"]=>
string(5) "%s"
["error"]=>
diff --git a/ext/mysqli/tests/mysqli_store_result_buffered_c.phpt b/ext/mysqli/tests/mysqli_store_result_buffered_c.phpt
index 6fa69005d2..70a864270d 100644
--- a/ext/mysqli/tests/mysqli_store_result_buffered_c.phpt
+++ b/ext/mysqli/tests/mysqli_store_result_buffered_c.phpt
@@ -4,9 +4,10 @@ mysqli_store_result()
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
+if (!defined('MYSQLI_STORE_RESULT_COPY_DATA')) {
+ die("skip Requires MYSQLI_STORE_RESULT_COPY_DATA");
+}
?>
---INI--
-mysqlnd.debug="d:t:O,{TMP}/mysqlnd.trace"
--FILE--
<?php
require_once("connect.inc");
diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt
index 8d51961c9d..99cd631a4a 100644
--- a/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt
@@ -48,6 +48,7 @@ MySQLPDOTest::skip();
} catch (PDOException $e) {
$expected = array(
"SQLSTATE[HY000] [1049] Unknown database 'letshopeinvalid'",
+ "SQLSTATE[42000] [1049] Unknown database 'letshopeinvalid'",
"SQLSTATE[HY000] [2002] No such file or directory"
);
printf("[003] URI=%s, DSN=%s, File=%s (%d bytes, '%s'), chr(0) test, %s\n",
diff --git a/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt b/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
index 8fcce4cc84..c9877f3ac1 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
@@ -27,7 +27,6 @@ if (!extension_loaded('mysqli') && !extension_loaded('mysqlnd')) {
"MYSQL_ATTR_SSL_CIPHER" => true,
"MYSQL_ATTR_COMPRESS" => true,
"MYSQL_ATTR_MULTI_STATEMENTS" => true,
- "MYSQL_ATTR_SSL_VERIFY_SERVER_CERT" => true,
);
if (!MySQLPDOTest::isPDOMySQLnd()) {
@@ -37,6 +36,7 @@ if (!extension_loaded('mysqli') && !extension_loaded('mysqlnd')) {
}
if (extension_loaded('mysqlnd')) {
+ $expected['MYSQL_ATTR_SSL_VERIFY_SERVER_CERT'] = true;
$expected['MYSQL_ATTR_SERVER_PUBLIC_KEY'] = true;
} else if (extension_loaded('mysqli')) {
if (mysqli_get_client_version() > 50605) {