245
247
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
246
248
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
247
249
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;
250
int, i999 int, i1000 int, b blob) engine=myisam row_format=dynamic;
249
251
insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
250
252
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
253
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
313
KEY `post_time` (`post_time`),
313
315
KEY `poster_login` (`poster_login`),
314
KEY `topic_id` (`topic_id`),
315
FULLTEXT KEY `post_text` (`post_text`)
316
KEY `topic_id` (`topic_id`)
317
# FULLTEXT KEY `post_text` (`post_text`)
317
319
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
321
Table Op Msg_type Msg_text
323
322
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));
324
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)) ENGINE=MyISAM;
326
325
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));
326
CREATE TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300)) ENGINE=MyISAM;
328
327
ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
329
328
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));
330
CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a)) ENGINE=MyISAM;
332
331
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
333
332
create table t2 (a int not null, b int, c int, key(b), key(c), key(a));
334
333
INSERT into t2 values (1,1,1), (2,2,2);
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
517
create table t1 (a int, b varchar(200), c text not null) checksum=1;
551
518
create table t2 (a int, b varchar(200), c text not null) checksum=0;
552
519
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
553
520
insert t2 select * from t1;
554
521
checksum table t1, t2, t3 quick;
574
541
Error 1146 Table 'test.t3' doesn't exist
575
542
drop table t1,t2;
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
602
543
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
603
544
insert into t1 values (null,''), (null,'');
604
545
explain select count(*) from t1 where a is null;
605
546
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
547
1 SIMPLE t1 ref idx idx 7 const 1 Using where
607
548
select count(*) from t1 where a is null;
611
552
create table t1 (c1 int, c2 varchar(4) not null default '',
612
key(c2(3))) default charset=utf8;
613
554
insert into t1 values (1,'A'), (2, 'B'), (3, 'A');
614
555
update t1 set c2='A B' where c1=2;
631
572
test.t2 984116287
632
573
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
575
cip INT NOT NULL,
729
576
time TIME NOT NULL,
783
SET @@myisam_repair_threads=2;
630
SET GLOBAL myisam_repair_threads=2;
784
631
SHOW VARIABLES LIKE 'myisam_repair%';
785
632
Variable_name Value
786
633
myisam_repair_threads 2
787
634
CREATE TABLE t1 (
788
`_id` int(11) NOT NULL default '0',
635
`_id` int NOT NULL default '0',
791
638
`description` text,
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,
639
`loverlap` int default NULL,
640
`roverlap` int default NULL,
641
`lneighbor_id` int default NULL,
642
`rneighbor_id` int default NULL,
643
`length_` int default NULL,
799
646
`_obj_class` text NOT NULL,
800
647
PRIMARY KEY (`_id`),
801
648
UNIQUE KEY `sequence_name_index` (`name`(50)),
803
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
804
651
INSERT INTO t1 VALUES
805
652
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
806
653
(2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
837
684
test.t1 check status OK
838
685
SHOW TABLE STATUS LIKE 't1';
839
686
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 # # # # # #
687
t1 MyISAM 0 Dynamic 2 # # # # 0 # # # # # #
841
688
SELECT _id FROM t1;
846
693
CREATE TABLE t1 (
847
`_id` int(11) NOT NULL default '0',
694
`_id` int NOT NULL default '0',
850
697
`description` text,
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,
698
`loverlap` int default NULL,
699
`roverlap` int default NULL,
700
`lneighbor_id` int default NULL,
701
`rneighbor_id` int default NULL,
702
`length_` int default NULL,
858
705
`_obj_class` text NOT NULL,
859
706
PRIMARY KEY (`_id`),
860
707
UNIQUE KEY `sequence_name_index` (`name`(50)),
862
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
863
710
INSERT INTO t1 VALUES
864
711
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
865
712
(2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
1091
938
Note 1265 Data truncated for column 'c' at row 1
1092
939
select concat('*',v,'*',c,'*',t,'*') from t1;
1093
940
concat('*',v,'*',c,'*',t,'*')
1096
943
show create table t1;
1097
944
Table Create Table
1098
945
t1 CREATE TABLE `t1` (
1099
`v` varchar(10) DEFAULT NULL,
1100
`c` char(10) DEFAULT NULL,
1102
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1103
950
create table t2 like t1;
1104
951
show create table t2;
1105
952
Table Create Table
1106
953
t2 CREATE TABLE `t2` (
1107
`v` varchar(10) DEFAULT NULL,
1108
`c` char(10) DEFAULT NULL,
1110
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1111
958
create table t3 select * from t1;
1112
959
show create table t3;
1113
960
Table Create Table
1114
961
t3 CREATE TABLE `t3` (
1115
`v` varchar(10) DEFAULT NULL,
1116
`c` char(10) DEFAULT NULL,
1118
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1119
966
alter table t1 modify c varchar(10);
1120
967
show create table t1;
1121
968
Table Create Table
1122
969
t1 CREATE TABLE `t1` (
1123
`v` varchar(10) DEFAULT NULL,
1124
`c` varchar(10) DEFAULT NULL,
1126
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1127
974
alter table t1 modify v char(10);
1128
975
show create table t1;
1129
976
Table Create Table
1130
977
t1 CREATE TABLE `t1` (
1131
`v` char(10) DEFAULT NULL,
1132
`c` varchar(10) DEFAULT NULL,
1134
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1135
982
alter table t1 modify t varchar(10);
1137
984
Note 1265 Data truncated for column 't' at row 2
1138
985
show create table t1;
1139
986
Table Create Table
1140
987
t1 CREATE TABLE `t1` (
1141
`v` char(10) DEFAULT NULL,
1142
`c` varchar(10) DEFAULT NULL,
1143
`t` varchar(10) DEFAULT NULL
1144
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1145
992
select concat('*',v,'*',c,'*',t,'*') from t1;
1146
993
concat('*',v,'*',c,'*',t,'*')
1149
996
drop table t1,t2,t3;
1150
997
create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
1151
998
show create table t1;
1152
999
Table Create Table
1153
1000
t1 CREATE TABLE `t1` (
1154
`v` varchar(10) DEFAULT NULL,
1155
`c` char(10) DEFAULT NULL,
1160
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1161
1008
select count(*) from t1;
1201
1048
explain select count(*) from t1 where v='a ';
1202
1049
id select_type table type possible_keys key key_len ref rows Extra
1203
1 SIMPLE t1 ref v v 13 const # Using where; Using index
1050
1 SIMPLE t1 ref v v 43 const # Using where; Using index
1204
1051
explain select count(*) from t1 where c='a ';
1205
1052
id select_type table type possible_keys key key_len ref rows Extra
1206
1 SIMPLE t1 ref c c 11 const # Using where; Using index
1053
1 SIMPLE t1 ref c c 43 const # Using where; Using index
1207
1054
explain select count(*) from t1 where t='a ';
1208
1055
id select_type table type possible_keys key key_len ref rows Extra
1209
1 SIMPLE t1 ref t t 13 const # Using where
1056
1 SIMPLE t1 ref t t 43 const # Using where
1210
1057
explain select count(*) from t1 where v like 'a%';
1211
1058
id select_type table type possible_keys key key_len ref rows Extra
1212
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
1059
1 SIMPLE t1 range v v 43 NULL # Using where; Using index
1213
1060
explain select count(*) from t1 where v between 'a' and 'a ';
1214
1061
id select_type table type possible_keys key key_len ref rows Extra
1215
1 SIMPLE t1 ref v v 13 const # Using where; Using index
1062
1 SIMPLE t1 ref v v 43 const # Using where; Using index
1216
1063
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
1217
1064
id select_type table type possible_keys key key_len ref rows Extra
1218
1 SIMPLE t1 ref v v 13 const # Using where; Using index
1065
1 SIMPLE t1 ref v v 43 const # Using where; Using index
1219
1066
alter table t1 add unique(v);
1220
1067
ERROR 23000: Duplicate entry '{ ' for key 'v_2'
1221
1068
alter table t1 add key(v);
1222
1069
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a';
1234
1081
explain select * from t1 where v='a';
1235
1082
id select_type table type possible_keys key key_len ref rows Extra
1236
1 SIMPLE t1 ref v,v_2 # 13 const # Using index condition
1083
1 SIMPLE t1 ref v,v_2 # 43 const # Using where
1237
1084
select v,count(*) from t1 group by v limit 10;
1608
1459
show create table t1;
1609
1460
Table Create Table
1610
1461
t1 CREATE TABLE `t1` (
1611
`v` varchar(10) DEFAULT NULL,
1612
`c` char(10) DEFAULT NULL,
1617
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1619
create table t1 (v char(10) character set utf8);
1470
create table t1 (v char(10));
1620
1471
show create table t1;
1621
1472
Table Create Table
1622
1473
t1 CREATE TABLE `t1` (
1623
`v` char(10) CHARACTER SET utf8 DEFAULT NULL
1624
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1626
1477
create table t1 (v varchar(10), c char(10)) row_format=fixed;
1627
1478
show create table t1;
1628
1479
Table Create Table
1629
1480
t1 CREATE TABLE `t1` (
1630
`v` varchar(10) DEFAULT NULL,
1631
`c` char(10) DEFAULT NULL
1632
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
1483
) ENGINE=MyISAM ROW_FORMAT=FIXED
1633
1484
insert into t1 values('a','a'),('a ','a ');
1634
1485
select concat('*',v,'*',c,'*') from t1;
1635
1486
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
1490
create table t1(a int, b varchar(12), key ba(b, a));
1646
1491
insert into t1 values (1, 'A'), (20, NULL);
1647
1492
explain select * from t1 where a=20 and b is null;
1648
1493
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
1494
1 SIMPLE t1 ref ba ba 56 const,const 1 Using where; Using index
1650
1495
select * from t1 where a=20 and b is null;
1654
1499
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;
1500
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1658
1501
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
1502
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1503
create table t1 (v varchar(65530));
1504
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1676
1505
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;
1506
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1507
set storage_engine=InnoDB;
1736
1508
create table t1 (a int, key(a));
1737
1509
insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
1738
1510
analyze table t1;
1782
1558
CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
1783
1559
SHOW TABLE STATUS LIKE 't1';
1784
1560
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 # # # # # # #
1561
t1 MyISAM 0 Fixed 0 # # # 1024 # # # # # # #
1786
1562
INSERT INTO t1 VALUES (1,1);
1787
1563
SHOW TABLE STATUS LIKE 't1';
1788
1564
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 # # # # # # #
1565
t1 MyISAM 0 Fixed 1 # # # 3072 # # # # # # #
1566
ALTER TABLE t1 DISABLE KEYS;
1567
SHOW TABLE STATUS LIKE 't1';
1568
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
1569
t1 MyISAM 0 Fixed 1 # # # 3072 # # # # # # #
1570
ALTER TABLE t1 ENABLE KEYS;
1571
SHOW TABLE STATUS LIKE 't1';
1572
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
1573
t1 MyISAM 0 Fixed 1 # # # 3072 # # # # # # #
1574
ALTER TABLE t1 DISABLE KEYS;
1575
SHOW TABLE STATUS LIKE 't1';
1576
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
1577
t1 MyISAM 0 Fixed 1 # # # 3072 # # # # # # #
1578
ALTER TABLE t1 ENABLE KEYS;
1579
SHOW TABLE STATUS LIKE 't1';
1580
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
1581
t1 MyISAM 0 Fixed 1 # # # 3072 # # # # # # #
1806
1582
# Enable keys with parallel repair
1807
SET @@myisam_repair_threads=2;
1583
SET GLOBAL myisam_repair_threads=2;
1808
1584
ALTER TABLE t1 DISABLE KEYS;
1809
1585
ALTER TABLE t1 ENABLE KEYS;
1810
SET @@myisam_repair_threads=1;
1586
SET GLOBAL myisam_repair_threads=1;
1811
1587
CHECK TABLE t1 EXTENDED;
1812
1588
Table Op Msg_type Msg_text
1813
1589
test.t1 check status OK
1836
1612
DROP TABLE t1, t2;
1837
1613
End of 5.0 tests
1838
create table t1 (a int not null, key `a` (a) key_block_size=1024);
1614
create table t1 (a int not null, key `a` (a) key_block_size=1024) ENGINE=MyISAM;
1839
1615
show create table t1;
1840
1616
Table Create Table
1841
1617
t1 CREATE TABLE `t1` (
1842
`a` int(11) NOT NULL,
1843
1619
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);
1622
create table t1 (a int not null, key `a` (a) key_block_size=2048) ENGINE=MyISAM;
1847
1623
show create table t1;
1848
1624
Table Create Table
1849
1625
t1 CREATE TABLE `t1` (
1850
`a` int(11) NOT NULL,
1851
1627
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,
1881
`b` varchar(2048) DEFAULT NULL,
1630
create table t1 (a varchar(2048), key `a` (a)) ENGINE=MyISAM;
1632
Warning 1071 Specified key was too long; max key length is 1332 bytes
1633
show create table t1;
1635
t1 CREATE TABLE `t1` (
1640
create table t1 (a varchar(2048), key `a` (a) key_block_size=1024) ENGINE=MyISAM;
1642
Warning 1071 Specified key was too long; max key length is 1332 bytes
1643
show create table t1;
1645
t1 CREATE TABLE `t1` (
1647
KEY `a` (`a`()) KEY_BLOCK_SIZE=6144
1650
create table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=1024;
1652
Warning 1071 Specified key was too long; max key length is 1332 bytes
1653
show create table t1;
1655
t1 CREATE TABLE `t1` (
1883
KEY `b` (`b`(1332)) KEY_BLOCK_SIZE=6144
1884
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024
1659
KEY `b` (`b`()) KEY_BLOCK_SIZE=6144
1660
) ENGINE=MyISAM KEY_BLOCK_SIZE=1024
1885
1661
alter table t1 key_block_size=2048;
1886
1662
show create table t1;
1887
1663
Table Create Table
1888
1664
t1 CREATE TABLE `t1` (
1889
`a` int(11) NOT NULL,
1890
`b` varchar(2048) DEFAULT NULL,
1891
1667
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
1668
KEY `b` (`b`()) KEY_BLOCK_SIZE=8192
1669
) ENGINE=MyISAM KEY_BLOCK_SIZE=2048
1894
1670
alter table t1 add c int, add key (c);
1895
1671
show create table t1;
1896
1672
Table Create Table
1897
1673
t1 CREATE TABLE `t1` (
1898
`a` int(11) NOT NULL,
1899
`b` varchar(2048) DEFAULT NULL,
1900
`c` int(11) DEFAULT NULL,
1901
1677
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
1902
KEY `b` (`b`(1332)) KEY_BLOCK_SIZE=8192,
1678
KEY `b` (`b`()) KEY_BLOCK_SIZE=8192,
1904
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2048
1680
) ENGINE=MyISAM KEY_BLOCK_SIZE=2048
1905
1681
alter table t1 key_block_size=0;
1906
1682
alter table t1 add d int, add key (d);
1907
1683
show create table t1;
1908
1684
Table Create Table
1909
1685
t1 CREATE TABLE `t1` (
1910
`a` int(11) NOT NULL,
1911
`b` varchar(2048) DEFAULT NULL,
1912
`c` int(11) DEFAULT NULL,
1913
`d` int(11) DEFAULT NULL,
1914
1690
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
1915
KEY `b` (`b`(1332)) KEY_BLOCK_SIZE=8192,
1691
KEY `b` (`b`()) KEY_BLOCK_SIZE=8192,
1916
1692
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;
1696
create table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=8192;
1922
1698
Warning 1071 Specified key was too long; max key length is 1332 bytes
1923
1699
show create table t1;
1924
1700
Table Create Table
1925
1701
t1 CREATE TABLE `t1` (
1926
`a` int(11) NOT NULL,
1927
`b` varchar(2048) DEFAULT NULL,
1930
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8192
1706
) 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;
1708
create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) ENGINE=MyISAM key_block_size=8192;
1934
1710
Warning 1071 Specified key was too long; max key length is 1332 bytes
1935
1711
show create table t1;
1936
1712
Table Create Table
1937
1713
t1 CREATE TABLE `t1` (
1938
`a` int(11) NOT NULL,
1939
`b` varchar(2048) DEFAULT NULL,
1940
1716
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
1942
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8192
1718
) 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;
1720
create 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
1721
show create table t1;
1946
1722
Table Create Table
1947
1723
t1 CREATE TABLE `t1` (
1948
`a` int(11) NOT NULL,
1949
`b` int(11) DEFAULT NULL,
1950
1726
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
1951
1727
KEY `b` (`b`) KEY_BLOCK_SIZE=8192
1952
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=16384
1728
) ENGINE=MyISAM KEY_BLOCK_SIZE=16384
1954
create table t1 (a int not null, key `a` (a) key_block_size=512);
1730
create table t1 (a int not null, key `a` (a) key_block_size=512) ENGINE=MyISAM;
1955
1731
show create table t1;
1956
1732
Table Create Table
1957
1733
t1 CREATE TABLE `t1` (
1958
`a` int(11) NOT NULL,
1959
1735
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);
1738
create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000) ENGINE=MyISAM;
1964
1740
Warning 1071 Specified key was too long; max key length is 1332 bytes
1965
1741
show create table t1;
1966
1742
Table Create Table
1967
1743
t1 CREATE TABLE `t1` (
1968
`a` varchar(2048) DEFAULT NULL,
1969
KEY `a` (`a`(1332)) KEY_BLOCK_SIZE=6144
1970
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1745
KEY `a` (`a`()) KEY_BLOCK_SIZE=6144
1972
create table t1 (a int not null, key `a` (a) key_block_size=1025);
1748
create table t1 (a int not null, key `a` (a) key_block_size=1025) ENGINE=MyISAM;
1973
1749
show create table t1;
1974
1750
Table Create Table
1975
1751
t1 CREATE TABLE `t1` (
1976
`a` int(11) NOT NULL,
1977
1753
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
1756
create table t1 (a int not null, key key_block_size=1024 (a)) ENGINE=MyISAM;
1757
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
1758
create table t1 (a int not null, key `a` key_block_size=1024 (a)) ENGINE=MyISAM;
1759
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
1984
1760
CREATE TABLE t1 (
1986
1762
c2 VARCHAR(300),
1987
1763
KEY (c1) KEY_BLOCK_SIZE 1024,
1988
1764
KEY (c2) KEY_BLOCK_SIZE 8192
1990
1766
INSERT INTO t1 VALUES (10, REPEAT('a', CEIL(RAND(10) * 300))),
1991
1767
(11, REPEAT('b', CEIL(RAND() * 300))),
1992
1768
(12, REPEAT('c', CEIL(RAND() * 300))),