summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorsvoj@mysql.com/june.mysql.com <>2007-06-27 18:10:19 +0500
committersvoj@mysql.com/june.mysql.com <>2007-06-27 18:10:19 +0500
commitff9aeb560c2dd96c95d552184097b74b5f1bc886 (patch)
tree8521349d513536e124d936118690ca0abb5320a9 /mysql-test
parent717c8fe98ee82eef09343a6abb9863dc49f337d7 (diff)
downloadmariadb-git-ff9aeb560c2dd96c95d552184097b74b5f1bc886.tar.gz
BUG#29299 - repeatable myisam fulltext index corruption
Fulltext index may get corrupt by certain gbk characters. The problem was that when skipping leading non-true-word-characters, we assumed that these characters are always 1 byte long. This is not the case with gbk character set, since non-true-word-characters may be 2 bytes long. Affects 5.0 only.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/fulltext2.result12
-rw-r--r--mysql-test/t/fulltext2.test12
2 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/fulltext2.result b/mysql-test/r/fulltext2.result
index f6a4b20bc22..f6bb4e4965a 100644
--- a/mysql-test/r/fulltext2.result
+++ b/mysql-test/r/fulltext2.result
@@ -241,3 +241,15 @@ select * from t1 where match a against('ab c' in boolean mode);
a
drop table t1;
set names latin1;
+CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a));
+SET NAMES utf8;
+INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161);
+SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE);
+HEX(a)
+BEF361616197C22061616161
+DELETE FROM t1 LIMIT 1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SET NAMES latin1;
+DROP TABLE t1;
diff --git a/mysql-test/t/fulltext2.test b/mysql-test/t/fulltext2.test
index fd97f795534..99209dc8543 100644
--- a/mysql-test/t/fulltext2.test
+++ b/mysql-test/t/fulltext2.test
@@ -220,4 +220,16 @@ select * from t1 where match a against('ab c' in boolean mode);
drop table t1;
set names latin1;
+#
+# BUG#29299 - repeatable myisam fulltext index corruption
+#
+CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a));
+SET NAMES utf8;
+INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161);
+SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE);
+DELETE FROM t1 LIMIT 1;
+CHECK TABLE t1;
+SET NAMES latin1;
+DROP TABLE t1;
+
# End of 4.1 tests