[php-src] PHP-8.3: Merge branch 'PHP-8.2' into PHP-8.3
| From: | Jakub Zelenka | Date: | Fri, 12 Apr 2024 09:57:58 +0000 |
| Subject: | [php-src] PHP-8.3: Merge branch 'PHP-8.2' into PHP-8.3 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-128082@lists.php.net to get a copy of this message | ||
Author: Jakub Zelenka (bukka)
Date: 2024-04-12T10:57:42+01:00
Commit: https://github.com/php/php-src/commit/fbcad699cbd45baee908363c2074ccb99a5e4161
Raw diff: https://github.com/php/php-src/commit/fbcad699cbd45baee908363c2074ccb99a5e4161.diff
Merge branch 'PHP-8.2' into PHP-8.3
Changed paths:
D ext/mysqli/tests/bug81335.phpt
M ext/mysqlnd/mysqlnd_enum_n_def.h
M ext/mysqlnd/mysqlnd_result.c
M ext/mysqlnd/mysqlnd_wireprotocol.c
Diff:
diff --git a/ext/mysqli/tests/bug81335.phpt b/ext/mysqli/tests/bug81335.phpt
deleted file mode 100644
index 26f6bcd7e2d14..0000000000000
--- a/ext/mysqli/tests/bug81335.phpt
+++ /dev/null
@@ -1,34 +0,0 @@
---TEST--
-Bug #81335: Packets out of order after connection timeout
---EXTENSIONS--
-mysqli
---SKIPIF--
-<?php
-if (PHP_OS === 'WINNT') die('skip on windows');
-if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
-
-require_once 'connect.inc';
-if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip cannot
connect");
-if (mysqli_get_server_version($link) < 80024 || str_contains(mysqli_get_server_info($link),
'MariaDB')) {
- die("skip: Due to many MySQL Server differences, the test requires >= 8.0.24");
-}
-?>
---FILE--
-<?php
-
-require_once 'connect.inc';
-mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
-$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
-$mysqli->query('SET WAIT_TIMEOUT=1');
-usleep(1000000 * 1.1);
-try {
- $mysqli->query('SELECT 1 + 1');
-} catch(mysqli_sql_exception $e) {
- echo $e->getMessage();
- echo "\n";
- echo $e->getCode();
-}
-?>
---EXPECTF--
-The client was disconnected by the server because of inactivity. See wait_timeout and
interactive_timeout for configuring this behavior.
-4031
diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h
index 00b46e8c7d22d..110e62c71bab0 100644
--- a/ext/mysqlnd/mysqlnd_enum_n_def.h
+++ b/ext/mysqlnd/mysqlnd_enum_n_def.h
@@ -130,7 +130,6 @@
#define CR_INVALID_PARAMETER_NO 2034
#define CR_INVALID_BUFFER_USE 2035
#define CR_LOAD_DATA_LOCAL_INFILE_REJECTED 2068
-#define CR_CLIENT_INTERACTION_TIMEOUT 4031
#define MYSQLND_EE_FILENOTFOUND 7890
diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c
index cab0889cec9ea..08faed6d05874 100644
--- a/ext/mysqlnd/mysqlnd_result.c
+++ b/ext/mysqlnd/mysqlnd_result.c
@@ -183,7 +183,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s)
UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status);
if (FAIL == (ret = PACKET_READ(conn, &rset_header))) {
- if (conn->error_info->error_no != CR_SERVER_GONE_ERROR &&
conn->error_info->error_no != CR_CLIENT_INTERACTION_TIMEOUT) {
+ if (conn->error_info->error_no != CR_SERVER_GONE_ERROR) {
php_error_docref(NULL, E_WARNING, "Error reading result set's header");
}
break;
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 1ff378bdf1748..14cbe518bebf8 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -267,19 +267,6 @@ mysqlnd_read_header(MYSQLND_PFC * pfc, MYSQLND_VIO * vio, MYSQLND_PACKET_HEADER
pfc->data->packet_no++;
DBG_RETURN(PASS);
}
- // @see https://dev.mysql.com/worklog/task/?id=12999
- if (header->size > 0) {
- zend_uchar *buf = mnd_emalloc(header->size);
- if ((PASS == pfc->data->m.receive(pfc, vio, buf, header->size, conn_stats, error_info))
&& buf[0] == ERROR_MARKER) {
- php_mysqlnd_read_error_from_line(buf + 1, header->size - 1,
- error_info->error, sizeof(error_info->error),
- &error_info->error_no, error_info->sqlstate
- );
- mnd_efree(buf);
- DBG_RETURN(FAIL);
- }
- mnd_efree(buf);
- }
DBG_ERR_FMT("Logical link: packets out of order. Expected %u received %u. Packet
size=%zu",
pfc->data->packet_no, header->packet_no, header->size);
@@ -307,9 +294,7 @@ mysqlnd_read_packet_header_and_body(MYSQLND_PACKET_HEADER * packet_header,
DBG_INF_FMT("buf=%p size=%zu", buf, buf_size);
if (FAIL == mysqlnd_read_header(pfc, vio, packet_header, stats, error_info)) {
SET_CONNECTION_STATE(connection_state, CONN_QUIT_SENT);
- if (error_info->error_no == 0) {
- SET_CLIENT_ERROR(error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
- }
+ SET_CLIENT_ERROR(error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
DBG_ERR_FMT("Can't read %s's header", packet_type_as_text);
DBG_RETURN(FAIL);
}