~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
#
2
# Bug#32510 LIKE search fails with indexed 'eucjpms' and 'ujis' char column
3
#
4
# Testing my_ctype_like_range_xxx
5
# (used in LIKE optimization for an indexed column)
6
#
7
8
# Create table using @@character_set_connection and @@collation_connection
9
# for the string columns.
10
11
CREATE TABLE t1 AS
12
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
13
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
14
15
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
16
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
17
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
18
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
19
20
# Check pattern (important for ucs2, utf16, utf32)
21
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
22
23
--echo 3 rows expected
24
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
25
DROP TABLE t1;