~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to tests/include/ctype_like_range_f1f2.inc

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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;