Skip to content

Commit ddc17ab

Browse files
author
Tor Didriksen
committed
Bug#25474239 MISC MTR TESTS FAIL WHEN CHANGING DEFAULT CHARACTER SET FOR DATABASE
Patch #8 To repeat: ./mtr --charset-for-testdb=utf8mb4 --defaults-file=include/utf8mb4_my.cnf group_min_max_innodb heap heap_btree heap_hash join_outer join_outer_bka join_outer_bka_nixbnl join_outer_innodb sp_notembedded Change-Id: I7f1eb96061a1dfba7bb91afcafa47326c9d079e7
1 parent ca1b745 commit ddc17ab

16 files changed

+127
-125
lines changed

mysql-test/r/group_min_max_innodb.result

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@ a count(a)
6262
1 1
6363
NULL 1
6464
drop table t1;
65-
create table t1 (f1 int, f2 char(1), primary key(f1,f2)) engine=innodb
65+
create table t1 (f1 int, f2 char(1), primary key(f1,f2)) charset utf8mb4 engine=innodb
6666
stats_persistent=0;
6767
insert into t1 values ( 1,"e"),(2,"a"),( 3,"c"),(4,"d");
6868
alter table t1 drop primary key, add primary key (f2, f1);
6969
explain select distinct f1 a, f1 b from t1;
7070
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
71-
1 SIMPLE t1 NULL index PRIMARY PRIMARY 5 NULL 4 100.00 Using index; Using temporary
71+
1 SIMPLE t1 NULL index PRIMARY PRIMARY 8 NULL 4 100.00 Using index; Using temporary
7272
Warnings:
7373
Note 1003 /* select#1 */ select distinct `test`.`t1`.`f1` AS `a`,`test`.`t1`.`f1` AS `b` from `test`.`t1`
7474
explain select distinct f1, f2 from t1;
7575
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
76-
1 SIMPLE t1 NULL index PRIMARY PRIMARY 5 NULL 4 100.00 Using index
76+
1 SIMPLE t1 NULL index PRIMARY PRIMARY 8 NULL 4 100.00 Using index
7777
Warnings:
7878
Note 1003 /* select#1 */ select distinct `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1`
7979
drop table t1;
@@ -103,23 +103,24 @@ End of 5.1 tests
103103
# Bug#12540545 61101: ASSERTION FAILURE IN THREAD 1256741184 IN
104104
# FILE /BUILDDIR/BUILD/BUILD/MYSQ
105105
#
106-
CREATE TABLE t1 (a CHAR(1), b CHAR(1), PRIMARY KEY (a,b)) ENGINE=InnoDB;
106+
CREATE TABLE t1 (a CHAR(1), b CHAR(1), PRIMARY KEY (a,b))
107+
charset utf8mb4 ENGINE=InnoDB;
107108
INSERT INTO t1 VALUES ('a', 'b'), ('c', 'd');
108109
EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 WHERE b = 'b';
109110
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
110-
1 SIMPLE t1 NULL index PRIMARY PRIMARY 2 NULL 2 50.00 Using where; Using index
111+
1 SIMPLE t1 NULL index PRIMARY PRIMARY 8 NULL 2 50.00 Using where; Using index
111112
Warnings:
112113
Note 1003 /* select#1 */ select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT a)` from `test`.`t1` where (`test`.`t1`.`b` = 'b')
113114
SELECT COUNT(DISTINCT a) FROM t1 WHERE b = 'b';
114115
COUNT(DISTINCT a)
115116
1
116117
DROP TABLE t1;
117118
CREATE TABLE t1 (a CHAR(1) NOT NULL, b CHAR(1) NOT NULL, UNIQUE KEY (a,b))
118-
ENGINE=InnoDB;
119+
charset utf8mb4 ENGINE=InnoDB;
119120
INSERT INTO t1 VALUES ('a', 'b'), ('c', 'd');
120121
EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 WHERE b = 'b';
121122
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
122-
1 SIMPLE t1 NULL index a a 2 NULL 2 50.00 Using where; Using index
123+
1 SIMPLE t1 NULL index a a 8 NULL 2 50.00 Using where; Using index
123124
Warnings:
124125
Note 1003 /* select#1 */ select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT a)` from `test`.`t1` where (`test`.`t1`.`b` = 'b')
125126
SELECT COUNT(DISTINCT a) FROM t1 WHERE b = 'b';
@@ -141,7 +142,7 @@ c1 CHAR(1) NOT NULL,
141142
i1 INTEGER NOT NULL,
142143
i2 INTEGER NOT NULL,
143144
UNIQUE KEY k1 (c1,i2)
144-
) ENGINE=InnoDB;
145+
) charset utf8mb4 ENGINE=InnoDB;
145146
INSERT INTO t1 SELECT 'A',i1,i1 FROM t0;
146147
INSERT INTO t1 SELECT 'B',i1,i1 FROM t0;
147148
INSERT INTO t1 SELECT 'C',i1,i1 FROM t0;
@@ -153,7 +154,7 @@ c1 CHAR(1) NOT NULL,
153154
i1 INTEGER NOT NULL,
154155
i2 INTEGER NOT NULL,
155156
UNIQUE KEY k2 (c1,i1,i2)
156-
) ENGINE=InnoDB;
157+
) charset utf8mb4 ENGINE=InnoDB;
157158
INSERT INTO t2 SELECT 'A',i1,i1 FROM t0;
158159
INSERT INTO t2 SELECT 'B',i1,i1 FROM t0;
159160
INSERT INTO t2 SELECT 'C',i1,i1 FROM t0;
@@ -168,7 +169,7 @@ set end_markers_in_json=on;
168169
EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' AND i2 = 17) OR ( c1 = 'F')
169170
GROUP BY c1;
170171
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
171-
1 SIMPLE t1 NULL range k1 k1 5 NULL ROWS 100.00 Using where; Using index
172+
1 SIMPLE t1 NULL range k1 k1 8 NULL ROWS 100.00 Using where; Using index
172173
Warnings:
173174
Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1`,max(`test`.`t1`.`i2`) AS `max(i2)` from `test`.`t1` where (((`test`.`t1`.`i2` = 17) and (`test`.`t1`.`c1` = 'C')) or (`test`.`t1`.`c1` = 'F')) group by `test`.`t1`.`c1`
174175
SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' AND i2 = 17) OR ( c1 = 'F')
@@ -183,7 +184,7 @@ OK
183184
EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR ( c1 = 'F' AND i2 = 17))
184185
GROUP BY c1;
185186
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
186-
1 SIMPLE t1 NULL range k1 k1 5 NULL ROWS 100.00 Using where; Using index
187+
1 SIMPLE t1 NULL range k1 k1 8 NULL ROWS 100.00 Using where; Using index
187188
Warnings:
188189
Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1`,max(`test`.`t1`.`i2`) AS `max(i2)` from `test`.`t1` where ((`test`.`t1`.`c1` = 'C') or ((`test`.`t1`.`i2` = 17) and (`test`.`t1`.`c1` = 'F'))) group by `test`.`t1`.`c1`
189190
SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR ( c1 = 'F' AND i2 = 17))
@@ -198,7 +199,7 @@ OK
198199
EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR c1 = 'F' ) AND ( i2 = 17 )
199200
GROUP BY c1;
200201
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
201-
1 SIMPLE t1 NULL range k1 k1 5 NULL ROWS 100.00 Using where; Using index for group-by
202+
1 SIMPLE t1 NULL range k1 k1 8 NULL ROWS 100.00 Using where; Using index for group-by
202203
Warnings:
203204
Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1`,max(`test`.`t1`.`i2`) AS `max(i2)` from `test`.`t1` where ((`test`.`t1`.`i2` = 17) and ((`test`.`t1`.`c1` = 'C') or (`test`.`t1`.`c1` = 'F'))) group by `test`.`t1`.`c1`
204205
SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR c1 = 'F' ) AND ( i2 = 17 )
@@ -214,7 +215,7 @@ EXPLAIN SELECT c1, max(i2) FROM t1
214215
WHERE ((c1 = 'C' AND (i2 = 40 OR i2 = 30)) OR ( c1 = 'F' AND (i2 = 40 )))
215216
GROUP BY c1;
216217
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
217-
1 SIMPLE t1 NULL range k1 k1 5 NULL ROWS 100.00 Using where; Using index
218+
1 SIMPLE t1 NULL range k1 k1 8 NULL ROWS 100.00 Using where; Using index
218219
Warnings:
219220
Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1`,max(`test`.`t1`.`i2`) AS `max(i2)` from `test`.`t1` where (((`test`.`t1`.`c1` = 'C') and ((`test`.`t1`.`i2` = 40) or (`test`.`t1`.`i2` = 30))) or ((`test`.`t1`.`i2` = 40) and (`test`.`t1`.`c1` = 'F'))) group by `test`.`t1`.`c1`
220221
SELECT c1, max(i2) FROM t1
@@ -230,7 +231,7 @@ EXPLAIN SELECT c1, i1, max(i2) FROM t2
230231
WHERE (c1 = 'C' OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 )
231232
GROUP BY c1,i1;
232233
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
233-
1 SIMPLE t2 NULL range k2 k2 5 NULL ROWS 10.00 Using where; Using index
234+
1 SIMPLE t2 NULL range k2 k2 8 NULL ROWS 10.00 Using where; Using index
234235
Warnings:
235236
Note 1003 /* select#1 */ select `test`.`t2`.`c1` AS `c1`,`test`.`t2`.`i1` AS `i1`,max(`test`.`t2`.`i2`) AS `max(i2)` from `test`.`t2` where ((`test`.`t2`.`i2` = 17) and ((`test`.`t2`.`c1` = 'C') or ((`test`.`t2`.`c1` = 'F') and (`test`.`t2`.`i1` < 35)))) group by `test`.`t2`.`c1`,`test`.`t2`.`i1`
236237
SELECT c1, i1, max(i2) FROM t2
@@ -247,7 +248,7 @@ EXPLAIN SELECT c1, i1, max(i2) FROM t2
247248
WHERE (((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 ))
248249
GROUP BY c1,i1;
249250
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
250-
1 SIMPLE t2 NULL range k2 k2 5 NULL ROWS 10.00 Using where; Using index
251+
1 SIMPLE t2 NULL range k2 k2 8 NULL ROWS 10.00 Using where; Using index
251252
Warnings:
252253
Note 1003 /* select#1 */ select `test`.`t2`.`c1` AS `c1`,`test`.`t2`.`i1` AS `i1`,max(`test`.`t2`.`i2`) AS `max(i2)` from `test`.`t2` where ((`test`.`t2`.`i2` = 17) and (((`test`.`t2`.`c1` = 'C') and (`test`.`t2`.`i1` < 40)) or ((`test`.`t2`.`c1` = 'F') and (`test`.`t2`.`i1` < 35)))) group by `test`.`t2`.`c1`,`test`.`t2`.`i1`
253254
SELECT c1, i1, max(i2) FROM t2
@@ -264,7 +265,7 @@ EXPLAIN SELECT c1, i1, max(i2) FROM t2
264265
WHERE ((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35) OR ( i2 = 17 ))
265266
GROUP BY c1,i1;
266267
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
267-
1 SIMPLE t2 NULL index k2 k2 9 NULL ROWS 19.72 Using where; Using index
268+
1 SIMPLE t2 NULL index k2 k2 12 NULL ROWS 15.90 Using where; Using index
268269
Warnings:
269270
Note 1003 /* select#1 */ select `test`.`t2`.`c1` AS `c1`,`test`.`t2`.`i1` AS `i1`,max(`test`.`t2`.`i2`) AS `max(i2)` from `test`.`t2` where (((`test`.`t2`.`c1` = 'C') and (`test`.`t2`.`i1` < 40)) or ((`test`.`t2`.`c1` = 'F') and (`test`.`t2`.`i1` < 35)) or (`test`.`t2`.`i2` = 17)) group by `test`.`t2`.`c1`,`test`.`t2`.`i1`
270271
SELECT c1, i1, max(i2) FROM t2
@@ -351,7 +352,7 @@ CREATE TABLE t1 (
351352
pk_col INT AUTO_INCREMENT PRIMARY KEY,
352353
a1 CHAR(64),
353354
KEY a1_idx (a1)
354-
) ENGINE=INNODB;
355+
) charset utf8mb4 ENGINE=INNODB;
355356
INSERT INTO t1 (a1) VALUES ('a'),('a'),('a'),('a'), ('a');
356357
CREATE TABLE t2 (
357358
pk_col1 INT NOT NULL,
@@ -361,7 +362,7 @@ a2 CHAR(64),
361362
PRIMARY KEY(pk_col1, pk_col2),
362363
KEY a1_idx (a1),
363364
KEY a1_a2_idx (a1, a2)
364-
) ENGINE=INNODB;
365+
) charset utf8mb4 ENGINE=INNODB;
365366
INSERT INTO t2 (pk_col1, pk_col2, a1, a2) VALUES (1,1,'a','b'),(1,2,'a','b'),
366367
(1,3,'a','c'),(1,4,'a','c'),
367368
(2,1,'a','d');
@@ -375,9 +376,9 @@ EXPLAIN SELECT DISTINCT a1
375376
FROM t1
376377
WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a';
377378
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
378-
1 SIMPLE t1 NULL range PRIMARY,a1_idx a1_idx 69 NULL 2 100.00 Using where; Using index
379+
1 SIMPLE t1 NULL range PRIMARY,a1_idx a1_idx 261 NULL 2 100.00 Using where; Using index
379380
Warnings:
380-
Note 1003 /* select#1 */ select distinct `test`.`t1`.`a1` AS `a1` from `test`.`t1` where ((`test`.`t1`.`a1` = 'a') and ((`test`.`t1`.`pk_col` = 2) or (`test`.`t1`.`pk_col` = 22)))
381+
Note 1003 /* select#1 */ select distinct `test`.`t1`.`a1` AS `a1` from `test`.`t1` where (((`test`.`t1`.`pk_col` = 2) or (`test`.`t1`.`pk_col` = 22)) and (`test`.`t1`.`a1` = 'a'))
381382
SELECT DISTINCT a1
382383
FROM t1
383384
WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a';
@@ -387,7 +388,7 @@ EXPLAIN SELECT COUNT(DISTINCT a1)
387388
FROM t1
388389
GROUP BY a1,pk_col;
389390
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
390-
1 SIMPLE t1 NULL range a1_idx a1_idx 69 NULL 6 100.00 Using index for group-by (scanning)
391+
1 SIMPLE t1 NULL range a1_idx a1_idx 261 NULL 6 100.00 Using index for group-by (scanning)
391392
Warnings:
392393
Note 1003 /* select#1 */ select count(distinct `test`.`t1`.`a1`) AS `COUNT(DISTINCT a1)` from `test`.`t1` group by `test`.`t1`.`a1`,`test`.`t1`.`pk_col`
393394
SELECT COUNT(DISTINCT a1)
@@ -403,7 +404,7 @@ EXPLAIN SELECT COUNT(DISTINCT a1)
403404
FROM t2
404405
GROUP BY a1,pk_col1;
405406
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
406-
1 SIMPLE t2 NULL range a1_idx,a1_a2_idx a1_idx 69 NULL 3 100.00 Using index for group-by
407+
1 SIMPLE t2 NULL range a1_idx,a1_a2_idx a1_idx 261 NULL 3 100.00 Using index for group-by
407408
Warnings:
408409
Note 1003 /* select#1 */ select count(distinct `test`.`t2`.`a1`) AS `COUNT(DISTINCT a1)` from `test`.`t2` group by `test`.`t2`.`a1`,`test`.`t2`.`pk_col1`
409410
SELECT COUNT(DISTINCT a1)
@@ -416,7 +417,7 @@ EXPLAIN SELECT COUNT(DISTINCT a1)
416417
FROM t2
417418
GROUP BY a1,a2;
418419
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
419-
1 SIMPLE t2 NULL range a1_a2_idx a1_a2_idx 130 NULL 4 100.00 Using index for group-by (scanning)
420+
1 SIMPLE t2 NULL range a1_a2_idx a1_a2_idx 514 NULL 4 100.00 Using index for group-by (scanning)
420421
Warnings:
421422
Note 1003 /* select#1 */ select count(distinct `test`.`t2`.`a1`) AS `COUNT(DISTINCT a1)` from `test`.`t2` group by `test`.`t2`.`a1`,`test`.`t2`.`a2`
422423
SELECT COUNT(DISTINCT a1)
@@ -432,9 +433,9 @@ EXPLAIN SELECT DISTINCT a1
432433
FROM t1
433434
WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a';
434435
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
435-
1 SIMPLE t1 NULL ref PRIMARY,a1_idx a1_idx 65 const 5 40.00 Using where; Using index
436+
1 SIMPLE t1 NULL ref PRIMARY,a1_idx a1_idx 257 const 5 40.00 Using where; Using index
436437
Warnings:
437-
Note 1003 /* select#1 */ select distinct `test`.`t1`.`a1` AS `a1` from `test`.`t1` where ((`test`.`t1`.`a1` = 'a') and ((`test`.`t1`.`pk_col` = 2) or (`test`.`t1`.`pk_col` = 22)))
438+
Note 1003 /* select#1 */ select distinct `test`.`t1`.`a1` AS `a1` from `test`.`t1` where (((`test`.`t1`.`pk_col` = 2) or (`test`.`t1`.`pk_col` = 22)) and (`test`.`t1`.`a1` = 'a'))
438439
SELECT DISTINCT a1
439440
FROM t1
440441
WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a';
@@ -444,7 +445,7 @@ EXPLAIN SELECT COUNT(DISTINCT a1)
444445
FROM t1
445446
GROUP BY a1,pk_col;
446447
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
447-
1 SIMPLE t1 NULL index a1_idx a1_idx 65 NULL 5 100.00 Using index
448+
1 SIMPLE t1 NULL index a1_idx a1_idx 257 NULL 5 100.00 Using index
448449
Warnings:
449450
Note 1003 /* select#1 */ select count(distinct `test`.`t1`.`a1`) AS `COUNT(DISTINCT a1)` from `test`.`t1` group by `test`.`t1`.`a1`,`test`.`t1`.`pk_col`
450451
SELECT COUNT(DISTINCT a1)
@@ -460,7 +461,7 @@ EXPLAIN SELECT COUNT(DISTINCT a1)
460461
FROM t2
461462
GROUP BY a1,pk_col1;
462463
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
463-
1 SIMPLE t2 NULL index a1_idx,a1_a2_idx a1_idx 65 NULL 5 100.00 Using index
464+
1 SIMPLE t2 NULL index a1_idx,a1_a2_idx a1_idx 257 NULL 5 100.00 Using index
464465
Warnings:
465466
Note 1003 /* select#1 */ select count(distinct `test`.`t2`.`a1`) AS `COUNT(DISTINCT a1)` from `test`.`t2` group by `test`.`t2`.`a1`,`test`.`t2`.`pk_col1`
466467
SELECT COUNT(DISTINCT a1)
@@ -473,7 +474,7 @@ EXPLAIN SELECT COUNT(DISTINCT a1)
473474
FROM t2
474475
GROUP BY a1,a2;
475476
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
476-
1 SIMPLE t2 NULL range a1_a2_idx a1_a2_idx 130 NULL 4 100.00 Using index for group-by (scanning)
477+
1 SIMPLE t2 NULL range a1_a2_idx a1_a2_idx 514 NULL 4 100.00 Using index for group-by (scanning)
477478
Warnings:
478479
Note 1003 /* select#1 */ select count(distinct `test`.`t2`.`a1`) AS `COUNT(DISTINCT a1)` from `test`.`t2` group by `test`.`t2`.`a1`,`test`.`t2`.`a2`
479480
SELECT COUNT(DISTINCT a1)

mysql-test/r/heap.result

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ f1 f2
162162
12 ted
163163
12 ted
164164
drop table t1;
165-
create table t1 (btn char(10) not null, key(btn)) engine=heap;
165+
create table t1 (btn char(10) not null, key(btn)) charset utf8mb4 engine=heap;
166166
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
167167
explain select * from t1 where btn like "q%";
168168
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
@@ -180,9 +180,9 @@ Warnings:
180180
Note 1003 /* select#1 */ select `test`.`t1`.`btn` AS `btn`,`test`.`t1`.`new_col` AS `new_col` from `test`.`t1` where (`test`.`t1`.`btn` = 'a')
181181
explain select * from t1 where btn="a" and new_col="a";
182182
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
183-
1 SIMPLE t1 NULL ref btn btn 11 const,const 2 100.00 NULL
183+
1 SIMPLE t1 NULL ref btn btn 44 const,const 2 100.00 NULL
184184
Warnings:
185-
Note 1003 /* select#1 */ select `test`.`t1`.`btn` AS `btn`,`test`.`t1`.`new_col` AS `new_col` from `test`.`t1` where ((`test`.`t1`.`new_col` = 'a') and (`test`.`t1`.`btn` = 'a'))
185+
Note 1003 /* select#1 */ select `test`.`t1`.`btn` AS `btn`,`test`.`t1`.`new_col` AS `new_col` from `test`.`t1` where ((`test`.`t1`.`btn` = 'a') and (`test`.`t1`.`new_col` = 'a'))
186186
drop table t1;
187187
CREATE TABLE t1 (
188188
a int default NULL,
@@ -269,7 +269,7 @@ a
269269
2
270270
drop table t1;
271271
set default_storage_engine=HEAP;
272-
create table t1 (v varchar(10), c char(10), t varchar(50));
272+
create table t1 (v varchar(10), c char(10), t varchar(50)) charset utf8mb4;
273273
insert into t1 values('+ ', '+ ', '+ ');
274274
set @a=repeat(' ',20);
275275
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
@@ -285,39 +285,39 @@ t1 CREATE TABLE `t1` (
285285
`v` varchar(10) DEFAULT NULL,
286286
`c` char(10) DEFAULT NULL,
287287
`t` varchar(50) DEFAULT NULL
288-
) ENGINE=MEMORY DEFAULT CHARSET=latin1
288+
) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4
289289
create table t2 like t1;
290290
show create table t2;
291291
Table Create Table
292292
t2 CREATE TABLE `t2` (
293293
`v` varchar(10) DEFAULT NULL,
294294
`c` char(10) DEFAULT NULL,
295295
`t` varchar(50) DEFAULT NULL
296-
) ENGINE=MEMORY DEFAULT CHARSET=latin1
297-
create table t3 select * from t1;
296+
) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4
297+
create table t3 charset utf8mb4 select * from t1;
298298
show create table t3;
299299
Table Create Table
300300
t3 CREATE TABLE `t3` (
301301
`v` varchar(10) DEFAULT NULL,
302302
`c` char(10) DEFAULT NULL,
303303
`t` varchar(50) DEFAULT NULL
304-
) ENGINE=MEMORY DEFAULT CHARSET=latin1
304+
) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4
305305
alter table t1 modify c varchar(10);
306306
show create table t1;
307307
Table Create Table
308308
t1 CREATE TABLE `t1` (
309309
`v` varchar(10) DEFAULT NULL,
310310
`c` varchar(10) DEFAULT NULL,
311311
`t` varchar(50) DEFAULT NULL
312-
) ENGINE=MEMORY DEFAULT CHARSET=latin1
312+
) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4
313313
alter table t1 modify v char(10);
314314
show create table t1;
315315
Table Create Table
316316
t1 CREATE TABLE `t1` (
317317
`v` char(10) DEFAULT NULL,
318318
`c` varchar(10) DEFAULT NULL,
319319
`t` varchar(50) DEFAULT NULL
320-
) ENGINE=MEMORY DEFAULT CHARSET=latin1
320+
) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4
321321
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
322322
Warnings:
323323
Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.
@@ -331,13 +331,13 @@ t1 CREATE TABLE `t1` (
331331
`v` char(10) DEFAULT NULL,
332332
`c` varchar(10) DEFAULT NULL,
333333
`t` varchar(10) DEFAULT NULL
334-
) ENGINE=MEMORY DEFAULT CHARSET=latin1
334+
) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4
335335
select concat('*',v,'*',c,'*',t,'*') from t1;
336336
concat('*',v,'*',c,'*',t,'*')
337337
*+*+*+ *
338338
*+*+*+ *
339339
drop table t1,t2,t3;
340-
create table t1 (v varchar(10), c char(10), t varchar(50), key(v), key(c), key(t(10)));
340+
create table t1 (v varchar(10), c char(10), t varchar(50), key(v), key(c), key(t(10))) charset latin1;
341341
show create table t1;
342342
Table Create Table
343343
t1 CREATE TABLE `t1` (
@@ -585,7 +585,7 @@ ERROR 23000: Duplicate entry 'a ' for key 'a'
585585
update t1 set a='a ' where a like 'a ';
586586
update t1 set a='a ' where a like 'a ';
587587
drop table t1;
588-
create table t1 (v varchar(10), c char(10), t varchar(50), key using btree (v), key using btree (c), key using btree (t(10)));
588+
create table t1 (v varchar(10), c char(10), t varchar(50), key using btree (v), key using btree (c), key using btree (t(10))) charset latin1;
589589
show create table t1;
590590
Table Create Table
591591
t1 CREATE TABLE `t1` (
@@ -690,7 +690,7 @@ ERROR 23000: Duplicate entry 'a ' for key 'a'
690690
update t1 set a='a ' where a like 'a ';
691691
update t1 set a='a ' where a like 'a ';
692692
drop table t1;
693-
create table t1 (v varchar(10), c char(10), t varchar(50), key(v(5)), key(c(5)), key(t(5)));
693+
create table t1 (v varchar(10), c char(10), t varchar(50), key(v(5)), key(c(5)), key(t(5))) charset utf8mb4;
694694
show create table t1;
695695
Table Create Table
696696
t1 CREATE TABLE `t1` (
@@ -700,9 +700,9 @@ t1 CREATE TABLE `t1` (
700700
KEY `v` (`v`(5)),
701701
KEY `c` (`c`(5)),
702702
KEY `t` (`t`(5))
703-
) ENGINE=MEMORY DEFAULT CHARSET=latin1
703+
) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4
704704
drop table t1;
705-
create table t1 (v varchar(65530), key(v(10)));
705+
create table t1 (v varchar(65530), key(v(10))) charset latin1;
706706
show create table t1;
707707
Table Create Table
708708
t1 CREATE TABLE `t1` (
@@ -764,16 +764,16 @@ select * from t1 where a = 0;
764764
a
765765
0
766766
drop table t1;
767-
create table t1 (c char(10)) engine=memory;
768-
create table t2 (c varchar(10)) engine=memory;
767+
create table t1 (c char(10)) charset utf8mb4 engine=memory;
768+
create table t2 (c varchar(10)) charset utf8mb4 engine=memory;
769769
analyze table t1, t2;
770770
Table Op Msg_type Msg_text
771771
test.t1 analyze note The storage engine for the table doesn't support analyze
772772
test.t2 analyze note The storage engine for the table doesn't support analyze
773773
show table status like 't_';
774774
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
775-
t1 MEMORY 10 Fixed 0 11 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL
776-
t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL
775+
t1 MEMORY 10 Fixed 0 41 0 # 0 0 NULL # NULL NULL utf8mb4_0900_ai_ci NULL
776+
t2 MEMORY 10 Fixed 0 42 0 # 0 0 NULL # NULL NULL utf8mb4_0900_ai_ci NULL
777777
drop table t1, t2;
778778
CREATE TABLE t1(a VARCHAR(1), b VARCHAR(2), c VARCHAR(256),
779779
KEY(a), KEY(b), KEY(c)) ENGINE=MEMORY;

0 commit comments

Comments
 (0)