-
Notifications
You must be signed in to change notification settings - Fork 341
Packet received out-of-order. Expected 1; got 84. #651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do you have a SQL statement (and database structure) that reproduces the problem? Otherwise, if you're not using SSL, a packet capture (with Wireshark or similar) will show the network traffic that's causing the problem. |
SET @hereami = POINT(0,0); SELECT types.id , concat( min(types.name) ,' (', count(st_site) ,')') as name, min(parent.name) parent, min(parent.id) parent_id , min(parent.display_order) display_order1, min(types.display_order) display_order FROM types ,types as parent , sites_types where st_type=types.id and parent.id=types.parent_id and types.id > 0 and st_site in ( SELECT /*0, 0, 0 */ search_sites.id FROM search_sites WHERE
1=1
and search_sites.id in (select st_site from sites_types where st_site_visible=1 and st_speciality=2199) and city in(1397)) and types.parent_id=2199 group by types.id ORDER BY display_order1 desc, display_order desc, min(types.name) asc; I was tried to debug the problem, the problem is in the specific query (or similar), in a ~ 1/30 factor. I have a PCAP with the problem (and also the 0,1 problem). I can send it by mail but not upload it to public. |
I was sent a mail with a PCAP file with the problem. |
Thanks; I have it. |
Update: I was removed the usage of the the error was removed. testcase : static void Main(string[] args)
{
var logger = new MySqlConnector.Logging.ConsoleLoggerProvider(MySqlConnector.Logging.MySqlConnectorLogLevel.Debug);
MySqlConnector.Logging.MySqlConnectorLogManager.Provider = logger;
var Conn = new MySqlConnection("server=........; pooling=true;Connection reset =false; Min Pool Size=5;Max Pool Size=20; Connect Timeout=10;default command timeout=30;UseAffectedRows=true;Allow User Variables=true;CharacterSet=utf8mb4");
Conn.Open();
string sql = @"
SET @hereami = POINT(32.08373,34.8965); SELECT types.id , concat( min(types.name) ,' (', count(st_site) ,')') as name, min(parent.name) parent, min(parent.id) parent_id , min(parent.display_order) display_order1, min(types.display_order) display_order FROM types ,types as parent , sites_types where st_type=types.id and parent.id=types.parent_id and types.id > 0 and st_site in ( SELECT /*0, 32.08373, 34.8965 */ search_sites.id FROM search_sites WHERE
1=1
and search_sites.id in (select st_site from sites_types where st_site_visible=1 and st_speciality=1686) and city in(1792)) and types.parent_id=1686 group by types.id ORDER BY display_order1 desc, display_order desc, min(types.name) asc";
// without parameters and Allow User Variables=true it working
string sql2 = @"
SELECT types.id , concat( min(types.name) ,' (', count(st_site) ,')') as name, min(parent.name) parent, min(parent.id) parent_id , min(parent.display_order) display_order1, min(types.display_order) display_order FROM types ,types as parent , sites_types where st_type=types.id and parent.id=types.parent_id and types.id > 0 and st_site in ( SELECT /*0, 32.08373, 34.8965 */ search_sites.id FROM search_sites WHERE
1=1
and search_sites.id in (select st_site from sites_types where st_site_visible=1 and st_speciality=1686) and city in(1792)) and types.parent_id=1686 group by types.id ORDER BY display_order1 desc, display_order desc, min(types.name) asc";
var Cmd = new MySqlCommand(sql);
Cmd.Connection = Conn;
for (int i = 0; i < 2200; i++)
{
using (var oReader =Cmd.ExecuteReader()) {
oReader.Read();
}
}
Console.ReadKey();
} |
The cause of this is just like #612 (comment). Here's the end of a query followed by the server response. There are 11 bytes of garbage at the beginning, which contain part of the query the client submitted. The 0x54 is being (mis)interpreted as packet sequence number 84. Then there is the expected OK packet (green) followed by the column count packet (purple). CC @vaintroub are you aware of any MariaDB-specific bugs that could cause a server response to be prefixed with 11 bytes of random memory possibly initialised with the client's query? This is on MariaDB 10.3.15 (running on Windows Server AFAIK). |
I haven't Google translated all the Russian in this case, but this appears to be the same issue: https://jira.mariadb.org/browse/MDEV-16308 |
Yes, you found that as I was writing. This is an unsolved mystery case. We tried hard to understand what's going on and how is that possible, did not have any idea so far. |
Closing this as an external (MariaDB) issue. |
Workaround: use SELECT and not SET.
|
Uh oh!
There was an error while loading. Please reload this page.
MySqlConnector 0.56, MariaDB 10.3.15 @ Windows 2016.
I tried with 10.3.13 - no problems.
how to start debug it ?
The text was updated successfully, but these errors were encountered: