summaryrefslogtreecommitdiff
path: root/mysql-test/t/loaddata.test
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-07-14 15:05:20 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-07-14 15:05:20 +0300
commit11b6ff0f67566a383cfd751072e70bb7ea6f5b5d (patch)
treee472fe8a170b9d33b8416303e26e6272ce47d5d5 /mysql-test/t/loaddata.test
parentca82f4340c546c089cb90271cbc0755f936af7a4 (diff)
parentdbb643d64e0981f56b6c7b35586f430b08091834 (diff)
downloadmariadb-git-11b6ff0f67566a383cfd751072e70bb7ea6f5b5d.tar.gz
merge
Diffstat (limited to 'mysql-test/t/loaddata.test')
-rw-r--r--mysql-test/t/loaddata.test32
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 27c4cc8a75c..06054d1990d 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -570,4 +570,36 @@ DROP TABLE t1;
connection default;
disconnect con1;
+
+--echo #
+--echo # Bug #51876 : crash/memory underrun when loading data with ucs2
+--echo # and reverse() function
+--echo #
+
+--echo # Problem # 1 (original report): wrong parsing of ucs2 data
+SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
+CREATE TABLE t1(a INT);
+LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
+(@b) SET a=REVERSE(@b);
+--echo # should return 2 zeroes (as the value is truncated)
+SELECT * FROM t1;
+
+DROP TABLE t1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/tmpp.txt;
+
+
+--echo # Problem # 2 : if you write and read ucs2 data to a file they're lost
+SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
+CREATE TABLE t1(a INT);
+LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
+(@b) SET a=REVERSE(@b);
+--echo # should return 0 and 1 (10 reversed)
+SELECT * FROM t1;
+
+DROP TABLE t1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/tmpp2.txt;
+
+
--echo End of 5.1 tests