~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/myisam.result

  • Committer: Brian Aker
  • Date: 2009-07-12 00:49:18 UTC
  • mfrom: (1063.9.51 brian-tmp-fix)
  • Revision ID: brian@gaz-20090712004918-chprmyj387ex6l8a
Merge Stewart

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
drop table if exists t1,t2;
2
2
SET SQL_WARNINGS=1;
3
 
CREATE TABLE t1 (
 
3
CREATE TEMPORARY TABLE t1 (
4
4
STRING_DATA char(255) default NULL,
5
5
KEY string_data (STRING_DATA)
6
6
) ENGINE=MyISAM;
40
40
t1      0       PRIMARY 1       a       A       5       NULL    NULL            BTREE           
41
41
t1      1       b       1       b       A       5       NULL    NULL            BTREE           
42
42
drop table t1;
43
 
create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=myisam;
 
43
create temporary table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=myisam;
44
44
insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
45
45
explain select * from t1 order by a;
46
46
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
106
106
Table   Op      Msg_type        Msg_text
107
107
test.t1 check   status  OK
108
108
drop table t1;
109
 
create table t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
 
109
create temporary table t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
110
110
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
111
111
int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
112
112
i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34
282
282
Table   Op      Msg_type        Msg_text
283
283
test.t1 check   status  OK
284
284
drop table t1;
285
 
CREATE TABLE `t1` (
 
285
CREATE TEMPORARY TABLE `t1` (
286
286
`post_id` int NOT NULL auto_increment,
287
287
`topic_id` int NOT NULL default '0',
288
288
`post_time` datetime,
304
304
Table   Op      Msg_type        Msg_text
305
305
test.t1 check   status  OK
306
306
drop table t1;
307
 
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;
 
307
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;
308
308
ERROR 42000: Specified key was too long; max key length is 1332 bytes
309
 
CREATE TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300)) ENGINE=MyISAM;
 
309
CREATE TEMPORARY TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300)) ENGINE=MyISAM;
310
310
ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
311
311
ERROR 42000: Specified key was too long; max key length is 1332 bytes
312
312
DROP TABLE t1;
313
 
CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a)) ENGINE=MyISAM;
 
313
CREATE TEMPORARY TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a)) ENGINE=MyISAM;
314
314
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
315
315
create table t2 (a int not null, b int, c int, key(b), key(c), key(a));
316
316
INSERT into t2 values (1,1,1), (2,2,2);
380
380
Table   Op      Msg_type        Msg_text
381
381
test.t1 check   status  OK
382
382
drop table t1;
383
 
create table t1 ( a text not null, key a (a(20)));
 
383
create temporary table t1 ( a text not null, key a (a(20))) engine=myisam;
384
384
insert into t1 values ('aaa   '),('aaa'),('aa');
385
385
check table t1;
386
386
Table   Op      Msg_type        Msg_text
399
399
bbb.
400
400
aa.
401
401
drop table t1;
402
 
create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10)));
 
402
create temporary table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10))) engine=myisam;
403
403
insert into t1 values('807780', '477', '165');
404
404
insert into t1 values('807780', '477', '162');
405
405
insert into t1 values('807780', '472', '162');
410
410
DROP TABLE IF EXISTS t1;
411
411
Warnings:
412
412
Note    1051    Unknown table 't1'
413
 
CREATE TABLE t1 (a varchar(150) NOT NULL, KEY (a)) ENGINE=MyISAM;
 
413
CREATE TEMPORARY TABLE t1 (a varchar(150) NOT NULL, KEY (a)) ENGINE=MyISAM;
414
414
INSERT t1 VALUES ("can \tcan");
415
415
INSERT t1 VALUES ("can   can");
416
416
INSERT t1 VALUES ("can");
484
484
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    1       Using temporary; Using filesort
485
485
1       SIMPLE  t2      index   NULL    PRIMARY 4       NULL    2       Using index; Distinct; Using join buffer
486
486
drop table t1,t2;
487
 
create table t1 (
 
487
create temporary table t1 (
488
488
c1 varchar(32),
489
489
key (c1)
490
490
) engine=myisam;
567
567
cip     score   bob
568
568
1       0       NULL
569
569
drop table t1;
570
 
create table t1 (
 
570
create temporary table t1 (
571
571
id1 int not null auto_increment,
572
572
id2 int not null default '0',
573
573
t text not null,
585
585
count(id1)
586
586
5
587
587
drop table t1;
588
 
CREATE TABLE t1(a int, KEY(a)) ENGINE=MyISAM;
 
588
CREATE TEMPORARY TABLE t1(a int, KEY(a)) ENGINE=MyISAM;
589
589
INSERT INTO t1 VALUES(1);
590
590
SELECT MAX(a) FROM t1 IGNORE INDEX(a);
591
591
MAX(a)
598
598
MAX(a)
599
599
1
600
600
DROP TABLE t1;
601
 
CREATE TABLE t1(a CHAR(9), b VARCHAR(7)) ENGINE=MyISAM;
 
601
CREATE TABLE t1(a CHAR(9), b VARCHAR(7));
602
602
INSERT INTO t1(a) VALUES('xxxxxxxxx'),('xxxxxxxxx');
603
603
UPDATE t1 AS ta1,t1 AS ta2 SET ta1.b='aaaaaa',ta2.b='bbbbbb';
604
604
SELECT * FROM t1;
610
610
SHOW VARIABLES LIKE 'myisam_repair%';
611
611
Variable_name   Value
612
612
myisam_repair_threads   2
613
 
CREATE TABLE t1 (
 
613
CREATE TEMPORARY TABLE t1 (
614
614
`_id` int NOT NULL default '0',
615
615
`url` text,
616
616
`email` text,
651
651
DELETE FROM t1 WHERE _id < 8;
652
652
SHOW TABLE STATUS LIKE 't1';
653
653
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
654
 
t1      MyISAM  0       Dynamic 2       #       #       #       #       168     #       #       #       #       #       #               
655
654
CHECK TABLE t1 EXTENDED;
656
655
Table   Op      Msg_type        Msg_text
657
656
test.t1 check   status  OK
663
662
test.t1 check   status  OK
664
663
SHOW TABLE STATUS LIKE 't1';
665
664
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
666
 
t1      MyISAM  0       Dynamic 2       #       #       #       #       0       #       #       #       #       #       #               
667
665
SELECT _id FROM t1;
668
666
_id
669
667
8
673
671
SHOW VARIABLES LIKE 'myisam_repair%';
674
672
Variable_name   Value
675
673
myisam_repair_threads   1
676
 
CREATE TABLE t1(a VARCHAR(16)) ENGINE=MyISAM;
 
674
CREATE TABLE t1(a VARCHAR(16));
677
675
INSERT INTO t1 VALUES('aaaaaaaa'),(NULL);
678
676
UPDATE t1 AS ta1, t1 AS ta2 SET ta1.a='aaaaaaaaaaaaaaaa';
679
677
SELECT * FROM t1;
681
679
aaaaaaaaaaaaaaaa
682
680
aaaaaaaaaaaaaaaa
683
681
DROP TABLE t1;
684
 
CREATE TABLE t1(a INT) ENGINE=MyISAM;
 
682
CREATE TABLE t1(a INT);
685
683
INSERT INTO t1 VALUES(1),(2);
686
684
UPDATE t1,t1 AS t2 SET t1.a=t1.a+2 WHERE t1.a=t2.a-1;
687
685
SELECT * FROM t1 ORDER BY a;
689
687
2
690
688
3
691
689
DROP TABLE t1;
692
 
CREATE TABLE t1 (c1 TEXT) ENGINE=MyISAM AVG_ROW_LENGTH=70100 MAX_ROWS=4100100100;
 
690
CREATE TEMPORARY TABLE t1 (c1 TEXT) ENGINE=MyISAM AVG_ROW_LENGTH=70100 MAX_ROWS=4100100100;
693
691
SHOW TABLE STATUS LIKE 't1';
694
692
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
695
 
t1      MyISAM  0       Dynamic X       X       X       72057594037927935       X       X       X       X       X       X       utf8_general_ci X       max_rows=4100100100 avg_row_length=70100        
696
693
DROP TABLE t1;
697
 
CREATE TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM;
 
694
CREATE TEMPORARY TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM;
698
695
INSERT INTO t1 VALUES
699
696
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
700
697
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
849
846
drop table if exists t1,t2,t3;
850
847
--- Testing varchar ---
851
848
--- Testing varchar ---
852
 
create table t1 (v varchar(10), c char(10), t text);
 
849
create TEMPORARY table t1 (v varchar(10), c char(10), t text);
853
850
insert into t1 values('+ ', '+ ', '+ ');
854
851
set @a=repeat(' ',20);
855
852
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
862
859
*+         *+         *+                    *
863
860
show create table t1;
864
861
Table   Create Table
865
 
t1      CREATE TABLE `t1` (
 
862
t1      CREATE TEMPORARY TABLE `t1` (
866
863
  `v` varchar(10) DEFAULT NULL,
867
864
  `c` varchar(10) DEFAULT NULL,
868
865
  `t` text
869
866
) ENGINE=MyISAM
870
 
create table t2 like t1;
 
867
create TEMPORARY table t2 like t1;
871
868
show create table t2;
872
869
Table   Create Table
873
 
t2      CREATE TABLE `t2` (
 
870
t2      CREATE TEMPORARY TABLE `t2` (
874
871
  `v` varchar(10) DEFAULT NULL,
875
872
  `c` varchar(10) DEFAULT NULL,
876
873
  `t` text
877
874
) ENGINE=MyISAM
878
 
create table t3 select * from t1;
 
875
create TEMPORARY table t3 select * from t1;
879
876
show create table t3;
880
877
Table   Create Table
881
 
t3      CREATE TABLE `t3` (
 
878
t3      CREATE TEMPORARY TABLE `t3` (
882
879
  `v` varchar(10) DEFAULT NULL,
883
880
  `c` varchar(10) DEFAULT NULL,
884
881
  `t` text
886
883
alter table t1 modify c varchar(10);
887
884
show create table t1;
888
885
Table   Create Table
889
 
t1      CREATE TABLE `t1` (
 
886
t1      CREATE TEMPORARY TABLE `t1` (
890
887
  `v` varchar(10) DEFAULT NULL,
891
888
  `c` varchar(10) DEFAULT NULL,
892
889
  `t` text
894
891
alter table t1 modify v char(10);
895
892
show create table t1;
896
893
Table   Create Table
897
 
t1      CREATE TABLE `t1` (
 
894
t1      CREATE TEMPORARY TABLE `t1` (
898
895
  `v` varchar(10) DEFAULT NULL,
899
896
  `c` varchar(10) DEFAULT NULL,
900
897
  `t` text
904
901
Note    1265    Data truncated for column 't' at row 2
905
902
show create table t1;
906
903
Table   Create Table
907
 
t1      CREATE TABLE `t1` (
 
904
t1      CREATE TEMPORARY TABLE `t1` (
908
905
  `v` varchar(10) DEFAULT NULL,
909
906
  `c` varchar(10) DEFAULT NULL,
910
907
  `t` varchar(10) DEFAULT NULL
914
911
*+ *+ *+ *
915
912
*+         *+         *+         *
916
913
drop table t1,t2,t3;
917
 
create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
 
914
create TEMPORARY table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
918
915
show create table t1;
919
916
Table   Create Table
920
 
t1      CREATE TABLE `t1` (
 
917
t1      CREATE TEMPORARY TABLE `t1` (
921
918
  `v` varchar(10) DEFAULT NULL,
922
919
  `c` varchar(10) DEFAULT NULL,
923
920
  `t` text,
1136
1133
alter table t1 modify v varchar(300), drop key v, drop key v_2, add key v (v);
1137
1134
show create table t1;
1138
1135
Table   Create Table
1139
 
t1      CREATE TABLE `t1` (
 
1136
t1      CREATE TEMPORARY TABLE `t1` (
1140
1137
  `v` varchar(300) DEFAULT NULL,
1141
1138
  `c` varchar(10) DEFAULT NULL,
1142
1139
  `t` text,
1216
1213
alter table t1 drop key v, add key v (v(30));
1217
1214
show create table t1;
1218
1215
Table   Create Table
1219
 
t1      CREATE TABLE `t1` (
 
1216
t1      CREATE TEMPORARY TABLE `t1` (
1220
1217
  `v` varchar(300) DEFAULT NULL,
1221
1218
  `c` varchar(10) DEFAULT NULL,
1222
1219
  `t` text,
1298
1295
Warning 1071    Specified key was too long; max key length is 1332 bytes
1299
1296
show create table t1;
1300
1297
Table   Create Table
1301
 
t1      CREATE TABLE `t1` (
 
1298
t1      CREATE TEMPORARY TABLE `t1` (
1302
1299
  `v` varchar(600) DEFAULT NULL,
1303
1300
  `c` varchar(10) DEFAULT NULL,
1304
1301
  `t` text,
1343
1340
h       10
1344
1341
i       10
1345
1342
drop table t1;
1346
 
create table t1 (a char(10), unique (a));
 
1343
create TEMPORARY table t1 (a char(10), unique (a));
1347
1344
insert into t1 values ('a   ');
1348
1345
insert into t1 values ('a ');
1349
1346
ERROR 23000: Duplicate entry 'a ' for key 'a'
1373
1370
concat(a,'.')
1374
1371
a  .
1375
1372
drop table t1;
1376
 
create table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
 
1373
create TEMPORARY table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
1377
1374
show create table t1;
1378
1375
Table   Create Table
1379
 
t1      CREATE TABLE `t1` (
 
1376
t1      CREATE TEMPORARY TABLE `t1` (
1380
1377
  `v` varchar(10) DEFAULT NULL,
1381
1378
  `c` varchar(10) DEFAULT NULL,
1382
1379
  `t` text,
1385
1382
  KEY `t` (`t`(5))
1386
1383
) ENGINE=MyISAM
1387
1384
drop table t1;
1388
 
create table t1 (v char(10));
 
1385
create TEMPORARY table t1 (v char(10));
1389
1386
show create table t1;
1390
1387
Table   Create Table
1391
 
t1      CREATE TABLE `t1` (
 
1388
t1      CREATE TEMPORARY TABLE `t1` (
1392
1389
  `v` varchar(10) DEFAULT NULL
1393
1390
) ENGINE=MyISAM
1394
1391
drop table t1;
1395
 
create table t1 (v varchar(10), c char(10)) row_format=fixed;
 
1392
create TEMPORARY table t1 (v varchar(10), c char(10)) row_format=fixed;
1396
1393
show create table t1;
1397
1394
Table   Create Table
1398
 
t1      CREATE TABLE `t1` (
 
1395
t1      CREATE TEMPORARY TABLE `t1` (
1399
1396
  `v` varchar(10) DEFAULT NULL,
1400
1397
  `c` varchar(10) DEFAULT NULL
1401
1398
) ENGINE=MyISAM ROW_FORMAT=FIXED
1405
1402
*a*a*
1406
1403
*a *a *
1407
1404
drop table t1;
1408
 
create table t1(a int, b varchar(12), key ba(b, a));
 
1405
create TEMPORARY table t1(a int, b varchar(12), key ba(b, a));
1409
1406
insert into t1 values (1, 'A'), (20, NULL);
1410
1407
explain select * from t1 where a=20 and b is null;
1411
1408
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1414
1411
a       b
1415
1412
20      NULL
1416
1413
drop table t1;
1417
 
create table t1 (v varchar(65530), key(v));
1418
 
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1419
 
create table t1 (v varchar(65536));
1420
 
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1421
 
create table t1 (v varchar(65530));
1422
 
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1423
 
create table t1 (v varchar(65535));
 
1414
create temporary table t1 (v varchar(65530), key(v));
 
1415
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
 
1416
create temporary table t1 (v varchar(65536));
 
1417
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
 
1418
create temporary table t1 (v varchar(65530));
 
1419
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
 
1420
create temporary table t1 (v varchar(65535));
1424
1421
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1425
1422
set storage_engine=InnoDB;
1426
1423
create table t1 (a int, key(a));
1441
1438
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
1442
1439
t1      1       a       1       a       A       8       NULL    NULL    YES     BTREE           
1443
1440
drop table t1;
1444
 
create table t1 (c1 int) engine=myisam pack_keys=0;
1445
 
create table t2 (c1 int) engine=myisam pack_keys=1;
1446
 
create table t3 (c1 int) engine=myisam pack_keys=default;
1447
 
create table t4 (c1 int) engine=myisam pack_keys=2;
 
1441
create temporary table t1 (c1 int) engine=myisam pack_keys=0;
 
1442
create temporary table t2 (c1 int) engine=myisam pack_keys=1;
 
1443
create temporary table t3 (c1 int) engine=myisam pack_keys=default;
 
1444
create temporary table t4 (c1 int) engine=myisam pack_keys=2;
1448
1445
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 '2' at line 1
1449
1446
drop table t1, t2, t3;
1450
 
CREATE TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
 
1447
CREATE TEMPORARY TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
1451
1448
INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5);
1452
1449
SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
1453
1450
a
1473
1470
a
1474
1471
1
1475
1472
DROP TABLE t1;
1476
 
CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
 
1473
CREATE TEMPORARY TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
1477
1474
SHOW TABLE STATUS LIKE 't1';
1478
1475
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
1479
 
t1      MyISAM  0       Fixed   0       #       #       #       1024    #       #       #       #       #       #       #               
1480
1476
INSERT INTO t1 VALUES (1,1);
1481
1477
SHOW TABLE STATUS LIKE 't1';
1482
1478
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
1483
 
t1      MyISAM  0       Fixed   1       #       #       #       3072    #       #       #       #       #       #       #               
1484
 
ALTER TABLE t1 DISABLE KEYS;
1485
 
SHOW TABLE STATUS LIKE 't1';
1486
 
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
1487
 
t1      MyISAM  0       Fixed   1       #       #       #       3072    #       #       #       #       #       #       #               
1488
 
ALTER TABLE t1 ENABLE KEYS;
1489
 
SHOW TABLE STATUS LIKE 't1';
1490
 
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
1491
 
t1      MyISAM  0       Fixed   1       #       #       #       3072    #       #       #       #       #       #       #               
1492
 
ALTER TABLE t1 DISABLE KEYS;
1493
 
SHOW TABLE STATUS LIKE 't1';
1494
 
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
1495
 
t1      MyISAM  0       Fixed   1       #       #       #       3072    #       #       #       #       #       #       #               
1496
 
ALTER TABLE t1 ENABLE KEYS;
1497
 
SHOW TABLE STATUS LIKE 't1';
1498
 
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
1499
 
t1      MyISAM  0       Fixed   1       #       #       #       3072    #       #       #       #       #       #       #               
 
1479
ALTER TABLE t1 DISABLE KEYS;
 
1480
SHOW TABLE STATUS LIKE 't1';
 
1481
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
 
1482
ALTER TABLE t1 ENABLE KEYS;
 
1483
SHOW TABLE STATUS LIKE 't1';
 
1484
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
 
1485
ALTER TABLE t1 DISABLE KEYS;
 
1486
SHOW TABLE STATUS LIKE 't1';
 
1487
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
 
1488
ALTER TABLE t1 ENABLE KEYS;
 
1489
SHOW TABLE STATUS LIKE 't1';
 
1490
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
1500
1491
# Enable keys with parallel repair
1501
1492
SET GLOBAL myisam_repair_threads=2;
1502
1493
ALTER TABLE t1 DISABLE KEYS;
1506
1497
Table   Op      Msg_type        Msg_text
1507
1498
test.t1 check   status  OK
1508
1499
DROP TABLE t1;
1509
 
CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id)) ENGINE=MyISAM;
 
1500
CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id));
1510
1501
CREATE TABLE t2 LIKE t1;
1511
1502
INSERT INTO t2 (id, ref) VALUES (1,3), (2,1), (3,2), (4,5), (4,4);
1512
1503
INSERT INTO t1 SELECT * FROM t2;
1529
1520
4       5
1530
1521
DROP TABLE t1, t2;
1531
1522
End of 5.0 tests
1532
 
create table t1 (a int not null, key `a` (a) key_block_size=1024) ENGINE=MyISAM;
 
1523
create temporary table t1 (a int not null, key `a` (a) key_block_size=1024) ENGINE=MyISAM;
1533
1524
show create table t1;
1534
1525
Table   Create Table
1535
 
t1      CREATE TABLE `t1` (
 
1526
t1      CREATE TEMPORARY TABLE `t1` (
1536
1527
  `a` int NOT NULL,
1537
1528
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024
1538
1529
) ENGINE=MyISAM
1539
1530
drop table t1;
1540
 
create table t1 (a int not null, key `a` (a) key_block_size=2048) ENGINE=MyISAM;
 
1531
create temporary table t1 (a int not null, key `a` (a) key_block_size=2048) ENGINE=MyISAM;
1541
1532
show create table t1;
1542
1533
Table   Create Table
1543
 
t1      CREATE TABLE `t1` (
 
1534
t1      CREATE TEMPORARY TABLE `t1` (
1544
1535
  `a` int NOT NULL,
1545
1536
  KEY `a` (`a`) KEY_BLOCK_SIZE=2048
1546
1537
) ENGINE=MyISAM
1547
1538
drop table t1;
1548
 
create table t1 (a varchar(2048), key `a` (a)) ENGINE=MyISAM;
 
1539
create temporary table t1 (a varchar(2048), key `a` (a)) ENGINE=MyISAM;
1549
1540
Warnings:
1550
1541
Warning 1071    Specified key was too long; max key length is 1332 bytes
1551
1542
show create table t1;
1552
1543
Table   Create Table
1553
 
t1      CREATE TABLE `t1` (
 
1544
t1      CREATE TEMPORARY TABLE `t1` (
1554
1545
  `a` varchar(2048) DEFAULT NULL,
1555
1546
  KEY `a` (`a`(333))
1556
1547
) ENGINE=MyISAM
1557
1548
drop table t1;
1558
 
create table t1 (a varchar(2048), key `a` (a) key_block_size=1024) ENGINE=MyISAM;
 
1549
create temporary table t1 (a varchar(2048), key `a` (a) key_block_size=1024) ENGINE=MyISAM;
1559
1550
Warnings:
1560
1551
Warning 1071    Specified key was too long; max key length is 1332 bytes
1561
1552
show create table t1;
1562
1553
Table   Create Table
1563
 
t1      CREATE TABLE `t1` (
 
1554
t1      CREATE TEMPORARY TABLE `t1` (
1564
1555
  `a` varchar(2048) DEFAULT NULL,
1565
1556
  KEY `a` (`a`(333)) KEY_BLOCK_SIZE=6144
1566
1557
) ENGINE=MyISAM
1567
1558
drop table t1;
1568
 
create table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=1024;
 
1559
create temporary table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=1024;
1569
1560
Warnings:
1570
1561
Warning 1071    Specified key was too long; max key length is 1332 bytes
1571
1562
show create table t1;
1572
1563
Table   Create Table
1573
 
t1      CREATE TABLE `t1` (
 
1564
t1      CREATE TEMPORARY TABLE `t1` (
1574
1565
  `a` int NOT NULL,
1575
1566
  `b` varchar(2048) DEFAULT NULL,
1576
1567
  KEY `a` (`a`),
1579
1570
alter table t1 key_block_size=2048;
1580
1571
show create table t1;
1581
1572
Table   Create Table
1582
 
t1      CREATE TABLE `t1` (
 
1573
t1      CREATE TEMPORARY TABLE `t1` (
1583
1574
  `a` int NOT NULL,
1584
1575
  `b` varchar(2048) DEFAULT NULL,
1585
1576
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
1588
1579
alter table t1 add c int, add key (c);
1589
1580
show create table t1;
1590
1581
Table   Create Table
1591
 
t1      CREATE TABLE `t1` (
 
1582
t1      CREATE TEMPORARY TABLE `t1` (
1592
1583
  `a` int NOT NULL,
1593
1584
  `b` varchar(2048) DEFAULT NULL,
1594
1585
  `c` int DEFAULT NULL,
1600
1591
alter table t1 add d int, add key (d);
1601
1592
show create table t1;
1602
1593
Table   Create Table
1603
 
t1      CREATE TABLE `t1` (
 
1594
t1      CREATE TEMPORARY TABLE `t1` (
1604
1595
  `a` int NOT NULL,
1605
1596
  `b` varchar(2048) DEFAULT NULL,
1606
1597
  `c` int DEFAULT NULL,
1611
1602
  KEY `d` (`d`)
1612
1603
) ENGINE=MyISAM
1613
1604
drop table t1;
1614
 
create table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=8192;
 
1605
create temporary table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=8192;
1615
1606
Warnings:
1616
1607
Warning 1071    Specified key was too long; max key length is 1332 bytes
1617
1608
show create table t1;
1618
1609
Table   Create Table
1619
 
t1      CREATE TABLE `t1` (
 
1610
t1      CREATE TEMPORARY TABLE `t1` (
1620
1611
  `a` int NOT NULL,
1621
1612
  `b` varchar(2048) DEFAULT NULL,
1622
1613
  KEY `a` (`a`),
1623
1614
  KEY `b` (`b`(333))
1624
1615
) ENGINE=MyISAM KEY_BLOCK_SIZE=8192
1625
1616
drop table t1;
1626
 
create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) ENGINE=MyISAM key_block_size=8192;
 
1617
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;
1627
1618
Warnings:
1628
1619
Warning 1071    Specified key was too long; max key length is 1332 bytes
1629
1620
show create table t1;
1630
1621
Table   Create Table
1631
 
t1      CREATE TABLE `t1` (
 
1622
t1      CREATE TEMPORARY TABLE `t1` (
1632
1623
  `a` int NOT NULL,
1633
1624
  `b` varchar(2048) DEFAULT NULL,
1634
1625
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
1635
1626
  KEY `b` (`b`(333))
1636
1627
) ENGINE=MyISAM KEY_BLOCK_SIZE=8192
1637
1628
drop table t1;
1638
 
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;
 
1629
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;
1639
1630
show create table t1;
1640
1631
Table   Create Table
1641
 
t1      CREATE TABLE `t1` (
 
1632
t1      CREATE TEMPORARY TABLE `t1` (
1642
1633
  `a` int NOT NULL,
1643
1634
  `b` int DEFAULT NULL,
1644
1635
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
1645
1636
  KEY `b` (`b`) KEY_BLOCK_SIZE=8192
1646
1637
) ENGINE=MyISAM KEY_BLOCK_SIZE=16384
1647
1638
drop table t1;
1648
 
create table t1 (a int not null, key `a` (a) key_block_size=512) ENGINE=MyISAM;
 
1639
create temporary table t1 (a int not null, key `a` (a) key_block_size=512) ENGINE=MyISAM;
1649
1640
show create table t1;
1650
1641
Table   Create Table
1651
 
t1      CREATE TABLE `t1` (
 
1642
t1      CREATE TEMPORARY TABLE `t1` (
1652
1643
  `a` int NOT NULL,
1653
1644
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024
1654
1645
) ENGINE=MyISAM
1655
1646
drop table t1;
1656
 
create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000) ENGINE=MyISAM;
 
1647
create temporary table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000) ENGINE=MyISAM;
1657
1648
Warnings:
1658
1649
Warning 1071    Specified key was too long; max key length is 1332 bytes
1659
1650
show create table t1;
1660
1651
Table   Create Table
1661
 
t1      CREATE TABLE `t1` (
 
1652
t1      CREATE TEMPORARY TABLE `t1` (
1662
1653
  `a` varchar(2048) DEFAULT NULL,
1663
1654
  KEY `a` (`a`(333)) KEY_BLOCK_SIZE=6144
1664
1655
) ENGINE=MyISAM
1665
1656
drop table t1;
1666
 
create table t1 (a int not null, key `a` (a) key_block_size=1025) ENGINE=MyISAM;
 
1657
create temporary table t1 (a int not null, key `a` (a) key_block_size=1025) ENGINE=MyISAM;
1667
1658
show create table t1;
1668
1659
Table   Create Table
1669
 
t1      CREATE TABLE `t1` (
 
1660
t1      CREATE TEMPORARY TABLE `t1` (
1670
1661
  `a` int NOT NULL,
1671
1662
  KEY `a` (`a`) KEY_BLOCK_SIZE=2048
1672
1663
) ENGINE=MyISAM
1673
1664
drop table t1;
1674
 
create table t1 (a int not null, key key_block_size=1024 (a)) ENGINE=MyISAM;
 
1665
create temporary table t1 (a int not null, key key_block_size=1024 (a)) ENGINE=MyISAM;
1675
1666
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
1676
 
create table t1 (a int not null, key `a` key_block_size=1024 (a)) ENGINE=MyISAM;
 
1667
create temporary table t1 (a int not null, key `a` key_block_size=1024 (a)) ENGINE=MyISAM;
1677
1668
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
1678
 
CREATE TABLE t1 (
 
1669
CREATE temporary TABLE t1 (
1679
1670
c1 INT,
1680
1671
c2 VARCHAR(300),
1681
1672
KEY (c1) KEY_BLOCK_SIZE 1024,
1707
1698
(33, REPEAT('x', CEIL(RAND() * 300))),
1708
1699
(34, REPEAT('y', CEIL(RAND() * 300))),
1709
1700
(35, REPEAT('z', CEIL(RAND() * 300)));
1710
 
INSERT INTO t1 SELECT * FROM t1;
1711
 
INSERT INTO t1 SELECT * FROM t1;
 
1701
CREATE TEMPORARY TABLE t2 AS SELECT * FROM t1;
 
1702
INSERT INTO t1 SELECT * FROM t2;
 
1703
DROP TABLE t2;
 
1704
CREATE TEMPORARY TABLE t2 AS SELECT * FROM t1;
 
1705
INSERT INTO t1 SELECT * FROM t2;
 
1706
DROP TABLE t2;
1712
1707
CHECK TABLE t1;
1713
1708
Table   Op      Msg_type        Msg_text
1714
1709
test.t1 check   status  OK
1717
1712
Table   Op      Msg_type        Msg_text
1718
1713
test.t1 check   status  OK
1719
1714
DROP TABLE t1;
1720
 
CREATE TABLE t1 (
1721
 
c1 CHAR(130),
1722
 
c2 VARCHAR(1)
1723
 
) ENGINE=MyISAM;
1724
 
INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
1725
 
SELECT COUNT(*) FROM t1;
1726
 
COUNT(*)
1727
 
1
1728
 
CHECK TABLE t1;
1729
 
Table   Op      Msg_type        Msg_text
1730
 
test.t1 check   status  OK
1731
 
SELECT COUNT(*) FROM t1;
1732
 
COUNT(*)
1733
 
1
1734
 
CHECK TABLE t1;
1735
 
Table   Op      Msg_type        Msg_text
1736
 
test.t1 check   status  OK
1737
 
DROP TABLE t1;
1738
 
CREATE TABLE t1 (
1739
 
c1 CHAR(130),
1740
 
c2 VARCHAR(1)
1741
 
) ENGINE=MyISAM;
1742
 
INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
1743
 
SELECT COUNT(*) FROM t1;
1744
 
COUNT(*)
1745
 
1
1746
 
CHECK TABLE t1 EXTENDED;
1747
 
Table   Op      Msg_type        Msg_text
1748
 
test.t1 check   status  OK
1749
 
SELECT COUNT(*) FROM t1;
1750
 
COUNT(*)
1751
 
1
1752
 
CHECK TABLE t1 EXTENDED;
1753
 
Table   Op      Msg_type        Msg_text
1754
 
test.t1 check   status  OK
1755
 
DROP TABLE t1;
1756
 
CREATE TABLE t1 (
 
1715
CREATE temporary TABLE t1 (
 
1716
c1 CHAR(130),
 
1717
c2 VARCHAR(1)
 
1718
) ENGINE=MyISAM;
 
1719
INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
 
1720
SELECT COUNT(*) FROM t1;
 
1721
COUNT(*)
 
1722
1
 
1723
CHECK TABLE t1;
 
1724
Table   Op      Msg_type        Msg_text
 
1725
test.t1 check   status  OK
 
1726
SELECT COUNT(*) FROM t1;
 
1727
COUNT(*)
 
1728
1
 
1729
CHECK TABLE t1;
 
1730
Table   Op      Msg_type        Msg_text
 
1731
test.t1 check   status  OK
 
1732
DROP TABLE t1;
 
1733
CREATE temporary TABLE t1 (
 
1734
c1 CHAR(130),
 
1735
c2 VARCHAR(1)
 
1736
) ENGINE=MyISAM;
 
1737
INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
 
1738
SELECT COUNT(*) FROM t1;
 
1739
COUNT(*)
 
1740
1
 
1741
CHECK TABLE t1 EXTENDED;
 
1742
Table   Op      Msg_type        Msg_text
 
1743
test.t1 check   status  OK
 
1744
SELECT COUNT(*) FROM t1;
 
1745
COUNT(*)
 
1746
1
 
1747
CHECK TABLE t1 EXTENDED;
 
1748
Table   Op      Msg_type        Msg_text
 
1749
test.t1 check   status  OK
 
1750
DROP TABLE t1;
 
1751
CREATE temporary TABLE t1 (
1757
1752
c1 CHAR(130),
1758
1753
c2 VARCHAR(1)
1759
1754
) ENGINE=MyISAM;
1771
1766
COUNT(*)
1772
1767
2
1773
1768
DROP TABLE t1;
1774
 
CREATE TABLE t1 (
 
1769
CREATE temporary TABLE t1 (
1775
1770
c1 CHAR(130),
1776
1771
c2 VARCHAR(1),
1777
1772
KEY (c1)
1792
1787
Table   Op      Msg_type        Msg_text
1793
1788
test.t1 check   status  OK
1794
1789
DROP TABLE t1;
1795
 
CREATE TABLE t1 (
1796
 
c1 CHAR(50),
1797
 
c2 VARCHAR(1)
1798
 
) ENGINE=MyISAM;
1799
 
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
1800
 
SELECT COUNT(*) FROM t1;
1801
 
COUNT(*)
1802
 
1
1803
 
CHECK TABLE t1;
1804
 
Table   Op      Msg_type        Msg_text
1805
 
test.t1 check   status  OK
1806
 
SELECT COUNT(*) FROM t1;
1807
 
COUNT(*)
1808
 
1
1809
 
CHECK TABLE t1;
1810
 
Table   Op      Msg_type        Msg_text
1811
 
test.t1 check   status  OK
1812
 
DROP TABLE t1;
1813
 
CREATE TABLE t1 (
1814
 
c1 CHAR(50),
1815
 
c2 VARCHAR(1)
1816
 
) ENGINE=MyISAM;
1817
 
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
1818
 
SELECT COUNT(*) FROM t1;
1819
 
COUNT(*)
1820
 
1
1821
 
CHECK TABLE t1 EXTENDED;
1822
 
Table   Op      Msg_type        Msg_text
1823
 
test.t1 check   status  OK
1824
 
SELECT COUNT(*) FROM t1;
1825
 
COUNT(*)
1826
 
1
1827
 
CHECK TABLE t1 EXTENDED;
1828
 
Table   Op      Msg_type        Msg_text
1829
 
test.t1 check   status  OK
1830
 
DROP TABLE t1;
1831
 
CREATE TABLE t1 (
 
1790
CREATE temporary TABLE t1 (
 
1791
c1 CHAR(50),
 
1792
c2 VARCHAR(1)
 
1793
) ENGINE=MyISAM;
 
1794
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
 
1795
SELECT COUNT(*) FROM t1;
 
1796
COUNT(*)
 
1797
1
 
1798
CHECK TABLE t1;
 
1799
Table   Op      Msg_type        Msg_text
 
1800
test.t1 check   status  OK
 
1801
SELECT COUNT(*) FROM t1;
 
1802
COUNT(*)
 
1803
1
 
1804
CHECK TABLE t1;
 
1805
Table   Op      Msg_type        Msg_text
 
1806
test.t1 check   status  OK
 
1807
DROP TABLE t1;
 
1808
CREATE temporary TABLE t1 (
 
1809
c1 CHAR(50),
 
1810
c2 VARCHAR(1)
 
1811
) ENGINE=MyISAM;
 
1812
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
 
1813
SELECT COUNT(*) FROM t1;
 
1814
COUNT(*)
 
1815
1
 
1816
CHECK TABLE t1 EXTENDED;
 
1817
Table   Op      Msg_type        Msg_text
 
1818
test.t1 check   status  OK
 
1819
SELECT COUNT(*) FROM t1;
 
1820
COUNT(*)
 
1821
1
 
1822
CHECK TABLE t1 EXTENDED;
 
1823
Table   Op      Msg_type        Msg_text
 
1824
test.t1 check   status  OK
 
1825
DROP TABLE t1;
 
1826
CREATE temporary TABLE t1 (
1832
1827
c1 CHAR(50),
1833
1828
c2 VARCHAR(1)
1834
1829
) ENGINE=MyISAM;
1846
1841
COUNT(*)
1847
1842
2
1848
1843
DROP TABLE t1;
1849
 
CREATE TABLE t1 (
 
1844
CREATE temporary TABLE t1 (
1850
1845
c1 CHAR(50),
1851
1846
c2 VARCHAR(1),
1852
1847
KEY (c1)