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