Commit 287fa3ca authored by Georgi Kodinov's avatar Georgi Kodinov

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.
parent ba229d79
...@@ -502,4 +502,11 @@ SELECT * FROM t1; ...@@ -502,4 +502,11 @@ SELECT * FROM t1;
col0 col0
test test
DROP TABLE t1; DROP TABLE t1;
#
# Bug #52512 : Assertion `! is_set()' in
# Diagnostics_area::set_ok_status on LOAD DATA
#
CREATE TABLE t1 (id INT NOT NULL);
LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1;
DROP TABLE t1;
End of 5.1 tests End of 5.1 tests
...@@ -554,4 +554,24 @@ let $MYSQLD_DATADIR= `select @@datadir`; ...@@ -554,4 +554,24 @@ let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/t1.txt; remove_file $MYSQLD_DATADIR/test/t1.txt;
--echo #
--echo # Bug #52512 : Assertion `! is_set()' in
--echo # Diagnostics_area::set_ok_status on LOAD DATA
--echo #
connect (con1,localhost,root,,test);
CREATE TABLE t1 (id INT NOT NULL);
--send LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1
# please keep this is a spearate test file : it's important to have no
# commands after this one
connection default;
dirty_close con1;
connect (con1,localhost,root,,test);
DROP TABLE t1;
connection default;
disconnect con1;
--echo End of 5.1 tests --echo End of 5.1 tests
...@@ -903,7 +903,13 @@ my_real_read(NET *net, size_t *complen) ...@@ -903,7 +903,13 @@ my_real_read(NET *net, size_t *complen)
("Packets out of order (Found: %d, expected %u)", ("Packets out of order (Found: %d, expected %u)",
(int) net->buff[net->where_b + 3], (int) net->buff[net->where_b + 3],
net->pkt_nr)); 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); fflush(stdout);
fprintf(stderr,"Error: Packets out of order (Found: %d, expected %d)\n", fprintf(stderr,"Error: Packets out of order (Found: %d, expected %d)\n",
(int) net->buff[net->where_b + 3], (int) net->buff[net->where_b + 3],
......
...@@ -940,6 +940,10 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, ...@@ -940,6 +940,10 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
DBUG_RETURN(1); DBUG_RETURN(1);
} }
} }
if (thd->is_error())
read_info.error= 1;
if (read_info.error) if (read_info.error)
break; break;
if (skip_lines) if (skip_lines)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment