php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75798 PDOException: Packets out of order
Submitted: 2018-01-11 09:24 UTC Modified: -
Votes:4
Avg. Score:3.8 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:0 (0.0%)
From: terrywongvip at qq dot com Assigned:
Status: Open Package: PDO MySQL
PHP Version: 7.1.13 OS: CentOS release 6.8 (Final)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
42 - 6 = ?
Subscribe to this entry?

 
 [2018-01-11 09:24 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Oct 21 08:01:27 2019 UTC