summaryrefslogtreecommitdiff
path: root/mysql-test/t/loaddata.test
diff options
context:
space:
mode:
authorPraveenkumar Hulakund <praveenkumar.hulakund@oracle.com>2014-03-19 12:30:30 +0530
committerPraveenkumar Hulakund <praveenkumar.hulakund@oracle.com>2014-03-19 12:30:30 +0530
commite73df7d9d09264573cc3968bdf97a9cd0fe8fca3 (patch)
treea2441dbcdaa7a3ec12e21d50071b027c87b20d48 /mysql-test/t/loaddata.test
parent659bee497b0e7de22f2c7ce48391eaae37ab256d (diff)
downloadmariadb-git-e73df7d9d09264573cc3968bdf97a9cd0fe8fca3.tar.gz
Bug#11759519 - INFINITE HANG WITH 100% CPU USAGE WITH LOAD DATA
LOCAL AND IMPORT ERRORS Description: ----------- This bug happens due to the fact that current algorithm is designed that in the case of LOCAL load of data, in case of the error, the remaining part of the file is read in order to return the proper error message to the client side. But, the problem with current implementation is that data stream for the client side is cleared only in the case where line delimiters exist, which is not a case with, for example fixed width fields. Fix: ---- Ported patch provided by Sinisa Milivojevic n bug report for this issue to 5.5+ versions. As part of this patch code is changed to clear the data stream by calling new member function "READ_INFO::skip_data_till_eof".
Diffstat (limited to 'mysql-test/t/loaddata.test')
-rw-r--r--mysql-test/t/loaddata.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 80956aa2cb6..aa7be52484e 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -635,3 +635,24 @@ create table t1(a point);
drop table t1;
--echo End of 5.1 tests
+
+--echo #
+--echo # Bug#11759519 INFINITE HANG WITH 100% CPU USAGE WITH LOAD DATA LOCAL AND IMPORT ERRORS
+--echo #
+SET @old_mode= @@sql_mode;
+CREATE TABLE t1 (fld1 INT);
+--copy_file $EXE_MYSQL $MYSQLTEST_VARDIR/mysql
+
+SET sql_mode='strict_all_tables';
+
+--echo # Without fix, load data hangs forever.
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,1000
+eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/mysql' REPLACE INTO TABLE t1
+ FIELDS TERMINATED BY 't' LINES TERMINATED BY '';
+
+SET @@sql_mode= @old_mode;
+
+--remove_file $MYSQLTEST_VARDIR/mysql
+DROP TABLE t1;
+