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

From: Date: Thu, 11 Jan 2018 09:24:18 +0000
Subject: Bug #75798 [NEW]: PDOException: Packets out of order
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213464@lists.php.net to get a copy of this message
From:             terrywongvip at qq dot com
Operating system: CentOS release 6.8 (Final)
PHP version:      7.1.13
Package:          PDO MySQL
Bug Type:         Bug
Bug description:PDOException: Packets out of order

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 bug report at https://bugs.php.net/bug.php?id=75798&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=75798&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=75798&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=75798&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=75798&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=75798&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=75798&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=75798&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=75798&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=75798&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=75798&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=75798&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=75798&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=75798&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75798&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=75798&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=75798&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=75798&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75798&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=75798&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=75798&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#213464) next »