Bug #81335 [NEW]: PHP Warning, Packets out of order after connection timeout
| From: | bohuslav at simek dot si | Date: | Fri, 06 Aug 2021 10:37:58 +0000 |
| Subject: | Bug #81335 [NEW]: PHP Warning, Packets out of order after connection timeout | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-235630@lists.php.net to get a copy of this message | ||
From: bohuslav at simek dot si
Operating system: Alpine Linux 3.14
PHP version: 7.4.22
Package: PDO MySQL
Bug Type: Bug
Bug description:PHP Warning, Packets out of order after connection timeout
Description:
------------
After migration from MySQL 8.0.23 to 8.0.25 a warning "Packets out of
order. Expected 1 received 0. Packet size=145" will be shown after MySQL
connection timeout. mysqlnd is used a as connection library.
pdo_mysql
PDO Driver for MySQL => enabled
Client API version => mysqlnd 8.0.8
I don't want to speculate, but this can be caused by changes introduce
in Connection Management by MySQL 8.0.24
(https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-24.html header
Connection Management Notes) as MySQL now provides reason why client has
been disconnected.
Test script:
---------------
<?php declare(strict_types=1);
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_PERSISTENT => false,
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET time_zone = "UTC"',
PDO::ATTR_EMULATE_PREPARES => true,
];
$pdo = new PDO(
'mysql:dbname=unit_tests;host=mysql-test;port=3306;charset=utf8mb4',
'root',
'',
$options
);
$pdo->exec('SET SESSION wait_timeout=1');
sleep(3);
$pdo->exec('SELECT 123'); // PHP Warning: Packets out of order.
Expected 1 received 0. Packet size=145
Expected result:
----------------
warning "Packets out of order. Expected 1 received 0. Packet size=145"
should not happen.
--
Edit bug report at https://bugs.php.net/bug.php?id=81335&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81335&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81335&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81335&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81335&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81335&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81335&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81335&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81335&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81335&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81335&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81335&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81335&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81335&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81335&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81335&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81335&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81335&r=mysqlcfg