14
14
Table Op Msg_type Msg_text
15
15
test.t1 check status OK
17
create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a));
19
Table Op Msg_type Msg_text
20
test.t1 check status OK
22
Table Op Msg_type Msg_text
23
test.t1 repair status OK
24
delete from t1 where (a & 1);
26
Table Op Msg_type Msg_text
27
test.t1 check status OK
29
Table Op Msg_type Msg_text
30
test.t1 repair status OK
17
create table t1 (a int not null auto_increment, b blob not null, primary key (a));
19
Table Op Msg_type Msg_text
20
test.t1 check status OK
21
delete from t1 where (a mod 2) = 1;
32
23
Table Op Msg_type Msg_text
33
24
test.t1 check status OK
35
create table t1 (a int not null auto_increment, b int not null, primary key (a), index(b));
26
create TEMPORARY table t1 (a int not null auto_increment, b int not null, primary key (a), index(b)) ENGINE=MYISAM;
36
27
insert into t1 (b) values (1),(2),(2),(2),(2);
38
Table Op Msg_type Msg_text
39
test.t1 optimize status OK
41
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
42
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
43
t1 1 b 1 b A 1 NULL NULL BTREE
45
Table Op Msg_type Msg_text
46
test.t1 optimize status Table is already up to date
48
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
49
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
50
t1 1 b 1 b A 1 NULL NULL BTREE
28
alter table t1 engine=MYISAM;
30
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
31
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
32
t1 1 b 1 b A NULL NULL NULL BTREE
33
alter table t1 engine=MyISAM;
35
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
36
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
37
t1 1 b 1 b A NULL NULL NULL BTREE
52
create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=myisam;
39
create temporary table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=myisam;
53
40
insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
54
41
explain select * from t1 order by a;
55
42
id select_type table type possible_keys key key_len ref rows Extra
245
222
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
246
223
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
247
224
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
248
int, i999 int, i1000 int, b blob) row_format=dynamic;
225
int, i999 int, i1000 int, b blob) engine=myisam row_format=dynamic;
249
226
insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
250
227
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
251
228
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
311
288
KEY `post_time` (`post_time`),
313
290
KEY `poster_login` (`poster_login`),
314
KEY `topic_id` (`topic_id`),
315
FULLTEXT KEY `post_text` (`post_text`)
291
KEY `topic_id` (`topic_id`)
292
# FULLTEXT KEY `post_text` (`post_text`)
317
294
INSERT INTO t1 (post_text) VALUES ('ceci est un test'),('ceci est un test'),('ceci est un test'),('ceci est un test'),('ceci est un test');
319
Table Op Msg_type Msg_text
320
test.t1 repair status OK
322
296
Table Op Msg_type Msg_text
323
297
test.t1 check status OK
325
CREATE TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300), KEY t1 (a, b, c, d, e));
299
CREATE TEMPORARY TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300), KEY t1 (a, b, c, d, e)) ENGINE=MyISAM;
326
300
ERROR 42000: Specified key was too long; max key length is 1332 bytes
327
CREATE TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300));
301
CREATE TEMPORARY TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300)) ENGINE=MyISAM;
328
302
ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
329
303
ERROR 42000: Specified key was too long; max key length is 1332 bytes
331
CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a));
305
CREATE TEMPORARY TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a)) ENGINE=MyISAM;
332
306
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
333
307
create table t2 (a int not null, b int, c int, key(b), key(c), key(a));
334
308
INSERT into t2 values (1,1,1), (2,2,2);
336
Table Op Msg_type Msg_text
337
test.t1 optimize status OK
309
alter table t1 ENGINE=MYISAM;
338
310
show index from t1;
339
311
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
340
t1 1 b 1 b A 5 NULL NULL YES BTREE
341
t1 1 c 1 c A 5 NULL NULL YES BTREE
342
t1 1 a 1 a A 1 NULL NULL BTREE
343
t1 1 a 2 b A 5 NULL NULL YES BTREE
344
t1 1 c_2 1 c A 5 NULL NULL YES BTREE
345
t1 1 c_2 2 a A 5 NULL NULL BTREE
312
t1 1 b 1 b A NULL NULL NULL YES BTREE
313
t1 1 c 1 c A NULL NULL NULL YES BTREE
314
t1 1 a 1 a A NULL NULL NULL BTREE
315
t1 1 a 2 b A NULL NULL NULL YES BTREE
316
t1 1 c_2 1 c A NULL NULL NULL YES BTREE
317
t1 1 c_2 2 a A NULL NULL NULL BTREE
346
318
explain select * from t1,t2 where t1.a=t2.a;
347
319
id select_type table type possible_keys key key_len ref rows Extra
348
320
1 SIMPLE t2 ALL a NULL NULL NULL 2
349
1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where; Using join buffer
321
1 SIMPLE t1 ref a a 4 test.t2.a 1
350
322
explain select * from t1,t2 force index(a) where t1.a=t2.a;
351
323
id select_type table type possible_keys key key_len ref rows Extra
352
324
1 SIMPLE t2 ALL a NULL NULL NULL 2
353
1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where; Using join buffer
325
1 SIMPLE t1 ref a a 4 test.t2.a 1
354
326
explain select * from t1 force index(a),t2 force index(a) where t1.a=t2.a;
355
327
id select_type table type possible_keys key key_len ref rows Extra
356
328
1 SIMPLE t2 ALL a NULL NULL NULL 2
357
1 SIMPLE t1 ref a a 4 test.t2.a 3
329
1 SIMPLE t1 ref a a 4 test.t2.a 1
358
330
explain select * from t1,t2 where t1.b=t2.b;
359
331
id select_type table type possible_keys key key_len ref rows Extra
360
332
1 SIMPLE t2 ALL b NULL NULL NULL 2
361
1 SIMPLE t1 ref b b 5 test.t2.b 1
333
1 SIMPLE t1 ALL b NULL NULL NULL 5 Using where; Using join buffer
362
334
explain select * from t1,t2 force index(c) where t1.a=t2.a;
363
335
id select_type table type possible_keys key key_len ref rows Extra
364
336
1 SIMPLE t2 ALL NULL NULL NULL NULL 2
365
1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where; Using join buffer
337
1 SIMPLE t1 ref a a 4 test.t2.a 1
366
338
explain select * from t1 where a=0 or a=2;
367
339
id select_type table type possible_keys key key_len ref rows Extra
368
340
1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where
369
341
explain select * from t1 force index (a) where a=0 or a=2;
370
342
id select_type table type possible_keys key key_len ref rows Extra
371
1 SIMPLE t1 range a a 4 NULL 4 Using index condition; Using MRR
343
1 SIMPLE t1 range a a 4 NULL 4 Using where
372
344
explain select * from t1 where c=1;
373
345
id select_type table type possible_keys key key_len ref rows Extra
374
346
1 SIMPLE t1 ref c,c_2 c 5 const 1
518
create table t1 (a int not null, primary key(a));
519
create table t2 (a int not null, b int not null, primary key(a,b));
520
insert into t1 values (1),(2),(3),(4),(5),(6);
521
insert into t2 values (1,1),(2,1);
522
lock tables t1 read local, t2 read local;
523
select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
527
insert into t2 values(2,0);
528
select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
534
CREATE TABLE t1 (c1 varchar(250) NOT NULL);
535
CREATE TABLE t2 (c1 varchar(250) NOT NULL, PRIMARY KEY (c1));
536
INSERT INTO t1 VALUES ('test000001'), ('test000002'), ('test000003');
537
INSERT INTO t2 VALUES ('test000002'), ('test000003'), ('test000004');
538
LOCK TABLES t1 READ LOCAL, t2 READ LOCAL;
539
SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
540
WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
542
INSERT INTO t2 VALUES ('test000001'), ('test000005');
543
SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
544
WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
548
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
549
Got one of the listed errors
550
create table t1 (a int, b varchar(200), c text not null) checksum=1;
551
create table t2 (a int, b varchar(200), c text not null) checksum=0;
487
create table t1 (a int, b varchar(200), c text not null);
488
create table t2 (a int, b varchar(200), c text not null);
552
489
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
553
490
insert t2 select * from t1;
554
checksum table t1, t2, t3 quick;
560
Error 1146 Table 'test.t3' doesn't exist
561
checksum table t1, t2, t3;
567
Error 1146 Table 'test.t3' doesn't exist
568
checksum table t1, t2, t3 extended;
574
Error 1146 Table 'test.t3' doesn't exist
576
create table t1 (a int, key (a));
578
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
579
t1 1 a 1 a A NULL NULL NULL YES BTREE
580
alter table t1 disable keys;
582
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
583
t1 1 a 1 a A NULL NULL NULL YES BTREE disabled
584
create table t2 (a int);
585
set @@rand_seed1=31415926,@@rand_seed2=2718281828;
586
insert t1 select * from t2;
588
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
589
t1 1 a 1 a A NULL NULL NULL YES BTREE disabled
590
alter table t1 enable keys;
592
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
593
t1 1 a 1 a A 1000 NULL NULL YES BTREE
594
alter table t1 engine=heap;
595
alter table t1 disable keys;
597
Note 1031 Table storage engine for 't1' doesn't have this option
599
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
600
t1 1 a 1 a NULL 500 NULL NULL YES HASH
491
checksum table t1, t2, t3;
497
Error 1146 Table 'test.t3' doesn't exist
498
checksum table t1, t2, t3;
504
Error 1146 Table 'test.t3' doesn't exist
505
checksum table t1, t2, t3;
511
Error 1146 Table 'test.t3' doesn't exist
601
512
drop table t1,t2;
602
513
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
603
514
insert into t1 values (null,''), (null,'');
604
515
explain select count(*) from t1 where a is null;
605
516
id select_type table type possible_keys key key_len ref rows Extra
606
1 SIMPLE t1 ref idx idx 4 const 1 Using where
517
1 SIMPLE t1 ref idx idx 7 const 1 Using where
607
518
select count(*) from t1 where a is null;
611
522
create table t1 (c1 int, c2 varchar(4) not null default '',
612
key(c2(3))) default charset=utf8;
613
524
insert into t1 values (1,'A'), (2, 'B'), (3, 'A');
614
525
update t1 set c2='A B' where c1=2;
631
542
test.t2 984116287
632
543
drop table t1, t2;
633
show variables like 'myisam_stats_method';
635
myisam_stats_method nulls_unequal
636
create table t1 (a int, key(a));
637
insert into t1 values (0),(1),(2),(3),(4);
638
insert into t1 select NULL from t1;
640
Table Op Msg_type Msg_text
641
test.t1 analyze status OK
643
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
644
t1 1 a 1 a A 10 NULL NULL YES BTREE
645
insert into t1 values (11);
646
delete from t1 where a=11;
648
Table Op Msg_type Msg_text
649
test.t1 check status OK
651
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
652
t1 1 a 1 a A 10 NULL NULL YES BTREE
653
set myisam_stats_method=nulls_equal;
654
show variables like 'myisam_stats_method';
656
myisam_stats_method nulls_equal
657
insert into t1 values (11);
658
delete from t1 where a=11;
660
Table Op Msg_type Msg_text
661
test.t1 analyze status OK
663
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
664
t1 1 a 1 a A 5 NULL NULL YES BTREE
665
insert into t1 values (11);
666
delete from t1 where a=11;
668
Table Op Msg_type Msg_text
669
test.t1 check status OK
671
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
672
t1 1 a 1 a A 5 NULL NULL YES BTREE
673
set myisam_stats_method=DEFAULT;
674
show variables like 'myisam_stats_method';
676
myisam_stats_method nulls_unequal
677
insert into t1 values (11);
678
delete from t1 where a=11;
680
Table Op Msg_type Msg_text
681
test.t1 analyze status OK
683
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
684
t1 1 a 1 a A 10 NULL NULL YES BTREE
685
insert into t1 values (11);
686
delete from t1 where a=11;
688
Table Op Msg_type Msg_text
689
test.t1 check status OK
691
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
692
t1 1 a 1 a A 10 NULL NULL YES BTREE
694
set myisam_stats_method=nulls_ignored;
695
show variables like 'myisam_stats_method';
697
myisam_stats_method nulls_ignored
699
a char(3), b char(4), c char(5), d char(6),
702
insert into t1 values ('bcd','def1', NULL, 'zz');
703
insert into t1 values ('bcd','def2', NULL, 'zz');
704
insert into t1 values ('bce','def1', 'yuu', NULL);
705
insert into t1 values ('bce','def2', NULL, 'quux');
707
Table Op Msg_type Msg_text
708
test.t1 analyze status OK
710
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
711
t1 1 a 1 a A 2 NULL NULL YES BTREE
712
t1 1 a 2 b A 4 NULL NULL YES BTREE
713
t1 1 a 3 c A 4 NULL NULL YES BTREE
714
t1 1 a 4 d A 4 NULL NULL YES BTREE
717
Table Op Msg_type Msg_text
718
test.t1 analyze status OK
720
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
721
t1 1 a 1 a A 0 NULL NULL YES BTREE
722
t1 1 a 2 b A 0 NULL NULL YES BTREE
723
t1 1 a 3 c A 0 NULL NULL YES BTREE
724
t1 1 a 4 d A 0 NULL NULL YES BTREE
725
set myisam_stats_method=DEFAULT;
728
545
cip INT NOT NULL,
730
546
score INT NOT NULL DEFAULT 0,
733
insert into t1 (cip, time) VALUES (1, '00:01'), (2, '00:02'), (3,'00:03');
734
insert into t1 (cip, bob, time) VALUES (4, 'a', '00:04'), (5, 'b', '00:05'),
736
select * from t1 where bob is null and cip=1;
739
create index bug on t1 (bob(22), cip, time);
740
select * from t1 where bob is null and cip=1;
549
insert into t1 (cip) VALUES (1), (2), (3);
550
insert into t1 (cip, bob) VALUES (4, 'a' ), (5, 'b'),
552
select * from t1 where bob is null and cip=1;
555
create index bug on t1 (bob(22), cip);
556
select * from t1 where bob is null and cip=1;
560
create temporary table t1 (
745
561
id1 int not null auto_increment,
746
562
id2 int not null default '0',
775
CREATE TABLE t1(a CHAR(9), b VARCHAR(7)) ENGINE=MyISAM;
776
INSERT INTO t1(a) VALUES('xxxxxxxxx'),('xxxxxxxxx');
777
UPDATE t1 AS ta1,t1 AS ta2 SET ta1.b='aaaaaa',ta2.b='bbbbbb';
783
SET @@myisam_repair_threads=2;
591
SET GLOBAL myisam_repair_threads=2;
784
592
SHOW VARIABLES LIKE 'myisam_repair%';
785
593
Variable_name Value
786
594
myisam_repair_threads 2
788
`_id` int(11) NOT NULL default '0',
792
`loverlap` int(11) default NULL,
793
`roverlap` int(11) default NULL,
794
`lneighbor_id` int(11) default NULL,
795
`rneighbor_id` int(11) default NULL,
796
`length_` int(11) default NULL,
797
`sequence` mediumtext,
799
`_obj_class` text NOT NULL,
801
UNIQUE KEY `sequence_name_index` (`name`(50)),
803
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
804
INSERT INTO t1 VALUES
805
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
806
(2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
807
(3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample3',''),
808
(4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample4',''),
809
(5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample5',''),
810
(6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample6',''),
811
(7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample7',''),
812
(8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample8',''),
813
(9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample9','');
825
DELETE FROM t1 WHERE _id < 8;
826
SHOW TABLE STATUS LIKE 't1';
827
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
828
t1 MyISAM 10 Dynamic 2 # # # # 140 # # # # # #
829
CHECK TABLE t1 EXTENDED;
830
Table Op Msg_type Msg_text
831
test.t1 check status OK
833
Table Op Msg_type Msg_text
834
test.t1 optimize status OK
835
CHECK TABLE t1 EXTENDED;
836
Table Op Msg_type Msg_text
837
test.t1 check status OK
838
SHOW TABLE STATUS LIKE 't1';
839
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
840
t1 MyISAM 10 Dynamic 2 # # # # 0 # # # # # #
847
`_id` int(11) NOT NULL default '0',
851
`loverlap` int(11) default NULL,
852
`roverlap` int(11) default NULL,
853
`lneighbor_id` int(11) default NULL,
854
`rneighbor_id` int(11) default NULL,
855
`length_` int(11) default NULL,
856
`sequence` mediumtext,
858
`_obj_class` text NOT NULL,
860
UNIQUE KEY `sequence_name_index` (`name`(50)),
862
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
863
INSERT INTO t1 VALUES
864
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
865
(2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
866
(3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample3',''),
867
(4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample4',''),
868
(5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample5',''),
869
(6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample6',''),
870
(7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample7',''),
871
(8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample8',''),
872
(9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample9','');
884
DELETE FROM t1 WHERE _id < 8;
885
SHOW TABLE STATUS LIKE 't1';
886
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
887
t1 MyISAM 10 Dynamic 2 # # # # 140 # # # # # #
888
CHECK TABLE t1 EXTENDED;
889
Table Op Msg_type Msg_text
890
test.t1 check status OK
891
REPAIR TABLE t1 QUICK;
892
Table Op Msg_type Msg_text
893
test.t1 repair status OK
894
CHECK TABLE t1 EXTENDED;
895
Table Op Msg_type Msg_text
896
test.t1 check status OK
897
SHOW TABLE STATUS LIKE 't1';
898
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
899
t1 MyISAM 10 Dynamic 2 # # # # 140 # # # # # #
905
SET @@myisam_repair_threads=1;
595
CREATE TEMPORARY TABLE t1 (
596
`_id` int NOT NULL default '0',
600
`loverlap` int default NULL,
601
`roverlap` int default NULL,
602
`lneighbor_id` int default NULL,
603
`rneighbor_id` int default NULL,
604
`length_` int default NULL,
607
`_obj_class` text NOT NULL,
609
UNIQUE KEY `sequence_name_index` (`name`(50)),
612
INSERT INTO t1 VALUES
613
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
614
(2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
615
(3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample3',''),
616
(4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample4',''),
617
(5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample5',''),
618
(6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample6',''),
619
(7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample7',''),
620
(8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample8',''),
621
(9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample9','');
633
DELETE FROM t1 WHERE _id < 8;
634
SHOW TABLE STATUS LIKE 't1';
635
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 Plugin_name
637
Table Op Msg_type Msg_text
638
test.t1 check status OK
639
ALTER TABLE t1 ENGINE=MYISAM;
641
Table Op Msg_type Msg_text
642
test.t1 check status OK
643
SHOW TABLE STATUS LIKE 't1';
644
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 Plugin_name
650
SET GLOBAL myisam_repair_threads=1;
906
651
SHOW VARIABLES LIKE 'myisam_repair%';
907
652
Variable_name Value
908
653
myisam_repair_threads 1
909
CREATE TABLE t1(a VARCHAR(16));
910
INSERT INTO t1 VALUES('aaaaaaaa'),(NULL);
911
UPDATE t1 AS ta1, t1 AS ta2 SET ta1.a='aaaaaaaaaaaaaaaa';
917
CREATE TABLE t1(a INT);
918
INSERT INTO t1 VALUES(1),(2);
919
UPDATE t1,t1 AS t2 SET t1.a=t1.a+2 WHERE t1.a=t2.a-1;
920
SELECT * FROM t1 ORDER BY a;
925
CREATE TABLE t1 (c1 TEXT) AVG_ROW_LENGTH=70100 MAX_ROWS=4100100100;
654
CREATE TEMPORARY TABLE t1 (c1 TEXT) ENGINE=MyISAM;
926
655
SHOW TABLE STATUS LIKE 't1';
927
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
928
t1 MyISAM 10 Dynamic X X X 72057594037927935 X X X X X X latin1_swedish_ci X max_rows=4100100100 avg_row_length=70100
656
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 Plugin_name
930
CREATE TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM;
658
CREATE TEMPORARY TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM;
931
659
INSERT INTO t1 VALUES
932
660
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
933
661
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
1091
819
Note 1265 Data truncated for column 'c' at row 1
1092
820
select concat('*',v,'*',c,'*',t,'*') from t1;
1093
821
concat('*',v,'*',c,'*',t,'*')
1096
824
show create table t1;
1097
825
Table Create Table
1098
t1 CREATE TABLE `t1` (
826
t1 CREATE TEMPORARY TABLE `t1` (
1099
827
`v` varchar(10) DEFAULT NULL,
1100
`c` char(10) DEFAULT NULL,
828
`c` varchar(10) DEFAULT NULL,
1102
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1103
create table t2 like t1;
831
create TEMPORARY table t2 like t1;
1104
832
show create table t2;
1105
833
Table Create Table
1106
t2 CREATE TABLE `t2` (
834
t2 CREATE TEMPORARY TABLE `t2` (
1107
835
`v` varchar(10) DEFAULT NULL,
1108
`c` char(10) DEFAULT NULL,
836
`c` varchar(10) DEFAULT NULL,
1110
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1111
create table t3 select * from t1;
839
create TEMPORARY table t3 select * from t1;
1112
840
show create table t3;
1113
841
Table Create Table
1114
t3 CREATE TABLE `t3` (
842
t3 CREATE TEMPORARY TABLE `t3` (
1115
843
`v` varchar(10) DEFAULT NULL,
1116
`c` char(10) DEFAULT NULL,
844
`c` varchar(10) DEFAULT NULL,
1118
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1119
847
alter table t1 modify c varchar(10);
1120
848
show create table t1;
1121
849
Table Create Table
1122
t1 CREATE TABLE `t1` (
850
t1 CREATE TEMPORARY TABLE `t1` (
1123
851
`v` varchar(10) DEFAULT NULL,
1124
852
`c` varchar(10) DEFAULT NULL,
1126
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1127
855
alter table t1 modify v char(10);
1128
856
show create table t1;
1129
857
Table Create Table
1130
t1 CREATE TABLE `t1` (
1131
`v` char(10) DEFAULT NULL,
858
t1 CREATE TEMPORARY TABLE `t1` (
859
`v` varchar(10) DEFAULT NULL,
1132
860
`c` varchar(10) DEFAULT NULL,
1134
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1135
863
alter table t1 modify t varchar(10);
1137
865
Note 1265 Data truncated for column 't' at row 2
1138
866
show create table t1;
1139
867
Table Create Table
1140
t1 CREATE TABLE `t1` (
1141
`v` char(10) DEFAULT NULL,
868
t1 CREATE TEMPORARY TABLE `t1` (
869
`v` varchar(10) DEFAULT NULL,
1142
870
`c` varchar(10) DEFAULT NULL,
1143
871
`t` varchar(10) DEFAULT NULL
1144
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1145
873
select concat('*',v,'*',c,'*',t,'*') from t1;
1146
874
concat('*',v,'*',c,'*',t,'*')
1149
877
drop table t1,t2,t3;
1150
create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
878
create TEMPORARY table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
1151
879
show create table t1;
1152
880
Table Create Table
1153
t1 CREATE TABLE `t1` (
881
t1 CREATE TEMPORARY TABLE `t1` (
1154
882
`v` varchar(10) DEFAULT NULL,
1155
`c` char(10) DEFAULT NULL,
883
`c` varchar(10) DEFAULT NULL,
1159
887
KEY `t` (`t`(10))
1160
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1161
889
select count(*) from t1;
1607
create table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
1337
create TEMPORARY table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
1608
1338
show create table t1;
1609
1339
Table Create Table
1610
t1 CREATE TABLE `t1` (
1340
t1 CREATE TEMPORARY TABLE `t1` (
1611
1341
`v` varchar(10) DEFAULT NULL,
1612
`c` char(10) DEFAULT NULL,
1342
`c` varchar(10) DEFAULT NULL,
1614
1344
KEY `v` (`v`(5)),
1615
1345
KEY `c` (`c`(5)),
1616
1346
KEY `t` (`t`(5))
1617
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1619
create table t1 (v char(10) character set utf8);
1620
show create table t1;
1622
t1 CREATE TABLE `t1` (
1623
`v` char(10) CHARACTER SET utf8 DEFAULT NULL
1624
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1626
create table t1 (v varchar(10), c char(10)) row_format=fixed;
1627
show create table t1;
1629
t1 CREATE TABLE `t1` (
1349
create TEMPORARY table t1 (v char(10));
1350
show create table t1;
1352
t1 CREATE TEMPORARY TABLE `t1` (
1353
`v` varchar(10) DEFAULT NULL
1356
create TEMPORARY table t1 (v varchar(10), c char(10));
1357
show create table t1;
1359
t1 CREATE TEMPORARY TABLE `t1` (
1630
1360
`v` varchar(10) DEFAULT NULL,
1631
`c` char(10) DEFAULT NULL
1632
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
1361
`c` varchar(10) DEFAULT NULL
1633
1363
insert into t1 values('a','a'),('a ','a ');
1634
1364
select concat('*',v,'*',c,'*') from t1;
1635
1365
concat('*',v,'*',c,'*')
1639
create table t1 (v varchar(65530), key(v(10)));
1640
insert into t1 values(repeat('a',65530));
1641
select length(v) from t1 where v=repeat('a',65530);
1645
create table t1(a int, b varchar(12), key ba(b, a));
1369
create TEMPORARY table t1(a int, b varchar(12), key ba(b, a));
1646
1370
insert into t1 values (1, 'A'), (20, NULL);
1647
1371
explain select * from t1 where a=20 and b is null;
1648
1372
id select_type table type possible_keys key key_len ref rows Extra
1649
1 SIMPLE t1 ref ba ba 20 const,const 1 Using where; Using index
1373
1 SIMPLE t1 ref ba ba 56 const,const 1 Using where; Using index
1650
1374
select * from t1 where a=20 and b is null;
1654
create table t1 (v varchar(65530), key(v));
1656
Warning 1071 Specified key was too long; max key length is 1332 bytes
1657
drop table if exists t1;
1658
create table t1 (v varchar(65536));
1660
Note 1246 Converting column 'v' from VARCHAR to TEXT
1661
show create table t1;
1663
t1 CREATE TABLE `t1` (
1665
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1667
create table t1 (v varchar(65530) character set utf8);
1669
Note 1246 Converting column 'v' from VARCHAR to TEXT
1670
show create table t1;
1672
t1 CREATE TABLE `t1` (
1673
`v` mediumtext CHARACTER SET utf8
1674
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1676
create table t1 (v varchar(65535));
1677
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
1678
set storage_engine=MyISAM;
1679
set @save_concurrent_insert=@@concurrent_insert;
1680
set global concurrent_insert=1;
1681
create table t1 (a int);
1682
insert into t1 values (1),(2),(3),(4),(5);
1683
lock table t1 read local;
1684
insert into t1 values(6),(7);
1686
delete from t1 where a>=3 and a<=4;
1687
lock table t1 read local;
1688
set global concurrent_insert=2;
1689
insert into t1 values (8),(9);
1691
insert into t1 values (10),(11),(12);
1705
Table Op Msg_type Msg_text
1706
test.t1 check status OK
1708
create table t1 (a int, b varchar(30) default "hello");
1709
insert into t1 (a) values (1),(2),(3),(4),(5);
1710
lock table t1 read local;
1711
insert into t1 (a) values(6),(7);
1713
delete from t1 where a>=3 and a<=4;
1714
lock table t1 read local;
1715
set global concurrent_insert=2;
1716
insert into t1 (a) values (8),(9);
1718
insert into t1 (a) values (10),(11),(12);
1732
Table Op Msg_type Msg_text
1733
test.t1 check status OK
1735
set global concurrent_insert=@save_concurrent_insert;
1378
create temporary table t1 (v varchar(65530), key(v));
1379
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1380
create temporary table t1 (v varchar(65536));
1381
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1382
create temporary table t1 (v varchar(65530));
1383
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1384
create temporary table t1 (v varchar(65535));
1385
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1386
set storage_engine=InnoDB;
1736
1387
create table t1 (a int, key(a));
1737
1388
insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
1738
1389
analyze table t1;
1782
CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
1431
CREATE TEMPORARY TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
1783
1432
SHOW TABLE STATUS LIKE 't1';
1784
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
1785
t1 MyISAM 10 Fixed 0 # # # 1024 # # # # # # #
1433
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 Plugin_name
1786
1434
INSERT INTO t1 VALUES (1,1);
1787
1435
SHOW TABLE STATUS LIKE 't1';
1788
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
1789
t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
1790
ALTER TABLE t1 DISABLE KEYS;
1791
SHOW TABLE STATUS LIKE 't1';
1792
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
1793
t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
1794
ALTER TABLE t1 ENABLE KEYS;
1795
SHOW TABLE STATUS LIKE 't1';
1796
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
1797
t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
1798
ALTER TABLE t1 DISABLE KEYS;
1799
SHOW TABLE STATUS LIKE 't1';
1800
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
1801
t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
1802
ALTER TABLE t1 ENABLE KEYS;
1803
SHOW TABLE STATUS LIKE 't1';
1804
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
1805
t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
1436
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 Plugin_name
1437
ALTER TABLE t1 DISABLE KEYS;
1438
SHOW TABLE STATUS LIKE 't1';
1439
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 Plugin_name
1440
ALTER TABLE t1 ENABLE KEYS;
1441
SHOW TABLE STATUS LIKE 't1';
1442
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 Plugin_name
1443
ALTER TABLE t1 DISABLE KEYS;
1444
SHOW TABLE STATUS LIKE 't1';
1445
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 Plugin_name
1446
ALTER TABLE t1 ENABLE KEYS;
1447
SHOW TABLE STATUS LIKE 't1';
1448
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 Plugin_name
1806
1449
# Enable keys with parallel repair
1807
SET @@myisam_repair_threads=2;
1450
SET GLOBAL myisam_repair_threads=2;
1808
1451
ALTER TABLE t1 DISABLE KEYS;
1809
1452
ALTER TABLE t1 ENABLE KEYS;
1810
SET @@myisam_repair_threads=1;
1811
CHECK TABLE t1 EXTENDED;
1453
SET GLOBAL myisam_repair_threads=1;
1812
1455
Table Op Msg_type Msg_text
1813
1456
test.t1 check status OK
1815
CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id)) ENGINE=MyISAM;
1458
CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id));
1816
1459
CREATE TABLE t2 LIKE t1;
1817
1460
INSERT INTO t2 (id, ref) VALUES (1,3), (2,1), (3,2), (4,5), (4,4);
1818
1461
INSERT INTO t1 SELECT * FROM t2;
1829
DELETE FROM a USING t1 AS a INNER JOIN t1 AS b USING (id) WHERE a.ref < b.ref;
1836
1472
DROP TABLE t1, t2;
1837
1473
End of 5.0 tests
1838
create table t1 (a int not null, key `a` (a) key_block_size=1024);
1474
create temporary table t1 (a int not null, key `a` (a) key_block_size=1024) ENGINE=MyISAM;
1839
1475
show create table t1;
1840
1476
Table Create Table
1841
t1 CREATE TABLE `t1` (
1842
`a` int(11) NOT NULL,
1477
t1 CREATE TEMPORARY TABLE `t1` (
1843
1479
KEY `a` (`a`) KEY_BLOCK_SIZE=1024
1844
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1846
create table t1 (a int not null, key `a` (a) key_block_size=2048);
1482
create temporary table t1 (a int not null, key `a` (a) key_block_size=2048) ENGINE=MyISAM;
1847
1483
show create table t1;
1848
1484
Table Create Table
1849
t1 CREATE TABLE `t1` (
1850
`a` int(11) NOT NULL,
1485
t1 CREATE TEMPORARY TABLE `t1` (
1851
1487
KEY `a` (`a`) KEY_BLOCK_SIZE=2048
1852
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1854
create table t1 (a varchar(2048), key `a` (a));
1856
Warning 1071 Specified key was too long; max key length is 1332 bytes
1857
show create table t1;
1859
t1 CREATE TABLE `t1` (
1860
`a` varchar(2048) DEFAULT NULL,
1862
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1864
create table t1 (a varchar(2048), key `a` (a) key_block_size=1024);
1866
Warning 1071 Specified key was too long; max key length is 1332 bytes
1867
show create table t1;
1869
t1 CREATE TABLE `t1` (
1870
`a` varchar(2048) DEFAULT NULL,
1871
KEY `a` (`a`(1332)) KEY_BLOCK_SIZE=6144
1872
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1874
create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=1024;
1876
Warning 1071 Specified key was too long; max key length is 1332 bytes
1877
show create table t1;
1879
t1 CREATE TABLE `t1` (
1880
`a` int(11) NOT NULL,
1490
create temporary table t1 (a varchar(2048), key `a` (a)) ENGINE=MyISAM;
1492
Warning 1071 Specified key was too long; max key length is 1332 bytes
1493
show create table t1;
1495
t1 CREATE TEMPORARY TABLE `t1` (
1496
`a` varchar(2048) DEFAULT NULL,
1500
create temporary table t1 (a varchar(2048), key `a` (a) key_block_size=1024) ENGINE=MyISAM;
1502
Warning 1071 Specified key was too long; max key length is 1332 bytes
1503
show create table t1;
1505
t1 CREATE TEMPORARY TABLE `t1` (
1506
`a` varchar(2048) DEFAULT NULL,
1507
KEY `a` (`a`(333)) KEY_BLOCK_SIZE=6144
1510
create temporary table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=1024;
1512
Warning 1071 Specified key was too long; max key length is 1332 bytes
1513
show create table t1;
1515
t1 CREATE TEMPORARY TABLE `t1` (
1881
1517
`b` varchar(2048) DEFAULT NULL,
1883
KEY `b` (`b`(1332)) KEY_BLOCK_SIZE=6144
1884
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024
1519
KEY `b` (`b`(333)) KEY_BLOCK_SIZE=6144
1520
) ENGINE=MyISAM KEY_BLOCK_SIZE=1024
1885
1521
alter table t1 key_block_size=2048;
1886
1522
show create table t1;
1887
1523
Table Create Table
1888
t1 CREATE TABLE `t1` (
1889
`a` int(11) NOT NULL,
1524
t1 CREATE TEMPORARY TABLE `t1` (
1890
1526
`b` varchar(2048) DEFAULT NULL,
1891
1527
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
1892
KEY `b` (`b`(1332)) KEY_BLOCK_SIZE=8192
1893
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2048
1528
KEY `b` (`b`(333)) KEY_BLOCK_SIZE=8192
1529
) ENGINE=MyISAM KEY_BLOCK_SIZE=2048
1894
1530
alter table t1 add c int, add key (c);
1895
1531
show create table t1;
1896
1532
Table Create Table
1897
t1 CREATE TABLE `t1` (
1898
`a` int(11) NOT NULL,
1533
t1 CREATE TEMPORARY TABLE `t1` (
1899
1535
`b` varchar(2048) DEFAULT NULL,
1900
`c` int(11) DEFAULT NULL,
1536
`c` int DEFAULT NULL,
1901
1537
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
1902
KEY `b` (`b`(1332)) KEY_BLOCK_SIZE=8192,
1538
KEY `b` (`b`(333)) KEY_BLOCK_SIZE=8192,
1904
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2048
1540
) ENGINE=MyISAM KEY_BLOCK_SIZE=2048
1905
1541
alter table t1 key_block_size=0;
1906
1542
alter table t1 add d int, add key (d);
1907
1543
show create table t1;
1908
1544
Table Create Table
1909
t1 CREATE TABLE `t1` (
1910
`a` int(11) NOT NULL,
1545
t1 CREATE TEMPORARY TABLE `t1` (
1911
1547
`b` varchar(2048) DEFAULT NULL,
1912
`c` int(11) DEFAULT NULL,
1913
`d` int(11) DEFAULT NULL,
1548
`c` int DEFAULT NULL,
1549
`d` int DEFAULT NULL,
1914
1550
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
1915
KEY `b` (`b`(1332)) KEY_BLOCK_SIZE=8192,
1551
KEY `b` (`b`(333)) KEY_BLOCK_SIZE=8192,
1916
1552
KEY `c` (`c`) KEY_BLOCK_SIZE=2048,
1918
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1920
create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=8192;
1556
create temporary table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=8192;
1922
1558
Warning 1071 Specified key was too long; max key length is 1332 bytes
1923
1559
show create table t1;
1924
1560
Table Create Table
1925
t1 CREATE TABLE `t1` (
1926
`a` int(11) NOT NULL,
1561
t1 CREATE TEMPORARY TABLE `t1` (
1927
1563
`b` varchar(2048) DEFAULT NULL,
1930
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8192
1566
) ENGINE=MyISAM KEY_BLOCK_SIZE=8192
1932
create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) key_block_size=8192;
1568
create temporary table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) ENGINE=MyISAM key_block_size=8192;
1934
1570
Warning 1071 Specified key was too long; max key length is 1332 bytes
1935
1571
show create table t1;
1936
1572
Table Create Table
1937
t1 CREATE TABLE `t1` (
1938
`a` int(11) NOT NULL,
1573
t1 CREATE TEMPORARY TABLE `t1` (
1939
1575
`b` varchar(2048) DEFAULT NULL,
1940
1576
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
1942
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8192
1578
) ENGINE=MyISAM KEY_BLOCK_SIZE=8192
1944
create table t1 (a int not null, b int, key (a) key_block_size=1024, key(b) key_block_size=8192) key_block_size=16384;
1580
create temporary table t1 (a int not null, b int, key (a) key_block_size=1024, key(b) key_block_size=8192) ENGINE=MyISAM key_block_size=16384;
1945
1581
show create table t1;
1946
1582
Table Create Table
1947
t1 CREATE TABLE `t1` (
1948
`a` int(11) NOT NULL,
1949
`b` int(11) DEFAULT NULL,
1583
t1 CREATE TEMPORARY TABLE `t1` (
1585
`b` int DEFAULT NULL,
1950
1586
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
1951
1587
KEY `b` (`b`) KEY_BLOCK_SIZE=8192
1952
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=16384
1588
) ENGINE=MyISAM KEY_BLOCK_SIZE=16384
1954
create table t1 (a int not null, key `a` (a) key_block_size=512);
1590
create temporary table t1 (a int not null, key `a` (a) key_block_size=512) ENGINE=MyISAM;
1955
1591
show create table t1;
1956
1592
Table Create Table
1957
t1 CREATE TABLE `t1` (
1958
`a` int(11) NOT NULL,
1593
t1 CREATE TEMPORARY TABLE `t1` (
1959
1595
KEY `a` (`a`) KEY_BLOCK_SIZE=1024
1960
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1962
create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000);
1598
create temporary table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000) ENGINE=MyISAM;
1964
1600
Warning 1071 Specified key was too long; max key length is 1332 bytes
1965
1601
show create table t1;
1966
1602
Table Create Table
1967
t1 CREATE TABLE `t1` (
1603
t1 CREATE TEMPORARY TABLE `t1` (
1968
1604
`a` varchar(2048) DEFAULT NULL,
1969
KEY `a` (`a`(1332)) KEY_BLOCK_SIZE=6144
1970
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1605
KEY `a` (`a`(333)) KEY_BLOCK_SIZE=6144
1972
create table t1 (a int not null, key `a` (a) key_block_size=1025);
1608
create temporary table t1 (a int not null, key `a` (a) key_block_size=1025) ENGINE=MyISAM;
1973
1609
show create table t1;
1974
1610
Table Create Table
1975
t1 CREATE TABLE `t1` (
1976
`a` int(11) NOT NULL,
1611
t1 CREATE TEMPORARY TABLE `t1` (
1977
1613
KEY `a` (`a`) KEY_BLOCK_SIZE=2048
1978
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1980
create table t1 (a int not null, key key_block_size=1024 (a));
1981
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=1024 (a))' at line 1
1982
create table t1 (a int not null, key `a` key_block_size=1024 (a));
1983
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_block_size=1024 (a))' at line 1
1616
create temporary table t1 (a int not null, key key_block_size=1024 (a)) ENGINE=MyISAM;
1617
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near '=1024 (a)) ENGINE=MyISAM' at line 1
1618
create temporary table t1 (a int not null, key `a` key_block_size=1024 (a)) ENGINE=MyISAM;
1619
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'key_block_size=1024 (a)) ENGINE=MyISAM' at line 1
1620
CREATE temporary TABLE t1 (
1986
1622
c2 VARCHAR(300),
1987
1623
KEY (c1) KEY_BLOCK_SIZE 1024,
1988
1624
KEY (c2) KEY_BLOCK_SIZE 8192
1990
1626
INSERT INTO t1 VALUES (10, REPEAT('a', CEIL(RAND(10) * 300))),
1991
1627
(11, REPEAT('b', CEIL(RAND() * 300))),
1992
1628
(12, REPEAT('c', CEIL(RAND() * 300))),