Commit 184e9cca authored by unknown's avatar unknown

"like" did not work in some cases with character set big5

parent 21996864
-- require r/have_big5.require
disable_query_log;
show collation like "big5_chinese_ci";
enable_query_log;
drop table if exists t1;
SET NAMES big5;
CREATE TABLE t1 (c CHAR(10) CHARACTER SET big5, KEY(c));
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
SELECT * FROM t1 WHERE c LIKE 'aaa%';
c
aaa
aaaa
aaaaa
DROP TABLE t1;
Collation Charset Id Default Compiled Sortlen
big5_chinese_ci big5 1 Yes Yes 1
-- source include/have_big5.inc
#
# Tests with the big5 character set
#
--disable_warnings
drop table if exists t1;
--enable_warnings
SET NAMES big5;
#
# Bug 1883: LIKE did not work in some cases with a key.
#
CREATE TABLE t1 (c CHAR(10) CHARACTER SET big5, KEY(c));
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
SELECT * FROM t1 WHERE c LIKE 'aaa%';
DROP TABLE t1;
...@@ -377,7 +377,7 @@ static my_bool my_like_range_big5(CHARSET_INFO *cs __attribute__((unused)), ...@@ -377,7 +377,7 @@ static my_bool my_like_range_big5(CHARSET_INFO *cs __attribute__((unused)),
*min_length= (uint) (min_str-min_org); *min_length= (uint) (min_str-min_org);
*max_length= res_length; *max_length= res_length;
do { do {
*min_str++ = '\0'; /* Because if key compression */ *min_str++ = ' '; /* Because if key compression */
*max_str++ = max_sort_char; *max_str++ = max_sort_char;
} while (min_str != min_end); } while (min_str != min_end);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment