From 287fa3caf532509d01d92e8d32f2149603914137 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Wed, 7 Apr 2010 18:17:56 +0300 Subject: Bug #52512: Assertion `! is_set()' in Diagnostics_area::set_ok_status on LOAD DATA Two problems : 1. LOAD DATA was not checking for SQL errors and was sending an OK packet even when there were errors reported already. Fixed to check for SQL errors in addition to the error conditions already detected. 2. There was an over-ambitious assert() on the server to check if the protocol is always followed by the client. This can cause crashes on debug servers by clients not completing the protocol exchange for some reason (e.g. --send command in mysqltest). Fixed by keeping the assert only on client side, since the server always completes the protocol exchange. --- sql/net_serv.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sql/net_serv.cc') diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 73892f31ccf..1badee68be4 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -903,7 +903,13 @@ my_real_read(NET *net, size_t *complen) ("Packets out of order (Found: %d, expected %u)", (int) net->buff[net->where_b + 3], net->pkt_nr)); -#ifdef EXTRA_DEBUG + /* + We don't make noise server side, since the client is expected + to break the protocol for e.g. --send LOAD DATA .. LOCAL where + the server expects the client to send a file, but the client + may reply with a new command instead. + */ +#if defined (EXTRA_DEBUG) && !defined (MYSQL_SERVER) fflush(stdout); fprintf(stderr,"Error: Packets out of order (Found: %d, expected %d)\n", (int) net->buff[net->where_b + 3], -- cgit v1.2.1