23
23
Table Op Msg_type Msg_text
24
24
test.t1 check status OK
26
create TEMPORARY table t1 (a int not null auto_increment, b int not null, primary key (a), index(b)) ENGINE=MYISAM;
26
create table t1 (a int not null auto_increment, b int not null, primary key (a), index(b));
27
27
insert into t1 (b) values (1),(2),(2),(2),(2);
28
alter table t1 engine=MYISAM;
30
Table Unique Key_name Seq_in_index Column_name
33
alter table t1 engine=MyISAM;
35
Table Unique Key_name Seq_in_index Column_name
29
Table Op Msg_type Msg_text
30
test.t1 optimize status OK
32
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
33
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
34
t1 1 b 1 b A 5 NULL NULL BTREE
36
Table Op Msg_type Msg_text
37
test.t1 optimize status OK
39
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
40
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
41
t1 1 b 1 b A 5 NULL NULL BTREE
39
43
create temporary table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=myisam;
40
44
insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
63
67
id select_type table type possible_keys key key_len ref rows Extra
64
68
1 SIMPLE t1 ALL NULL NULL NULL NULL 4
66
create temporary table t1 ( t1 char(255), key(t1(250))) ENGINE=MYISAM;
70
create table t1 ( t1 char(255), key(t1(250)));
72
Warning 1071 Specified key was too long; max key length is 767 bytes
67
73
insert t1 values ('137513751375137513751375137513751375137569516951695169516951695169516951695169');
68
74
insert t1 values ('178417841784178417841784178417841784178403420342034203420342034203420342034203');
69
75
insert t1 values ('213872387238723872387238723872387238723867376737673767376737673767376737673767');
93
99
insert t1 values ('70'), ('84'), ('60'), ('20'), ('76'), ('89'), ('49'), ('50'),
94
100
('88'), ('61'), ('42'), ('98'), ('39'), ('30'), ('25'), ('66'), ('61'), ('48'),
95
101
('80'), ('84'), ('98'), ('19'), ('91'), ('42'), ('47');
96
alter table t1 ENGINE=myisam;
103
Table Op Msg_type Msg_text
104
test.t1 optimize status OK
98
106
Table Op Msg_type Msg_text
99
107
test.t1 check status OK
306
314
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
307
315
create table t2 (a int not null, b int, c int, key(b), key(c), key(a));
308
316
INSERT into t2 values (1,1,1), (2,2,2);
309
alter table t1 ENGINE=MYISAM;
318
Table Op Msg_type Msg_text
319
test.t1 optimize note The storage engine for the table doesn't support optimize
310
320
show index from t1;
311
Table Unique Key_name Seq_in_index Column_name
321
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
322
t1 1 b 1 b A NULL NULL NULL YES BTREE
323
t1 1 c 1 c A NULL NULL NULL YES BTREE
324
t1 1 a 1 a A NULL NULL NULL BTREE
325
t1 1 a 2 b A NULL NULL NULL YES BTREE
326
t1 1 c_2 1 c A NULL NULL NULL YES BTREE
327
t1 1 c_2 2 a A NULL NULL NULL BTREE
318
328
explain select * from t1,t2 where t1.a=t2.a;
319
329
id select_type table type possible_keys key key_len ref rows Extra
320
330
1 SIMPLE t2 ALL a NULL NULL NULL 2
488
498
create table t2 (a int, b varchar(200), c text not null);
489
499
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
490
500
insert t2 select * from t1;
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
513
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
514
# test t1 STANDARD InnoDB # # # # #
515
# test t2 STANDARD InnoDB # # # # #
501
checksum table t1, t2, t3 quick;
507
Error 1146 Table 'test.t3' doesn't exist
508
checksum table t1, t2, t3;
514
Error 1146 Table 'test.t3' doesn't exist
515
checksum table t1, t2, t3 extended;
521
Error 1146 Table 'test.t3' doesn't exist
516
522
drop table t1,t2;
517
523
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
518
524
insert into t1 values (null,''), (null,'');
637
643
DELETE FROM t1 WHERE _id < 8;
638
show table status LIKE 't1';
639
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
640
# test t1 TEMPORARY MyISAM # # # # #
642
Table Op Msg_type Msg_text
643
test.t1 check status OK
644
ALTER TABLE t1 ENGINE=MYISAM;
646
Table Op Msg_type Msg_text
647
test.t1 check status OK
648
show table status LIKE 't1';
649
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
650
# test t1 TEMPORARY MyISAM # # # # #
644
SHOW TABLE STATUS LIKE 't1';
645
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
646
CHECK TABLE t1 EXTENDED;
647
Table Op Msg_type Msg_text
648
test.t1 check status OK
650
Table Op Msg_type Msg_text
651
test.t1 optimize note The storage engine for the table doesn't support optimize
652
CHECK TABLE t1 EXTENDED;
653
Table Op Msg_type Msg_text
654
test.t1 check status OK
655
SHOW TABLE STATUS LIKE 't1';
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
651
657
SELECT _id FROM t1;
658
664
Variable_name Value
659
665
myisam_repair_threads 1
660
666
CREATE TEMPORARY TABLE t1 (c1 TEXT) ENGINE=MyISAM;
661
show table status like 't1';
662
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
663
# test t1 TEMPORARY MyISAM # # # # #
667
SHOW TABLE STATUS LIKE 't1';
668
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
665
670
CREATE TEMPORARY TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM;
666
671
INSERT INTO t1 VALUES
1360
1365
`v` varchar(10) DEFAULT NULL
1361
1366
) ENGINE=MyISAM
1363
create TEMPORARY table t1 (v varchar(10), c char(10));
1368
create TEMPORARY table t1 (v varchar(10), c char(10)) row_format=fixed;
1364
1369
show create table t1;
1365
1370
Table Create Table
1366
1371
t1 CREATE TEMPORARY TABLE `t1` (
1367
1372
`v` varchar(10) DEFAULT NULL,
1368
1373
`c` varchar(10) DEFAULT NULL
1374
) ENGINE=MyISAM ROW_FORMAT=FIXED
1370
1375
insert into t1 values('a','a'),('a ','a ');
1371
1376
select concat('*',v,'*',c,'*') from t1;
1372
1377
concat('*',v,'*',c,'*')
1397
1402
Table Op Msg_type Msg_text
1398
1403
test.t1 analyze status OK
1399
1404
show keys from t1;
1400
Table Unique Key_name Seq_in_index Column_name
1405
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
1406
t1 1 a 1 a A 8 NULL NULL YES BTREE
1402
1407
alter table t1 disable keys;
1404
1409
Note 1031 Table storage engine for 't1' doesn't have this option
1407
1412
Note 1031 Table storage engine for 't1' doesn't have this option
1408
1413
show keys from t1;
1409
Table Unique Key_name Seq_in_index Column_name
1414
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
1415
t1 1 a 1 a A 8 NULL NULL YES BTREE
1412
1417
CREATE TEMPORARY TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
1413
1418
INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5);
1438
1443
CREATE TEMPORARY TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
1439
show table status like 't1';
1440
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
1441
# test t1 TEMPORARY MyISAM # # # # #
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
1442
1446
INSERT INTO t1 VALUES (1,1);
1443
show table status like 't1';
1444
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
1445
# test t1 TEMPORARY MyISAM # # # # #
1446
ALTER TABLE t1 DISABLE KEYS;
1447
show table status like 't1';
1448
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
1449
# test t1 TEMPORARY MyISAM # # # # #
1450
ALTER TABLE t1 ENABLE KEYS;
1451
show table status like 't1';
1452
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
1453
# test t1 TEMPORARY MyISAM # # # # #
1454
ALTER TABLE t1 DISABLE KEYS;
1455
show table status like 't1';
1456
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
1457
# test t1 TEMPORARY MyISAM # # # # #
1458
ALTER TABLE t1 ENABLE KEYS;
1459
show table status like 't1';
1460
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
1461
# test t1 TEMPORARY MyISAM # # # # #
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
1449
ALTER TABLE t1 DISABLE KEYS;
1450
SHOW TABLE STATUS LIKE 't1';
1451
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
1452
ALTER TABLE t1 ENABLE KEYS;
1453
SHOW TABLE STATUS LIKE 't1';
1454
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
1455
ALTER TABLE t1 DISABLE KEYS;
1456
SHOW TABLE STATUS LIKE 't1';
1457
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
1458
ALTER TABLE t1 ENABLE KEYS;
1459
SHOW TABLE STATUS LIKE 't1';
1460
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
1462
1461
# Enable keys with parallel repair
1463
1462
SET GLOBAL myisam_repair_threads=2;
1464
1463
ALTER TABLE t1 DISABLE KEYS;
1465
1464
ALTER TABLE t1 ENABLE KEYS;
1466
1465
SET GLOBAL myisam_repair_threads=1;
1466
CHECK TABLE t1 EXTENDED;
1468
1467
Table Op Msg_type Msg_text
1469
1468
test.t1 check status OK
1745
1746
CHECK TABLE t1;
1746
1747
Table Op Msg_type Msg_text
1747
1748
test.t1 check status OK
1749
Table Op Msg_type Msg_text
1750
test.t1 check status OK
1752
CREATE temporary TABLE t1 (
1756
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
1757
SELECT COUNT(*) FROM t1;
1761
Table Op Msg_type Msg_text
1762
test.t1 check status OK
1763
SELECT COUNT(*) FROM t1;
1767
Table Op Msg_type Msg_text
1768
test.t1 check status OK
1770
CREATE temporary TABLE t1 (
1774
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
1775
SELECT COUNT(*) FROM t1;
1779
Table Op Msg_type Msg_text
1780
test.t1 check status OK
1781
SELECT COUNT(*) FROM t1;
1749
CHECK TABLE t1 EXTENDED;
1750
Table Op Msg_type Msg_text
1751
test.t1 check status OK
1753
CREATE temporary TABLE t1 (
1757
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
1758
SELECT COUNT(*) FROM t1;
1762
Table Op Msg_type Msg_text
1763
test.t1 check status OK
1764
SELECT COUNT(*) FROM t1;
1768
Table Op Msg_type Msg_text
1769
test.t1 check status OK
1771
CREATE temporary TABLE t1 (
1775
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
1776
SELECT COUNT(*) FROM t1;
1779
CHECK TABLE t1 EXTENDED;
1780
Table Op Msg_type Msg_text
1781
test.t1 check status OK
1782
SELECT COUNT(*) FROM t1;
1785
CHECK TABLE t1 EXTENDED;
1785
1786
Table Op Msg_type Msg_text
1786
1787
test.t1 check status OK