[MDEV-20745] Error 1156 if compression enabled and SQL select text is 27k long Created: 2019-10-04  Updated: 2019-10-06

Status: Open
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.2.27
Fix Version/s: 10.2

Type: Bug Priority: Major
Reporter: YURII KANTONISTOV Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None
Environment:

CentOS Linux release 7.6.1810 (Core)


Attachments: Text File gdb_mysqld_packets_out_of_order_1.txt     File net_serv.cc.fixed     Text File vrfstaticroute_table_and_select.txt    

 Description   

Error 1156 if compression enabled by client (CLIENT_COMPRESS) and SQL select text is 27k long, 100% resproducible:
errno=1156(08S01), Got packets out of order

Never occurs if compression disabled.

See the full select text in attachment - vrfstaticroute_table_and_select.txt

Debugged it setting breakpoint on the places where "packets out of order" condition detected, e.g. on net_serv.cc's "goto packets_out_of_order", see gdb_mysqld_packets_out_of_order_1.txt

Workarounded it by changing if condition in my_real_read, see net_serv.cc.fixed:

if (net->buff[ net->where_b + 3 ] != ( uchar )net->pkt_nr)
=>
if (net->buff[ net->where_b + 3 ] != ( uchar )net->compress_pkt_nr
&&
net->buff[ net->where_b + 3 ] != ( uchar )net->pkt_nr)

But not sure at all if it is a correct solution


Generated at Thu Feb 08 09:01:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.