2
drop table if exists `T1`;
3
drop table if exists `T2`;
4
drop table if exists `T3`;
5
drop table if exists `T4`;
6
drop table if exists `T5`;
7
drop table if exists `T6`;
8
drop table if exists `T7`;
9
drop table if exists `T8`;
10
drop table if exists `T9`;
11
drop table if exists `T10`;
12
drop table if exists `T11`;
13
drop table if exists `T12`;
17
# Test LEFT() function with Japanese character in utf8 encoding
21
SET character_set_database = utf8;
23
CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb;
24
CREATE TABLE `T2` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb;
25
CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb;
26
CREATE TABLE `T4` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam;
27
CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam;
28
CREATE TABLE `T6` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam;
29
CREATE TABLE `T7` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap;
30
CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap;
31
CREATE TABLE `T9` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap;
32
CREATE TABLE `T10` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb;
33
CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb;
34
CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb;
36
INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ア'),('');
37
INSERT INTO `T2` VALUES ('あいうえお'),('あいうえ'),('あいう'),('あい'),('あ'),('');
38
INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('龔'),('');
39
INSERT INTO `T4` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ア'),('');
40
INSERT INTO `T5` VALUES ('あいうえお'),('あいうえ'),('あいう'),('あい'),('あ'),('');
41
INSERT INTO `T6` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('龔'),('');
42
INSERT INTO `T7` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ア'),('');
43
INSERT INTO `T8` VALUES ('あいうえお'),('あいうえ'),('あいう'),('あい'),('あ'),('');
44
INSERT INTO `T9` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('龔'),('');
45
INSERT INTO `T10` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ア'),('');
46
INSERT INTO `T11` VALUES ('あいうえお'),('あいうえ'),('あいう'),('あい'),('あ'),('');
47
INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('龔'),('');
50
SELECT `C1`, LEFT(`C1`,0) FROM `T1`;
51
SELECT `C1`, LEFT(`C1`,1) FROM `T1`;
52
SELECT `C1`, LEFT(`C1`,2) FROM `T1`;
53
SELECT `C1`, LEFT(`C1`,3) FROM `T1`;
54
SELECT `C1`, LEFT(`C1`,4) FROM `T1`;
55
SELECT `C1`, LEFT(`C1`,5) FROM `T1`;
56
SELECT `C1`, LEFT(`C1`,0) FROM `T2`;
57
SELECT `C1`, LEFT(`C1`,1) FROM `T2`;
58
SELECT `C1`, LEFT(`C1`,2) FROM `T2`;
59
SELECT `C1`, LEFT(`C1`,3) FROM `T2`;
60
SELECT `C1`, LEFT(`C1`,4) FROM `T2`;
61
SELECT `C1`, LEFT(`C1`,5) FROM `T2`;
62
SELECT `C1`, LEFT(`C1`,0) FROM `T3`;
63
SELECT `C1`, LEFT(`C1`,1) FROM `T3`;
64
SELECT `C1`, LEFT(`C1`,2) FROM `T3`;
65
SELECT `C1`, LEFT(`C1`,3) FROM `T3`;
66
SELECT `C1`, LEFT(`C1`,4) FROM `T3`;
67
SELECT `C1`, LEFT(`C1`,5) FROM `T3`;
70
SELECT `C1`, LEFT(`C1`,0) FROM `T4`;
71
SELECT `C1`, LEFT(`C1`,1) FROM `T4`;
72
SELECT `C1`, LEFT(`C1`,2) FROM `T4`;
73
SELECT `C1`, LEFT(`C1`,3) FROM `T4`;
74
SELECT `C1`, LEFT(`C1`,4) FROM `T4`;
75
SELECT `C1`, LEFT(`C1`,5) FROM `T4`;
76
SELECT `C1`, LEFT(`C1`,0) FROM `T5`;
77
SELECT `C1`, LEFT(`C1`,1) FROM `T5`;
78
SELECT `C1`, LEFT(`C1`,2) FROM `T5`;
79
SELECT `C1`, LEFT(`C1`,3) FROM `T5`;
80
SELECT `C1`, LEFT(`C1`,4) FROM `T5`;
81
SELECT `C1`, LEFT(`C1`,5) FROM `T5`;
82
SELECT `C1`, LEFT(`C1`,0) FROM `T6`;
83
SELECT `C1`, LEFT(`C1`,1) FROM `T6`;
84
SELECT `C1`, LEFT(`C1`,2) FROM `T6`;
85
SELECT `C1`, LEFT(`C1`,3) FROM `T6`;
86
SELECT `C1`, LEFT(`C1`,4) FROM `T6`;
87
SELECT `C1`, LEFT(`C1`,5) FROM `T6`;
90
SELECT `C1`, LEFT(`C1`,0) FROM `T7`;
91
SELECT `C1`, LEFT(`C1`,1) FROM `T7`;
92
SELECT `C1`, LEFT(`C1`,2) FROM `T7`;
93
SELECT `C1`, LEFT(`C1`,3) FROM `T7`;
94
SELECT `C1`, LEFT(`C1`,4) FROM `T7`;
95
SELECT `C1`, LEFT(`C1`,5) FROM `T7`;
96
SELECT `C1`, LEFT(`C1`,0) FROM `T8`;
97
SELECT `C1`, LEFT(`C1`,1) FROM `T8`;
98
SELECT `C1`, LEFT(`C1`,2) FROM `T8`;
99
SELECT `C1`, LEFT(`C1`,3) FROM `T8`;
100
SELECT `C1`, LEFT(`C1`,4) FROM `T8`;
101
SELECT `C1`, LEFT(`C1`,5) FROM `T8`;
102
SELECT `C1`, LEFT(`C1`,0) FROM `T9`;
103
SELECT `C1`, LEFT(`C1`,1) FROM `T9`;
104
SELECT `C1`, LEFT(`C1`,2) FROM `T9`;
105
SELECT `C1`, LEFT(`C1`,3) FROM `T9`;
106
SELECT `C1`, LEFT(`C1`,4) FROM `T9`;
107
SELECT `C1`, LEFT(`C1`,5) FROM `T9`;
110
SELECT `C1`, LEFT(`C1`,0) FROM `T10`;
111
SELECT `C1`, LEFT(`C1`,1) FROM `T10`;
112
SELECT `C1`, LEFT(`C1`,2) FROM `T10`;
113
SELECT `C1`, LEFT(`C1`,3) FROM `T10`;
114
SELECT `C1`, LEFT(`C1`,4) FROM `T10`;
115
SELECT `C1`, LEFT(`C1`,5) FROM `T10`;
116
SELECT `C1`, LEFT(`C1`,0) FROM `T11`;
117
SELECT `C1`, LEFT(`C1`,1) FROM `T11`;
118
SELECT `C1`, LEFT(`C1`,2) FROM `T11`;
119
SELECT `C1`, LEFT(`C1`,3) FROM `T11`;
120
SELECT `C1`, LEFT(`C1`,4) FROM `T11`;
121
SELECT `C1`, LEFT(`C1`,5) FROM `T11`;
122
SELECT `C1`, LEFT(`C1`,0) FROM `T12`;
123
SELECT `C1`, LEFT(`C1`,1) FROM `T12`;
124
SELECT `C1`, LEFT(`C1`,2) FROM `T12`;
125
SELECT `C1`, LEFT(`C1`,3) FROM `T12`;
126
SELECT `C1`, LEFT(`C1`,4) FROM `T12`;
127
SELECT `C1`, LEFT(`C1`,5) FROM `T12`;