diff options
author | unknown <igor@rurik.mysql.com> | 2006-06-22 20:39:46 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2006-06-22 20:39:46 -0700 |
commit | 153cda3f7804e8d849c986b3249bc05b8b046e3e (patch) | |
tree | 134526f28b8516689651d66bbeb949ff0211af94 | |
parent | 71e64a3b831d49f68f43f18e3d45bc65229d6ff2 (diff) | |
download | mariadb-git-153cda3f7804e8d849c986b3249bc05b8b046e3e.tar.gz |
Added a test case for bug #18359.
This was another manifestation of the problems fixed in the
patch for bug 16674.
Wrong calculation of length of the search prefix in the pattern
string led here to a wrong result set for a query in 4.1.
The bug could be demonstrated for any multi-byte character set.
mysql-test/r/ctype_utf8.result:
Added a test case for bug #18359.
mysql-test/t/ctype_utf8.test:
Added a test case for bug #18359.
-rw-r--r-- | mysql-test/r/ctype_utf8.result | 56 | ||||
-rw-r--r-- | mysql-test/t/ctype_utf8.test | 31 |
2 files changed, 87 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index fc5645ae10b..4ceacaffcbb 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1237,3 +1237,59 @@ a Käli Käli 2-4 Käli Käli 2-4 DROP TABLE t1; +SET NAMES latin2; +CREATE TABLE t1 ( +id int(11) NOT NULL default '0', +tid int(11) NOT NULL default '0', +val text NOT NULL, +INDEX idx(tid, val(10)) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES +(40988,72,'VOLNÝ ADSL'),(41009,72,'VOLNÝ ADSL'), +(41032,72,'VOLNÝ ADSL'),(41038,72,'VOLNÝ ADSL'), +(41063,72,'VOLNÝ ADSL'),(41537,72,'VOLNÝ ADSL Office'), +(42141,72,'VOLNÝ ADSL'),(42565,72,'VOLNÝ ADSL Combi'), +(42749,72,'VOLNÝ ADSL'),(44205,72,'VOLNÝ ADSL'); +SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLNY ADSL'; +id tid val +40988 72 VOLNÝ ADSL +41009 72 VOLNÝ ADSL +41032 72 VOLNÝ ADSL +41038 72 VOLNÝ ADSL +41063 72 VOLNÝ ADSL +42141 72 VOLNÝ ADSL +42749 72 VOLNÝ ADSL +44205 72 VOLNÝ ADSL +SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLNÝ ADSL'; +id tid val +40988 72 VOLNÝ ADSL +41009 72 VOLNÝ ADSL +41032 72 VOLNÝ ADSL +41038 72 VOLNÝ ADSL +41063 72 VOLNÝ ADSL +42141 72 VOLNÝ ADSL +42749 72 VOLNÝ ADSL +44205 72 VOLNÝ ADSL +SELECT * FROM t1 WHERE tid=72 and val LIKE '%VOLNÝ ADSL'; +id tid val +40988 72 VOLNÝ ADSL +41009 72 VOLNÝ ADSL +41032 72 VOLNÝ ADSL +41038 72 VOLNÝ ADSL +41063 72 VOLNÝ ADSL +42141 72 VOLNÝ ADSL +42749 72 VOLNÝ ADSL +44205 72 VOLNÝ ADSL +ALTER TABLE t1 DROP KEY idx; +ALTER TABLE t1 ADD KEY idx (tid,val(11)); +SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLNÝ ADSL'; +id tid val +40988 72 VOLNÝ ADSL +41009 72 VOLNÝ ADSL +41032 72 VOLNÝ ADSL +41038 72 VOLNÝ ADSL +41063 72 VOLNÝ ADSL +42141 72 VOLNÝ ADSL +42749 72 VOLNÝ ADSL +44205 72 VOLNÝ ADSL +DROP TABLE t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index de9bb4687b1..b1d485ad1ce 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1009,4 +1009,35 @@ ALTER TABLE t1 ADD KEY (a(10)); SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%'; DROP TABLE t1; +# +# Bug#18359: LIKE predicate for a 'utf8' text column with a partial index +# (see bug #16674 as well) +# + +SET NAMES latin2; + +CREATE TABLE t1 ( + id int(11) NOT NULL default '0', + tid int(11) NOT NULL default '0', + val text NOT NULL, + INDEX idx(tid, val(10)) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +INSERT INTO t1 VALUES + (40988,72,'VOLNÝ ADSL'),(41009,72,'VOLNÝ ADSL'), + (41032,72,'VOLNÝ ADSL'),(41038,72,'VOLNÝ ADSL'), + (41063,72,'VOLNÝ ADSL'),(41537,72,'VOLNÝ ADSL Office'), + (42141,72,'VOLNÝ ADSL'),(42565,72,'VOLNÝ ADSL Combi'), + (42749,72,'VOLNÝ ADSL'),(44205,72,'VOLNÝ ADSL'); + +SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLNY ADSL'; +SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLNÝ ADSL'; +SELECT * FROM t1 WHERE tid=72 and val LIKE '%VOLNÝ ADSL'; + +ALTER TABLE t1 DROP KEY idx; +ALTER TABLE t1 ADD KEY idx (tid,val(11)); + +SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLNÝ ADSL'; + +DROP TABLE t1; # End of 4.1 tests |