[php-src] master: Fix ext\mysqli\tests\gh8978.phpt (#24221)
| From: | Kamil Tekiela via GitHub | Date: | Fri, 09 Oct 2026 17:20:39 +0000 |
| Subject: | [php-src] master: Fix ext\mysqli\tests\gh8978.phpt (#24221) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-142130@lists.php.net to get a copy of this message | ||
Author: Kamil Tekiela (kamil-tekiela)
Committer: GitHub (web-flow)
Pusher: kamil-tekiela
Date: 2026-10-09T18:20:35+01:00
Commit: https://github.com/php/php-src/commit/473660b2c45f79c6237d39a0aec401a4d3b787a4
Raw diff: https://github.com/php/php-src/commit/473660b2c45f79c6237d39a0aec401a4d3b787a4.diff
Fix ext\mysqli\tests\gh8978.phpt (#24221)
Changed paths:
M ext/mysqli/tests/bug51647.phpt
M ext/mysqli/tests/bug55283.phpt
M ext/mysqli/tests/gh8978.phpt
Diff:
diff --git a/ext/mysqli/tests/bug51647.phpt b/ext/mysqli/tests/bug51647.phpt
index afd136ddfc22..bd6988b8e170 100644
--- a/ext/mysqli/tests/bug51647.phpt
+++ b/ext/mysqli/tests/bug51647.phpt
@@ -16,27 +16,12 @@ if (!($link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)))
if (false === strpos($link->host_info, 'TCP/IP'))
die(sprintf("skip SSL only supported on TCP/IP"));
-$row = NULL;
-if ($res = $link->query('SHOW VARIABLES LIKE "have_ssl"')) {
- $row = $res->fetch_row();
-} else {
- if ($link->errno == 1064 && ($res = $link->query("SHOW VARIABLES"))) {
- while ($row = $res->fetch_row())
- if ($row[0] == 'have_ssl')
- break;
- } else {
- die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s",
$link->errno, $link->error));
- }
+$res = $link->query('SHOW VARIABLES LIKE "have_ssl"');
+$row = $res ? $res->fetch_row() : null;
+// MySQL 8.4+ no longer has have_ssl so the check is only relevant for older versions and MariaDB
+if ($row && $row[1] !== 'YES') {
+ die('skip Server has no SSL support');
}
-
-
-if (empty($row))
- die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno,
$link->error));
-
-if (($row[1] == 'NO') || ($row[1] == 'DISABLED'))
- die(sprintf("skip MySQL has no SSL support, [%d] %s", $link->errno,
$link->error));
-
-$link->close();
?>
--FILE--
<?php
diff --git a/ext/mysqli/tests/bug55283.phpt b/ext/mysqli/tests/bug55283.phpt
index 692968f9ee2b..57f90d6a9fc9 100644
--- a/ext/mysqli/tests/bug55283.phpt
+++ b/ext/mysqli/tests/bug55283.phpt
@@ -16,27 +16,12 @@ if (!($link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)))
if (false === strpos($link->host_info, 'TCP/IP'))
die(sprintf("skip SSL only supported on TCP/IP"));
-$row = NULL;
-if ($res = $link->query('SHOW VARIABLES LIKE "have_ssl"')) {
- $row = $res->fetch_row();
-} else {
- if ($link->errno == 1064 && ($res = $link->query("SHOW VARIABLES"))) {
- while ($row = $res->fetch_row())
- if ($row[0] == 'have_ssl')
- break;
- } else {
- die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s",
$link->errno, $link->error));
- }
+$res = $link->query('SHOW VARIABLES LIKE "have_ssl"');
+$row = $res ? $res->fetch_row() : null;
+// MySQL 8.4+ no longer has have_ssl so the check is only relevant for older versions and MariaDB
+if ($row && $row[1] !== 'YES') {
+ die('skip Server has no SSL support');
}
-
-
-if (empty($row))
- die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno,
$link->error));
-
-if (($row[1] == 'NO') || ($row[1] == 'DISABLED'))
- die(sprintf("skip MySQL has no SSL support, [%d] %s", $link->errno,
$link->error));
-
-$link->close();
?>
--FILE--
<?php
diff --git a/ext/mysqli/tests/gh8978.phpt b/ext/mysqli/tests/gh8978.phpt
index 92de63b381ca..9f67ff1fa0b5 100644
--- a/ext/mysqli/tests/gh8978.phpt
+++ b/ext/mysqli/tests/gh8978.phpt
@@ -4,7 +4,17 @@ Bug GH-8267 (Invalid error message when connection via SSL fails)
mysqli
--SKIPIF--
<?php
-require_once 'skipifconnectfailure.inc';
+require_once 'connect.inc';
+
+if (!($link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)))
+ die(sprintf("skip Connect failed, [%d] %s", mysqli_connect_errno(),
mysqli_connect_error()));
+
+$res = $link->query("SHOW VARIABLES LIKE 'have_ssl'");
+$row = $res ? $res->fetch_row() : null;
+// MySQL 8.4+ no longer has have_ssl so the check is only relevant for older versions and MariaDB
+if ($row && $row[1] !== 'YES') {
+ die('skip Server has no SSL support');
+}
?>
--FILE--
<?php