Bug #75798 [Com]: PDOException: Packets out of order

From: Date: Fri, 13 Dec 2019 10:53:50 +0000
Subject: Bug #75798 [Com]: PDOException: Packets out of order
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224265@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75798&edit=1

 ID:                 75798
 Comment by:         g dot barbot at webgis dot fr
 Reported by:        terrywongvip at qq dot com
 Summary:            PDOException: Packets out of order
 Status:             Open
 Type:               Bug
 Package:            PDO MySQL
 Operating System:   CentOS release 6.8 (Final)
 PHP Version:        7.1.13
 Block user comment: N
 Private report:     N

 New Comment:

Hi,

i have the same probleme on Php 8.0.0-dev

with PDO :
new PDO('mysql:host='.$dsn['hostspec'].';dbname='.
$dsn['database'],$dsn['username'],$dsn['password'])

give error : Uncaught PDOException: Packets out of order. Expected 3 received 2. Packet size=22

with mysqli_connect : 

mysqli_connect($dsn['hostspec'],$dsn['username'],$dsn['password'],
$dsn['database'],$dsn['port'],$dsn['socket']);

give error : Packets out of order. Expected 3 received 2. Packet size=22

++


Previous Comments:
------------------------------------------------------------------------
[2018-01-11 09:24:12] terrywongvip at qq dot com

Description:
------------
---
From manual page: http://www.php.net/book.pdo
---

When new a PDO instance with php7.1.13 , it will expose a fatal error , with mesage like
"PDOException: Packets out of order" , but when I use php5.6.30 or php7.20 , it works and
return a resource .

Test script:
---------------
--- code ---

$dbh = new
PDO("mysql:host=127.0.0.1;port=3306;dbname=test","demo","demo");
var_dump($dbh);

--- error message ---

PHP Fatal error:  Uncaught PDOException: Packets out of order. Expected 3 received 2. Packet size=22
in /data1/www/xxx/admin/protected/test1.php:3
Stack trace:
#0 /data1/www/xxx/admin/protected/test1.php(3): PDO->__construct('mysql:host=10.1...',
'demo', 'demo')
#1 {main}

Next PDOException: SQLSTATE[HY000] [2006] MySQL server has gone away in
/data1/www/xxx/admin/protected/test1.php:3


Actual result:
--------------
--- backtrace ---

#0  php_error_docref0 (docref=0x0, type=2, format=0xdd975e "%s") at
/data1/download/php-7.1.13/main/main.c:970
#1  0x00000000007a4824 in mysqlnd_read_packet_header_and_body (packet_header=0x7ffff4278300,
pfc=0x7ffff4270040, vio=0x7ffff4202120, 
    stats=<value optimized out>, error_info=0x7ffff426b120, connection_state=0x7ffff426b348,
buf=0x7ffff4277000 "\270q'\364\377\177", 
    buf_size=4095, packet_type_as_text=0x8d0cb2 "OK", packet_type=PROT_OK_PACKET)
    at /data1/download/php-7.1.13/ext/mysqlnd/mysqlnd_wireprotocol.c:310
#2  0x00000000007a66e5 in php_mysqlnd_auth_response_read (_packet=0x7ffff4278300)
    at /data1/download/php-7.1.13/ext/mysqlnd/mysqlnd_wireprotocol.c:678
#3  0x00000000007ab1f7 in mysqlnd_auth_handshake (conn=0x7ffff426b000, user=<value optimized
out>, passwd=<value optimized out>, 
    passwd_len=<value optimized out>, db=0x7ffff4272028 "test", db_len=4,
session_options=0x7ffff426b378, mysql_flags=762509, server_charset_no=8, 
    use_full_blown_auth_packet=1 '\001', auth_protocol=0x7ffff4201440
"mysql_native_password", 
    auth_plugin_data=0x1337fe0 "\252h\aL\350b\031缸\301\326t\374\372M\366\066d\211",
auth_plugin_data_len=20, 
    switch_to_auth_protocol=0x7fffffffa408, switch_to_auth_protocol_len=0x7fffffffa400,
switch_to_auth_protocol_data=0x7fffffffa3f8, 
    switch_to_auth_protocol_data_len=0x7fffffffa3f0) at
/data1/download/php-7.1.13/ext/mysqlnd/mysqlnd_auth.c:314
#4  0x00000000007ab732 in mysqlnd_run_authentication (conn=0x7ffff426b000, user=0x7ffff4272010
"demo", passwd=0x7ffff4272018 "demo", passwd_len=4, 
    db=0x7ffff4272028 "test", db_len=4, auth_plugin_data=..., auth_protocol=0x0,
charset_no=8, session_options=0x7ffff426b378, mysql_flags=762509, 
    silent=0 '\000', is_change_user=0 '\000') at
/data1/download/php-7.1.13/ext/mysqlnd/mysqlnd_auth.c:119



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75798&edit=1


Thread (4 messages)

« previous php.bugs (#224265) next »