summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorAkhila Maddukuri <akhila.x.maddukuri@oracle.com>2012-09-26 17:04:19 +0530
committerAkhila Maddukuri <akhila.x.maddukuri@oracle.com>2012-09-26 17:04:19 +0530
commit4f327600eaa8197c9996be986d1e28f359da26cb (patch)
tree762e071f5b28bf4c38ecc8f346fabde77e97f672 /mysql-test/r
parent83ea16bfac2fa85200fc1e40d461395d2f6a14eb (diff)
parent422e6b520dd8790ec2e81790c5621ca4288e5289 (diff)
downloadmariadb-git-4f327600eaa8197c9996be986d1e28f359da26cb.tar.gz
Description:
----------- After compiling from source, during make test I got the following error: test main.loaddata failed with error CURRENT_TEST: main.loaddata mysqltest: At line 592: query 'LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2 (@b) SET a=REVERSE(@b)' failed: 1115: Unknown character set: 'ucs2' I noticed other tests are skipped because of no ucs2 main.mix2_myisam_ucs2 [ skipped ] Test requires:' have_ucs2' Should main.loaddata be skipped if there is no ucs2 How To Repeat: ------------- Run make test on compiled source that doesn't have ucs2 Suggested fix: ------------- the failing piece of the test should be moved from mysql-test/t/loaddata.test to mysql-test/t/ctype_ucs.test.
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/ctype_ucs.result26
-rw-r--r--mysql-test/r/loaddata.result2
2 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index 6c515c39657..df522a1855e 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -191,6 +191,32 @@ t1 CREATE TABLE `t1` (
`r` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
+#
+# Bug #51876 : crash/memory underrun when loading data with ucs2
+# and reverse() function
+#
+# 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);
+# should return 2 zeroes (as the value is truncated)
+SELECT * FROM t1;
+a
+0
+1
+DROP TABLE t1;
+# 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);
+# should return 0 and 1 (10 reversed)
+SELECT * FROM t1;
+a
+0
+1
+DROP TABLE t1;
create table t2(f1 Char(30));
insert into t2 values ("103000"), ("22720000"), ("3401200"), ("78000");
select lpad(f1, 12, "-o-/") from t2;
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index c4c8216c14a..fc33e6c0b5f 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -533,6 +533,8 @@ a
1
DROP TABLE t1;
#
+
+
# Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
#
CREATE TABLE t1(f1 INT);