[MDEV-19893] Do not send error packets with seqno= 0 Created: 2019-06-27  Updated: 2022-01-11  Resolved: 2019-06-27

Status: Closed
Project: MariaDB Server
Component/s: Protocol
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: 10.2.26, 10.3.17, 10.4.7

Type: Bug Priority: Major
Reporter: Vladislav Vaintroub Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-21252 ER_HOST_IS_BLOCKED returns packet seq... Closed
Relates
relates to MXS-2562 Oracle's MySQL Connector/ODBC gets pa... Closed

 Description   

Sometimes, e.g when killing an idle connection, server might send an error packet to the client with sequence number = 0.

This does not play well with some clients, because Oracle (and some other) clients are not aware of out-of-band operations.
What happens in this case is

1. Idle connection is killed, error packet with seqno= 0 is sent to the client.
2. Error packet arrives to the client machine, and sits there in the OS socket buffers.
3. Client sends any command, e.g "SELECT 1", to the already dead connection. Client sets seqno=0 in his packet.
4. Client reads from socket, gets the packet from 1. with seqno=0, which it does not expect, since seqno is supposed to be incremented. Client complains, throws tantrums and exceptions.


Generated at Thu Feb 08 08:55:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.