1
drop table if exists t1, t2;
3
a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
4
) character set utf8 engine = innodb;
6
a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
7
) character set ucs2 engine = innodb;
8
insert into t1 values (1,'abcdefg','abcdefg','one');
9
insert into t1 values (2,'ijkilmn','ijkilmn','two');
10
insert into t1 values (3,'qrstuvw','qrstuvw','three');
11
insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
12
insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
13
insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
14
insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
15
insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
16
insert into t2 values (1,'abcdefg','abcdefg','one');
17
insert into t2 values (2,'ijkilmn','ijkilmn','two');
18
insert into t2 values (3,'qrstuvw','qrstuvw','three');
19
insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
20
insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
21
insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
22
insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
23
insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
24
insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
25
insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
26
insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
27
insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
28
update t1 set filler = 'boo' where a = 1;
29
update t2 set filler ='email' where a = 4;
30
select a,hex(b),hex(c),filler from t1 order by filler;
31
a hex(b) hex(c) filler
32
1 61626364656667 61626364656667 boo
36
4 E880BDD0B1E880BD E880BDD0B1E880BD seven
37
4 E880BDE880BD E880BDE880BD six
38
3 71727374757677 71727374757677 three
39
2 696A6B696C6D6E 696A6B696C6D6E two
40
select a,hex(b),hex(c),filler from t2 order by filler;
41
a hex(b) hex(c) filler
42
4 05630563 05630563 email
44
4 05612020 05612020 email
47
4 00640065 00640065 email
48
4 00E400E50068 00E400E50068 email
49
4 0000E400 0000E400 email
50
4 0000563001FC0563 0000563001FC0563 email
51
1 0061006200630064006500660067 0061006200630064006500660067 one
52
3 0071007200730074007500760077 0071007200730074007500760077 three
53
2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
57
a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
58
) character set utf8 engine = innodb;
60
a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
61
) character set ucs2 engine = innodb;
62
insert into t1 values (1,'abcdefg','abcdefg','one');
63
insert into t1 values (2,'ijkilmn','ijkilmn','two');
64
insert into t1 values (3,'qrstuvw','qrstuvw','three');
65
insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
66
insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
67
insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
68
insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
69
insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
70
insert into t2 values (1,'abcdefg','abcdefg','one');
71
insert into t2 values (2,'ijkilmn','ijkilmn','two');
72
insert into t2 values (3,'qrstuvw','qrstuvw','three');
73
insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
74
insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
75
insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
76
insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
77
insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
78
insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
79
insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
80
insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
81
insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
82
update t1 set filler = 'boo' where a = 1;
83
update t2 set filler ='email' where a = 4;
84
select a,hex(b),hex(c),filler from t1 order by filler;
85
a hex(b) hex(c) filler
86
1 61626364656667 61626364656667 boo
90
4 E880BDD0B1E880BD E880BDD0B1E880BD seven
91
4 E880BDE880BD E880BDE880BD six
92
3 71727374757677 71727374757677 three
93
2 696A6B696C6D6E 696A6B696C6D6E two
94
select a,hex(b),hex(c),filler from t2 order by filler;
95
a hex(b) hex(c) filler
96
4 05630563 05630563 email
98
4 05612020 05612020 email
101
4 00640065 00640065 email
102
4 00E400E50068 00E400E50068 email
103
4 0000E400 0000E400 email
104
4 0000563001FC0563 0000563001FC0563 email
105
1 0061006200630064006500660067 0061006200630064006500660067 one
106
3 0071007200730074007500760077 0071007200730074007500760077 three
107
2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
111
a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
112
) character set utf8 engine = innodb;
114
a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
115
) character set ucs2 engine = innodb;
116
insert into t1 values (1,'abcdefg','abcdefg','one');
117
insert into t1 values (2,'ijkilmn','ijkilmn','two');
118
insert into t1 values (3,'qrstuvw','qrstuvw','three');
119
insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
120
insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
121
insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
122
insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
123
insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
124
insert into t2 values (1,'abcdefg','abcdefg','one');
125
insert into t2 values (2,'ijkilmn','ijkilmn','two');
126
insert into t2 values (3,'qrstuvw','qrstuvw','three');
127
insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
128
insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
129
insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
130
insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
131
insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
132
insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
133
insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
134
insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
135
insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
136
update t1 set filler = 'boo' where a = 1;
137
update t2 set filler ='email' where a = 4;
138
select a,hex(b),hex(c),filler from t1 order by filler;
139
a hex(b) hex(c) filler
140
1 61626364656667 61626364656667 boo
144
4 E880BDD0B1E880BD E880BDD0B1E880BD seven
145
4 E880BDE880BD E880BDE880BD six
146
3 71727374757677 71727374757677 three
147
2 696A6B696C6D6E 696A6B696C6D6E two
148
select a,hex(b),hex(c),filler from t2 order by filler;
149
a hex(b) hex(c) filler
153
4 0000563001FC0563 0000563001FC0563 email
154
4 0000E400 0000E400 email
155
4 00640065 00640065 email
156
4 00E400E50068 00E400E50068 email
157
4 05612020 05612020 email
158
4 05630563 05630563 email
159
1 0061006200630064006500660067 0061006200630064006500660067 one
160
3 0071007200730074007500760077 0071007200730074007500760077 three
161
2 0069006A006B0069006C006D006E 0069006A006B0069006C006D006E two
165
a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
166
) character set utf8 engine = innodb;
168
a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
169
) character set ucs2 engine = innodb;
170
insert into t1 values (1,'abcdefg','abcdefg','one');
171
insert into t1 values (2,'ijkilmn','ijkilmn','two');
172
insert into t1 values (3,'qrstuvw','qrstuvw','three');
173
insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
174
insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
175
insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
176
insert into t2 values (1,'abcdefg','abcdefg','one');
177
insert into t2 values (2,'ijkilmn','ijkilmn','two');
178
insert into t2 values (3,'qrstuvw','qrstuvw','three');
179
insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
180
insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
181
insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
182
insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
183
insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
184
insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
185
insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
186
update t1 set filler = 'boo' where a = 1;
187
update t2 set filler ='email' where a = 4;
188
select a,hex(b),hex(c),filler from t1 order by filler;
189
a hex(b) hex(c) filler
190
1 61626364656667 61626364656667 boo
194
3 71727374757677 71727374757677 three
195
2 696A6B696C6D6E 696A6B696C6D6E two
196
select a,hex(b),hex(c),filler from t2 order by filler;
197
a hex(b) hex(c) filler
198
4 0000E400 0000E400 email
199
4 00640065 00640065 email
200
4 00E400E50068 00E400E50068 email
203
4 05612020 05612020 email
205
1 61626364656667 61626364656667 one
206
3 71727374757677 71727374757677 three
207
2 696A6B696C6D6E 696A6B696C6D6E two
212
ind enum('0','1','2') NOT NULL default '0',
213
string1 varchar(250) NOT NULL,
215
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
217
ind enum('0','1','2') NOT NULL default '0',
218
string1 varchar(250) NOT NULL,
220
) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
221
INSERT INTO t1 VALUES ('1', ''),('2', '');
222
INSERT INTO t2 VALUES ('1', ''),('2', '');
223
SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
224
hex(ind) hex(string1)
227
SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
228
hex(ind) hex(string1)
233
ind set('0','1','2') NOT NULL default '0',
234
string1 varchar(250) NOT NULL,
236
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
238
ind set('0','1','2') NOT NULL default '0',
239
string1 varchar(250) NOT NULL,
241
) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
242
INSERT INTO t1 VALUES ('1', ''),('2', '');
243
INSERT INTO t2 VALUES ('1', ''),('2', '');
244
SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
245
hex(ind) hex(string1)
248
SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
249
hex(ind) hex(string1)
255
string1 varchar(250) NOT NULL,
257
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
260
string1 varchar(250) NOT NULL,
262
) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
263
insert into t1 values(0,''),(1,'');
264
insert into t2 values(0,''),(1,'');
265
select hex(ind),hex(string1) from t1 order by string1;
266
hex(ind) hex(string1)
269
select hex(ind),hex(string1) from t2 order by string1;
270
hex(ind) hex(string1)
275
a int, b char(10), filler char(10), primary key(a, b(2))
276
) character set utf8 engine = innodb;
277
insert into t2 values (1,'abcdefg','one');
278
insert into t2 values (2,'ijkilmn','two');
279
insert into t2 values (3, 'qrstuvw','three');
280
update t2 set a=5, filler='booo' where a=1;
283
a int, b char(10), filler char(10), primary key(a, b(2))
284
) character set ucs2 engine = innodb;
285
insert into t2 values (1,'abcdefg','one');
286
insert into t2 values (2,'ijkilmn','two');
287
insert into t2 values (3, 'qrstuvw','three');
288
update t2 set a=5, filler='booo' where a=1;
290
create table t1(a int not null, b char(110),primary key(a,b(100))) engine=innodb default charset=utf8;
291
insert into t1 values(1,'abcdefg'),(2,'defghijk');
292
insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
293
insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
294
select a,hex(b) from t1 order by b;
298
6 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1
299
7 D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2
300
update t1 set b = 'three' where a = 6;
302
create table t1(a int not null, b text(110),primary key(a,b(100))) engine=innodb default charset=utf8;
303
insert into t1 values(1,'abcdefg'),(2,'defghijk');
304
insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D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