Skip to content

Commit a3bfffc

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Remove support for libmysql-client from mysqli test suite
2 parents 6e598ec + 62d393b commit a3bfffc

File tree

69 files changed

+304
-569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+304
-569
lines changed

ext/mysqli/tests/071.phpt

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,8 @@ require_once('skipifconnectfailure.inc');
1616
var_dump($mysql->ping());
1717

1818
$ret = $mysql->kill($mysql->thread_id);
19-
if ($IS_MYSQLND) {
20-
if ($ret !== true){
21-
printf("[001] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true));
22-
}
23-
} else {
24-
/* libmysql return value seems to depend on server version */
25-
if ((($version >= 50123) || ($version <= 40200)) && $version != 50200) {
26-
/* TODO: find exact version */
27-
if ($ret !== true){
28-
printf("[001] Expecting boolean/true got %s/%s @\n", gettype($ret), var_export($ret, true), $version);
29-
}
30-
} else {
31-
if ($ret !== false){
32-
printf("[001] Expecting boolean/false got %s/%s @\n", gettype($ret), var_export($ret, true), $version);
33-
}
34-
}
19+
if ($ret !== true){
20+
printf("[001] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true));
3521
}
3622

3723
var_dump($mysql->ping());
@@ -43,22 +29,8 @@ require_once('skipifconnectfailure.inc');
4329
var_dump(mysqli_ping($mysql));
4430

4531
$ret = $mysql->kill($mysql->thread_id);
46-
if ($IS_MYSQLND) {
47-
if ($ret !== true){
48-
printf("[002] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true));
49-
}
50-
} else {
51-
/* libmysql return value seems to depend on server version */
52-
if ((($version >= 50123) || ($version <= 40200)) && $version != 50200) {
53-
/* TODO: find exact version */
54-
if ($ret !== true){
55-
printf("[002] Expecting boolean/true got %s/%s @\n", gettype($ret), var_export($ret, true), $version);
56-
}
57-
} else {
58-
if ($ret !== false){
59-
printf("[002] Expecting boolean/false got %s/%s @\n", gettype($ret), var_export($ret, true), $version);
60-
}
61-
}
32+
if ($ret !== true){
33+
printf("[002] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true));
6234
}
6335

6436
var_dump(mysqli_ping($mysql));

ext/mysqli/tests/bug38710.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $qry->prepare("SELECT REPEAT('a',100000)");
1616
$qry->execute();
1717
$qry->bind_result($text);
1818
$qry->fetch();
19-
if ($text !== str_repeat('a', ($IS_MYSQLND || mysqli_get_server_version($db) > 50110)? 100000:(mysqli_get_server_version($db)>=50000? 8193:8191))) {
19+
if ($text !== str_repeat('a', 100000)) {
2020
var_dump(strlen($text));
2121
}
2222
echo "Done";

ext/mysqli/tests/bug44897.phpt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ mysqli
66
<?php
77
require_once 'connect.inc';
88

9-
if (!$IS_MYSQLND) {
10-
die("skip: only available in mysqlnd");
11-
}
12-
139
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
1410
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
1511
}

ext/mysqli/tests/bug45019.phpt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,9 @@ require_once('skipifconnectfailure.inc');
3333

3434
$index = 0;
3535
while ($stmt->fetch()) {
36-
/* NOTE: libmysql - http://bugs.mysql.com/bug.php?id=47483 */
3736
if ($data[$index] != $column1) {
38-
if ($IS_MYSQLND || $index != 1) {
39-
printf("[004] Row %d, expecting %s/%s got %s/%s\n",
40-
$index + 1, gettype($data[$index]), $data[$index], gettype($column1), $column1);
41-
} else {
42-
if ($column1 != "thre")
43-
printf("[005] Got '%s'. Please check if http://bugs.mysql.com/bug.php?id=47483 has been fixed and adapt tests bug45019.phpt/mysqli_ps_select_union.phpt", $column1);
44-
}
37+
printf("[004] Row %d, expecting %s/%s got %s/%s\n",
38+
$index + 1, gettype($data[$index]), $data[$index], gettype($column1), $column1);
4539
}
4640
$index++;
4741
}

ext/mysqli/tests/bug45289.phpt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ require_once('skipifconnectfailure.inc');
2525
printf("[003] [%d] %s\n", $stmt->errno, $stmt->error);
2626

2727
if ($res = $link->store_result()) {
28-
if ($IS_MYSQLND)
29-
printf("[004] Can store result!\n");
30-
else
31-
printf("[004] [007] http://bugs.mysql.com/bug.php?id=47485\n");
28+
printf("[004] Can store result!\n");
3229
} else {
3330
printf("[004] [%d] %s\n", $link->errno, $link->error);
3431
}

ext/mysqli/tests/bug49442.phpt

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -63,45 +63,43 @@ mysqli.max_persistent=1
6363
mysqli_query($link, "DELETE FROM test");
6464
mysqli_close($link);
6565

66-
if ($IS_MYSQLND) {
67-
/*
68-
mysqlnd makes a connection created through mysql_init()/mysqli_real_connect() always a 'persistent' one.
69-
At this point 'persistent' is not to be confused with what a user calls a 'persistent' - in this case
70-
'persistent' means that mysqlnd uses malloc() instead of emalloc(). nothing else. ext/mysqli will
71-
not consider it as a 'persistent' connection in a user sense, ext/mysqli will not apply max_persistent etc.
72-
It's only about malloc() vs. emalloc().
73-
74-
However, the bug is about malloc() and efree(). You can make mysqlnd use malloc() by either using
75-
pconnect or mysql_init() - so we should test pconnect as well.
76-
*/
77-
$host = 'p:' . $host;
78-
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
79-
printf("[007] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
80-
}
66+
/*
67+
mysqlnd makes a connection created through mysql_init()/mysqli_real_connect() always a 'persistent' one.
68+
At this point 'persistent' is not to be confused with what a user calls a 'persistent' - in this case
69+
'persistent' means that mysqlnd uses malloc() instead of emalloc(). nothing else. ext/mysqli will
70+
not consider it as a 'persistent' connection in a user sense, ext/mysqli will not apply max_persistent etc.
71+
It's only about malloc() vs. emalloc().
72+
73+
However, the bug is about malloc() and efree(). You can make mysqlnd use malloc() by either using
74+
pconnect or mysql_init() - so we should test pconnect as well.
75+
*/
76+
$host = 'p:' . $host;
77+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
78+
printf("[007] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
79+
}
8180

82-
/* bug happened during query processing */
83-
if (!@mysqli_query($link, sprintf("LOAD DATA LOCAL INFILE '%s'
84-
INTO TABLE test
85-
FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '\''
86-
LINES TERMINATED BY '\n'",
87-
mysqli_real_escape_string($link, $file)))) {
88-
printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
89-
}
81+
/* bug happened during query processing */
82+
if (!@mysqli_query($link, sprintf("LOAD DATA LOCAL INFILE '%s'
83+
INTO TABLE test
84+
FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '\''
85+
LINES TERMINATED BY '\n'",
86+
mysqli_real_escape_string($link, $file)))) {
87+
printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
88+
}
9089

91-
/* we survived? that's good enough... */
90+
/* we survived? that's good enough... */
9291

93-
if (!$res = mysqli_query($link, "SELECT * FROM test ORDER BY id"))
94-
printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
92+
if (!$res = mysqli_query($link, "SELECT * FROM test ORDER BY id"))
93+
printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
9594

96-
$i = 0;
97-
while ($row = mysqli_fetch_assoc($res)) {
98-
if (($row['id'] != $rows[$i]['id']) || ($row['label'] != $rows[$i]['label'])) {
99-
printf("[010] Wrong values, check manually!\n");
100-
}
101-
$i++;
95+
$i = 0;
96+
while ($row = mysqli_fetch_assoc($res)) {
97+
if (($row['id'] != $rows[$i]['id']) || ($row['label'] != $rows[$i]['label'])) {
98+
printf("[010] Wrong values, check manually!\n");
10299
}
103-
mysqli_close($link);
100+
$i++;
104101
}
102+
mysqli_close($link);
105103

106104
print "done!";
107105
?>

ext/mysqli/tests/bug51647.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require_once "connect.inc";
99
if (!defined('MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT'))
1010
die("skip Requires MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT");
1111

12-
if ($IS_MYSQLND && !extension_loaded("openssl"))
12+
if (!extension_loaded("openssl"))
1313
die("skip PHP streams lack support for SSL. mysqli is compiled to use mysqlnd which uses PHP streams in turn.");
1414

1515
if (!($link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)))

ext/mysqli/tests/bug52891.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ mysqli
55
--SKIPIF--
66
<?php
77
require_once('skipifconnectfailure.inc');
8-
if (!$IS_MYSQLND) {
9-
die("skip: test applies only to mysqlnd");
10-
}
118
?>
129
--FILE--
1310
<?php

ext/mysqli/tests/bug55283.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require_once "connect.inc";
99
if (!defined('MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT'))
1010
die("skip Requires MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT");
1111

12-
if ($IS_MYSQLND && !extension_loaded("openssl"))
12+
if (!extension_loaded("openssl"))
1313
die("skip PHP streams lack support for SSL. mysqli is compiled to use mysqlnd which uses PHP streams in turn.");
1414

1515
if (!($link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)))

ext/mysqli/tests/bug62885.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ mysqli
55
--SKIPIF--
66
<?php
77
require_once("connect.inc");
8-
if (!$IS_MYSQLND) {
9-
die("skip mysqlnd only test");
10-
}
118
?>
129
--FILE--
1310
<?php

ext/mysqli/tests/bug63398.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ mysqli
55
--SKIPIF--
66
<?php
77
require_once "skipifconnectfailure.inc";
8-
if (!$IS_MYSQLND) {
9-
die("skip mysqlnd only test");
10-
}
118
?>
129
--FILE--
1310
<?php

ext/mysqli/tests/bug64726.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ mysqli
55
--SKIPIF--
66
<?php
77
require_once "skipifconnectfailure.inc";
8-
if (!$IS_MYSQLND) {
9-
die("skip mysqlnd only test");
10-
}
118
?>
129
--FILE--
1310
<?php

ext/mysqli/tests/bug67983.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ mysqli
55
--SKIPIF--
66
<?php
77
require_once('skipifconnectfailure.inc');
8-
if (!$IS_MYSQLND) {
9-
die("skip mysqlnd only test");
10-
}
118
?>
129
--FILE--
1310
<?php

ext/mysqli/tests/bug68077.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ mysqli
55
--SKIPIF--
66
<?php
77
require_once 'connect.inc';
8-
if (!$IS_MYSQLND) {
9-
die("skip: test applies only to mysqlnd");
10-
}
118
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
129
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
1310
}

ext/mysqli/tests/bug69899.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ mysqli
1111
--SKIPIF--
1212
<?php
1313
require_once __DIR__ . '/skipifconnectfailure.inc';
14-
if (!$IS_MYSQLND) {
15-
die('skip mysqlnd only');
16-
}
1714
?>
1815
--FILE--
1916
<?php

ext/mysqli/tests/bug70949.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ mysqli
55
--SKIPIF--
66
<?php
77
require_once 'skipifconnectfailure.inc';
8-
if (!$IS_MYSQLND) {
9-
die("skip mysqlnd only test");
10-
}
118
?>
129
--FILE--
1310
<?php

ext/mysqli/tests/bug71863.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ mysqli
55
--SKIPIF--
66
<?php
77
require_once 'skipifconnectfailure.inc';
8-
if (!$IS_MYSQLND) {
9-
die("skip mysqlnd only test");
10-
}
118
?>
129
--FILE--
1310
<?php

ext/mysqli/tests/bug77935.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ mysqli
55
--SKIPIF--
66
<?php
77
require_once('skipifconnectfailure.inc');
8-
if (!$IS_MYSQLND) {
9-
die("skip mysqlnd only test");
10-
}
118
?>
129
--FILE--
1310
<?php

ext/mysqli/tests/connect.inc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
/* Development setting: test experimental features and/or feature requests that never worked before? */
2626
$TEST_EXPERIMENTAL = 1 == getenv("MYSQL_TEST_EXPERIMENTAL");
2727

28-
$IS_MYSQLND = stristr(mysqli_get_client_info(), "mysqlnd");
29-
3028
if (!function_exists('sys_get_temp_dir')) {
3129
function sys_get_temp_dir() {
3230

ext/mysqli/tests/gh7837.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ mysqli
55
--SKIPIF--
66
<?php
77
require_once 'skipifconnectfailure.inc';
8-
if (!$IS_MYSQLND) {
9-
die("skip requires mysqlnd");
10-
}
118
?>
129
--FILE--
1310
<?php

ext/mysqli/tests/gh9590.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ posix
77
<?php
88
require_once('skipifconnectfailure.inc');
99

10-
if (!$IS_MYSQLND)
11-
die("skip mysqlnd only feature, compile PHP using --with-mysqli=mysqlnd");
12-
1310
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
1411
die("skip cannot connect");
1512

ext/mysqli/tests/mysqli_change_user_insert_id.phpt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ mysqli
55
--SKIPIF--
66
<?php
77
require_once 'skipifconnectfailure.inc';
8-
9-
if (!$IS_MYSQLND) {
10-
die("skip Might hit known and open bugs http://bugs.mysql.com/bug.php?id=30472, http://bugs.mysql.com/bug.php?id=45184");
11-
}
128
?>
139
--FILE--
1410
<?php

ext/mysqli/tests/mysqli_change_user_oo.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ mysqli
77
require_once 'skipifconnectfailure.inc';
88

99
require_once 'table.inc';
10-
if (!$IS_MYSQLND && (mysqli_get_server_version($link) < 50118 && mysqli_get_server_version($link) > 50100)) {
11-
die("skip Your MySQL Server version has a known bug that will cause a crash");
12-
}
1310

1411
if (mysqli_get_server_version($link) >= 50600)
1512
die("SKIP For MySQL < 5.6.0");

ext/mysqli/tests/mysqli_class_mysqli_interface.phpt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,10 @@ require_once('skipifconnectfailure.inc');
6161
'use_result' => true,
6262
);
6363

64-
if ($IS_MYSQLND) {
65-
// mysqlnd only
66-
/* $expected_methods['get_client_stats'] = true; */
67-
$expected_methods['get_connection_stats'] = true;
68-
$expected_methods['reap_async_query'] = true;
69-
$expected_methods['poll'] = true;
70-
}
64+
/* $expected_methods['get_client_stats'] = true; */
65+
$expected_methods['get_connection_stats'] = true;
66+
$expected_methods['reap_async_query'] = true;
67+
$expected_methods['poll'] = true;
7168

7269
/* we should add ruled when to expect them */
7370
if (function_exists('mysqli_debug'))

0 commit comments

Comments
 (0)