~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/myisam.result

Reverted 1103

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
Table   Op      Msg_type        Msg_text
15
15
test.t1 check   status  OK
16
16
drop table t1;
17
 
create temporary table t1 (a int not null auto_increment, b blob not null, primary key (a)) engine=myisam;
 
17
create table t1 (a int not null auto_increment, b blob not null, primary key (a));
18
18
check table t1;
19
19
Table   Op      Msg_type        Msg_text
20
20
test.t1 check   status  OK
23
23
Table   Op      Msg_type        Msg_text
24
24
test.t1 check   status  OK
25
25
drop table t1;
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;
29
 
show index from t1;
30
 
Table   Unique  Key_name        Seq_in_index    Column_name
31
 
t1      YES     PRIMARY 1       a
32
 
t1      NO      b       1       b
33
 
alter table t1 engine=MyISAM;
34
 
show index from t1;
35
 
Table   Unique  Key_name        Seq_in_index    Column_name
36
 
t1      YES     PRIMARY 1       a
37
 
t1      NO      b       1       b
 
28
optimize table t1;
 
29
Table   Op      Msg_type        Msg_text
 
30
test.t1 optimize        status  OK
 
31
show index from t1;
 
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           
 
35
optimize table t1;
 
36
Table   Op      Msg_type        Msg_text
 
37
test.t1 optimize        status  OK
 
38
show index from t1;
 
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           
38
42
drop table t1;
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       
65
69
drop table t1;
66
 
create temporary table t1 ( t1 char(255), key(t1(250))) ENGINE=MYISAM;
 
70
create table t1 ( t1 char(255), key(t1(250)));
 
71
Warnings:
 
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;
 
102
optimize table t1;
 
103
Table   Op      Msg_type        Msg_text
 
104
test.t1 optimize        status  OK
97
105
check table t1;
98
106
Table   Op      Msg_type        Msg_text
99
107
test.t1 check   status  OK
304
312
DROP TABLE t1;
305
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;
306
314
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
307
 
create temporary table t2 (a int not null, b int, c int, key(b), key(c), key(a)) engine=myisam;
 
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;
 
317
optimize table t1;
 
318
Table   Op      Msg_type        Msg_text
 
319
test.t1 optimize        status  OK
310
320
show index from t1;
311
 
Table   Unique  Key_name        Seq_in_index    Column_name
312
 
t1      NO      b       1       b
313
 
t1      NO      c       1       c
314
 
t1      NO      a       1       a
315
 
t1      NO      a       2       b
316
 
t1      NO      c_2     1       c
317
 
t1      NO      c_2     2       a
 
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       5       NULL    NULL    YES     BTREE           
 
323
t1      1       c       1       c       A       5       NULL    NULL    YES     BTREE           
 
324
t1      1       a       1       a       A       1       NULL    NULL            BTREE           
 
325
t1      1       a       2       b       A       5       NULL    NULL    YES     BTREE           
 
326
t1      1       c_2     1       c       A       5       NULL    NULL    YES     BTREE           
 
327
t1      1       c_2     2       a       A       5       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       
321
 
1       SIMPLE  t1      ref     a       a       4       test.t2.a       1       
 
331
1       SIMPLE  t1      ALL     a       NULL    NULL    NULL    5       Using where; Using join buffer
322
332
explain select * from t1,t2 force index(a) where t1.a=t2.a;
323
333
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
324
334
1       SIMPLE  t2      ALL     a       NULL    NULL    NULL    2       
325
 
1       SIMPLE  t1      ref     a       a       4       test.t2.a       1       
 
335
1       SIMPLE  t1      ALL     a       NULL    NULL    NULL    5       Using where; Using join buffer
326
336
explain select * from t1 force index(a),t2 force index(a) where t1.a=t2.a;
327
337
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
328
338
1       SIMPLE  t2      ALL     a       NULL    NULL    NULL    2       
329
 
1       SIMPLE  t1      ref     a       a       4       test.t2.a       1       
 
339
1       SIMPLE  t1      ref     a       a       4       test.t2.a       3       
330
340
explain select * from t1,t2 where t1.b=t2.b;
331
341
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
332
342
1       SIMPLE  t2      ALL     b       NULL    NULL    NULL    2       
333
 
1       SIMPLE  t1      ALL     b       NULL    NULL    NULL    5       Using where; Using join buffer
 
343
1       SIMPLE  t1      ref     b       b       5       test.t2.b       1       
334
344
explain select * from t1,t2 force index(c) where t1.a=t2.a;
335
345
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
336
346
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    2       
337
 
1       SIMPLE  t1      ref     a       a       4       test.t2.a       1       
 
347
1       SIMPLE  t1      ALL     a       NULL    NULL    NULL    5       Using where; Using join buffer
338
348
explain select * from t1 where a=0 or a=2;
339
349
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
340
350
1       SIMPLE  t1      ALL     a       NULL    NULL    NULL    5       Using where
343
353
1       SIMPLE  t1      range   a       a       4       NULL    4       Using where
344
354
explain select * from t1 where c=1;
345
355
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
346
 
1       SIMPLE  t1      ref     c,c_2   c       5       const   1       Using where
 
356
1       SIMPLE  t1      ref     c,c_2   c       5       const   1       
347
357
explain select * from t1 use index() where c=1;
348
358
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
349
359
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    5       Using where
350
360
drop table t1,t2;
351
 
create temporary table t1 (a int not null auto_increment primary key, b varchar(255)) engine=myisam;
 
361
create table t1 (a int not null auto_increment primary key, b varchar(255));
352
362
insert into t1 (b) values (repeat('a',100)),(repeat('b',100)),(repeat('c',100));
353
363
update t1 set b=repeat(left(b,1),200) where a=1;
354
364
delete from t1 where (a mod 2) = 0;
413
423
Table   Op      Msg_type        Msg_text
414
424
test.t1 check   status  OK
415
425
DROP TABLE t1;
416
 
create temporary table t1 (a blob) engine=myisam;
 
426
create table t1 (a blob);
417
427
insert into t1 values('a '),('a');
418
428
select concat(a,'.') from t1 where a='a';
419
429
concat(a,'.')
429
439
concat(a,'.')
430
440
a .
431
441
drop table t1;
432
 
create temporary table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20))) engine=myisam;
 
442
create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20)));
433
443
insert into t1 (b) values ('a'),('b'),('c');
434
444
select concat(b,'.') from t1;
435
445
concat(b,'.')
444
454
select * from t1;
445
455
a       b
446
456
1       a
447
 
2       b  
 
457
2       b 
448
458
3       c
449
459
delete from t1 where b='b';
450
460
select a,concat(b,'.') from t1;
452
462
1       a.
453
463
3       c.
454
464
drop table t1;
455
 
create temporary table t1 (a int not null) engine=myisam;
456
 
create temporary table t2 (a int not null, primary key (a)) engine=myisam;
 
465
create table t1 (a int not null);
 
466
create table t2 (a int not null, primary key (a));
457
467
insert into t1 values (1);
458
468
insert into t2 values (1),(2);
459
469
select sql_big_result distinct t1.a from t1,t2 order by t2.a;
467
477
1
468
478
explain select sql_big_result distinct t1.a from t1,t2 order by t2.a;
469
479
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
470
 
1       SIMPLE  t1      system  NULL    NULL    NULL    NULL    1       Using temporary
471
 
1       SIMPLE  t2      index   NULL    PRIMARY 4       NULL    2       Using index; Distinct
 
480
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    1       Using temporary; Using filesort
 
481
1       SIMPLE  t2      index   NULL    PRIMARY 4       NULL    2       Using index; Distinct; Using join buffer
472
482
explain select distinct t1.a from t1,t2 order by t2.a;
473
483
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
474
 
1       SIMPLE  t1      system  NULL    NULL    NULL    NULL    1       Using temporary
475
 
1       SIMPLE  t2      index   NULL    PRIMARY 4       NULL    2       Using index; Distinct
 
484
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    1       Using temporary; Using filesort
 
485
1       SIMPLE  t2      index   NULL    PRIMARY 4       NULL    2       Using index; Distinct; Using join buffer
476
486
drop table t1,t2;
477
487
create temporary table t1 (
478
488
c1 varchar(32),
484
494
c1
485
495
a
486
496
drop table t1;
487
 
create temporary table t1 (a int, b varchar(200), c text not null) engine=myisam;
488
 
create temporary table t2 (a int, b varchar(200), c text not null) engine=myisam;
 
497
create table t1 (a int, b varchar(200), c text not null) checksum=1;
 
498
create table t2 (a int, b varchar(200), c text not null) checksum=0;
489
499
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
490
500
insert t2 select * from t1;
491
 
show table status;
492
 
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
493
 
#       test    t1      TEMPORARY       MyISAM  #       #       #       #       #
494
 
#       test    t2      TEMPORARY       MyISAM  #       #       #       #       #
 
501
checksum table t1, t2, t3 quick;
 
502
Table   Checksum
 
503
test.t1 NULL
 
504
test.t2 NULL
 
505
test.t3 NULL
 
506
Warnings:
 
507
Error   1146    Table 'test.t3' doesn't exist
 
508
checksum table t1, t2, t3;
 
509
Table   Checksum
 
510
test.t1 2948697075
 
511
test.t2 2948697075
 
512
test.t3 NULL
 
513
Warnings:
 
514
Error   1146    Table 'test.t3' doesn't exist
 
515
checksum table t1, t2, t3 extended;
 
516
Table   Checksum
 
517
test.t1 2948697075
 
518
test.t2 2948697075
 
519
test.t3 NULL
 
520
Warnings:
 
521
Error   1146    Table 'test.t3' doesn't exist
495
522
drop table t1,t2;
496
 
create temporary table t1 ( a tinytext, b char(1), index idx (a(1),b) ) engine=myisam;
 
523
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
497
524
insert into t1 values (null,''), (null,'');
498
525
explain select count(*) from t1 where a is null;
499
526
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
502
529
count(*)
503
530
2
504
531
drop table t1;
505
 
create temporary table t1 (c1 int, c2 varchar(4) not null default '',
506
 
key(c2(3))) engine=myisam;
 
532
create table t1 (c1 int, c2 varchar(4) not null default '',
 
533
key(c2(3)));
507
534
insert into t1 values (1,'A'), (2, 'B'), (3, 'A');
508
535
update t1 set c2='A  B' where c1=2;
509
536
check table t1;
510
537
Table   Op      Msg_type        Msg_text
511
538
test.t1 check   status  OK
512
539
drop table t1;
513
 
create temporary table t1(
 
540
create table t1 (c1 int);
 
541
insert into t1 values (1),(2),(3),(4);
 
542
checksum table t1;
 
543
Table   Checksum
 
544
test.t1 149057747
 
545
delete from t1 where c1 = 1;
 
546
create table t2 as select * from t1;
 
547
checksum table t1;
 
548
Table   Checksum
 
549
test.t1 984116287
 
550
checksum table t2;
 
551
Table   Checksum
 
552
test.t2 984116287
 
553
drop table t1, t2;
 
554
create table t1(
514
555
cip INT NOT NULL,
515
556
score INT NOT NULL DEFAULT 0,
516
557
bob TINYBLOB
517
 
) engine=myisam;
 
558
);
518
559
insert into t1 (cip) VALUES (1), (2), (3);
519
560
insert into t1 (cip, bob) VALUES (4, 'a' ), (5, 'b'), 
520
561
(6, 'c');
557
598
MAX(a)
558
599
1
559
600
DROP TABLE t1;
 
601
CREATE TABLE t1(a CHAR(9), b VARCHAR(7));
 
602
INSERT INTO t1(a) VALUES('xxxxxxxxx'),('xxxxxxxxx');
 
603
UPDATE t1 AS ta1,t1 AS ta2 SET ta1.b='aaaaaa',ta2.b='bbbbbb';
 
604
SELECT * FROM t1;
 
605
a       b
 
606
xxxxxxxxx       bbbbbb
 
607
xxxxxxxxx       bbbbbb
 
608
DROP TABLE t1;
 
609
SET GLOBAL myisam_repair_threads=2;
 
610
SHOW VARIABLES LIKE 'myisam_repair%';
 
611
Variable_name   Value
 
612
myisam_repair_threads   2
560
613
CREATE TEMPORARY TABLE t1 (
561
614
`_id` int NOT NULL default '0',
562
615
`url` text,
596
649
8
597
650
9
598
651
DELETE FROM t1 WHERE _id < 8;
599
 
show table status LIKE 't1';
600
 
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
601
 
#       test    t1      TEMPORARY       MyISAM  #       #       #       #       #
602
 
CHECK TABLE t1;
603
 
Table   Op      Msg_type        Msg_text
604
 
test.t1 check   status  OK
605
 
ALTER TABLE t1 ENGINE=MYISAM;
606
 
CHECK TABLE t1;
607
 
Table   Op      Msg_type        Msg_text
608
 
test.t1 check   status  OK
609
 
show table status LIKE 't1';
610
 
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
611
 
#       test    t1      TEMPORARY       MyISAM  #       #       #       #       #
 
652
SHOW TABLE STATUS LIKE 't1';
 
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
CHECK TABLE t1 EXTENDED;
 
655
Table   Op      Msg_type        Msg_text
 
656
test.t1 check   status  OK
 
657
OPTIMIZE TABLE t1;
 
658
Table   Op      Msg_type        Msg_text
 
659
test.t1 optimize        status  OK
 
660
CHECK TABLE t1 EXTENDED;
 
661
Table   Op      Msg_type        Msg_text
 
662
test.t1 check   status  OK
 
663
SHOW TABLE STATUS LIKE 't1';
 
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
612
665
SELECT _id FROM t1;
613
666
_id
614
667
8
615
668
9
616
669
DROP TABLE t1;
617
 
CREATE TEMPORARY TABLE t1 (c1 TEXT) ENGINE=MyISAM;
618
 
show table status like 't1';
619
 
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
620
 
#       test    t1      TEMPORARY       MyISAM  #       #       #       #       #
 
670
SET GLOBAL myisam_repair_threads=1;
 
671
SHOW VARIABLES LIKE 'myisam_repair%';
 
672
Variable_name   Value
 
673
myisam_repair_threads   1
 
674
CREATE TABLE t1(a VARCHAR(16));
 
675
INSERT INTO t1 VALUES('aaaaaaaa'),(NULL);
 
676
UPDATE t1 AS ta1, t1 AS ta2 SET ta1.a='aaaaaaaaaaaaaaaa';
 
677
SELECT * FROM t1;
 
678
a
 
679
aaaaaaaaaaaaaaaa
 
680
aaaaaaaaaaaaaaaa
 
681
DROP TABLE t1;
 
682
CREATE TABLE t1(a INT);
 
683
INSERT INTO t1 VALUES(1),(2);
 
684
UPDATE t1,t1 AS t2 SET t1.a=t1.a+2 WHERE t1.a=t2.a-1;
 
685
SELECT * FROM t1 ORDER BY a;
 
686
a
 
687
2
 
688
3
 
689
DROP TABLE t1;
 
690
CREATE TEMPORARY TABLE t1 (c1 TEXT) ENGINE=MyISAM AVG_ROW_LENGTH=70100 MAX_ROWS=4100100100;
 
691
SHOW TABLE STATUS LIKE 't1';
 
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
621
693
DROP TABLE t1;
622
694
CREATE TEMPORARY TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM;
623
695
INSERT INTO t1 VALUES
778
850
insert into t1 values('+ ', '+ ', '+ ');
779
851
set @a=repeat(' ',20);
780
852
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
781
 
ERROR 22001: Data too long for column 'v' at row 1
782
 
set @a=repeat(' ',10);
783
 
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
784
 
ERROR 22001: Data too long for column 'v' at row 1
785
 
set @a=repeat(' ',9);
786
 
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
 
853
Warnings:
 
854
Note    1265    Data truncated for column 'v' at row 1
 
855
Note    1265    Data truncated for column 'c' at row 1
787
856
select concat('*',v,'*',c,'*',t,'*') from t1;
788
857
concat('*',v,'*',c,'*',t,'*')
789
858
*+ *+ *+ *
790
 
*+         *+         *+         *
 
859
*+         *+         *+                    *
791
860
show create table t1;
792
861
Table   Create Table
793
862
t1      CREATE TEMPORARY TABLE `t1` (
794
 
  `v` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
795
 
  `c` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
796
 
  `t` TEXT COLLATE utf8_general_ci
797
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
863
  `v` varchar(10) DEFAULT NULL,
 
864
  `c` varchar(10) DEFAULT NULL,
 
865
  `t` text
 
866
) ENGINE=MyISAM
798
867
create TEMPORARY table t2 like t1;
799
868
show create table t2;
800
869
Table   Create Table
801
870
t2      CREATE TEMPORARY TABLE `t2` (
802
 
  `v` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
803
 
  `c` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
804
 
  `t` TEXT COLLATE utf8_general_ci
805
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
871
  `v` varchar(10) DEFAULT NULL,
 
872
  `c` varchar(10) DEFAULT NULL,
 
873
  `t` text
 
874
) ENGINE=MyISAM
806
875
create TEMPORARY table t3 select * from t1;
807
876
show create table t3;
808
877
Table   Create Table
809
878
t3      CREATE TEMPORARY TABLE `t3` (
810
 
  `v` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
811
 
  `c` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
812
 
  `t` TEXT COLLATE utf8_general_ci
813
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
879
  `v` varchar(10) DEFAULT NULL,
 
880
  `c` varchar(10) DEFAULT NULL,
 
881
  `t` text
 
882
) ENGINE=MyISAM
814
883
alter table t1 modify c varchar(10);
815
884
show create table t1;
816
885
Table   Create Table
817
886
t1      CREATE TEMPORARY TABLE `t1` (
818
 
  `v` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
819
 
  `c` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
820
 
  `t` TEXT COLLATE utf8_general_ci
821
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
887
  `v` varchar(10) DEFAULT NULL,
 
888
  `c` varchar(10) DEFAULT NULL,
 
889
  `t` text
 
890
) ENGINE=MyISAM
822
891
alter table t1 modify v char(10);
823
892
show create table t1;
824
893
Table   Create Table
825
894
t1      CREATE TEMPORARY TABLE `t1` (
826
 
  `v` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
827
 
  `c` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
828
 
  `t` TEXT COLLATE utf8_general_ci
829
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
895
  `v` varchar(10) DEFAULT NULL,
 
896
  `c` varchar(10) DEFAULT NULL,
 
897
  `t` text
 
898
) ENGINE=MyISAM
830
899
alter table t1 modify t varchar(10);
 
900
Warnings:
 
901
Note    1265    Data truncated for column 't' at row 2
831
902
show create table t1;
832
903
Table   Create Table
833
904
t1      CREATE TEMPORARY TABLE `t1` (
834
 
  `v` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
835
 
  `c` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
836
 
  `t` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL
837
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
905
  `v` varchar(10) DEFAULT NULL,
 
906
  `c` varchar(10) DEFAULT NULL,
 
907
  `t` varchar(10) DEFAULT NULL
 
908
) ENGINE=MyISAM
838
909
select concat('*',v,'*',c,'*',t,'*') from t1;
839
910
concat('*',v,'*',c,'*',t,'*')
840
911
*+ *+ *+ *
844
915
show create table t1;
845
916
Table   Create Table
846
917
t1      CREATE TEMPORARY TABLE `t1` (
847
 
  `v` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
848
 
  `c` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
849
 
  `t` TEXT COLLATE utf8_general_ci,
 
918
  `v` varchar(10) DEFAULT NULL,
 
919
  `c` varchar(10) DEFAULT NULL,
 
920
  `t` text,
850
921
  KEY `v` (`v`),
851
922
  KEY `c` (`c`),
852
923
  KEY `t` (`t`(10))
853
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
924
) ENGINE=MyISAM
854
925
select count(*) from t1;
855
926
count(*)
856
927
270
1063
1134
show create table t1;
1064
1135
Table   Create Table
1065
1136
t1      CREATE TEMPORARY TABLE `t1` (
1066
 
  `v` VARCHAR(300) COLLATE utf8_general_ci DEFAULT NULL,
1067
 
  `c` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
1068
 
  `t` TEXT COLLATE utf8_general_ci,
 
1137
  `v` varchar(300) DEFAULT NULL,
 
1138
  `c` varchar(10) DEFAULT NULL,
 
1139
  `t` text,
1069
1140
  KEY `c` (`c`),
1070
1141
  KEY `t` (`t`(10)),
1071
1142
  KEY `v` (`v`)
1072
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
1143
) ENGINE=MyISAM
1073
1144
select count(*) from t1 where v='a';
1074
1145
count(*)
1075
1146
10
1143
1214
show create table t1;
1144
1215
Table   Create Table
1145
1216
t1      CREATE TEMPORARY TABLE `t1` (
1146
 
  `v` VARCHAR(300) COLLATE utf8_general_ci DEFAULT NULL,
1147
 
  `c` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
1148
 
  `t` TEXT COLLATE utf8_general_ci,
 
1217
  `v` varchar(300) DEFAULT NULL,
 
1218
  `c` varchar(10) DEFAULT NULL,
 
1219
  `t` text,
1149
1220
  KEY `c` (`c`),
1150
1221
  KEY `t` (`t`(10)),
1151
1222
  KEY `v` (`v`(30))
1152
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
1223
) ENGINE=MyISAM
1153
1224
select count(*) from t1 where v='a';
1154
1225
count(*)
1155
1226
10
1225
1296
show create table t1;
1226
1297
Table   Create Table
1227
1298
t1      CREATE TEMPORARY TABLE `t1` (
1228
 
  `v` VARCHAR(600) COLLATE utf8_general_ci DEFAULT NULL,
1229
 
  `c` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
1230
 
  `t` TEXT COLLATE utf8_general_ci,
 
1299
  `v` varchar(600) DEFAULT NULL,
 
1300
  `c` varchar(10) DEFAULT NULL,
 
1301
  `t` text,
1231
1302
  KEY `c` (`c`),
1232
1303
  KEY `t` (`t`(10)),
1233
1304
  KEY `v` (`v`(333))
1234
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
1305
) ENGINE=MyISAM
1235
1306
select v,count(*) from t1 group by v limit 10;
1236
1307
v       count(*)
1237
1308
a      1
1279
1350
insert into t1 values ('a     ');
1280
1351
ERROR 23000: Duplicate entry 'a     ' for key 'a'
1281
1352
insert into t1 values ('a          ');
1282
 
ERROR 22001: Data too long for column 'a' at row 1
 
1353
ERROR 23000: Duplicate entry 'a         ' for key 'a'
1283
1354
insert into t1 values ('a ');
1284
1355
ERROR 23000: Duplicate entry 'a ' for key 'a'
1285
1356
update t1 set a='a  ' where a like 'a%';
1303
1374
show create table t1;
1304
1375
Table   Create Table
1305
1376
t1      CREATE TEMPORARY TABLE `t1` (
1306
 
  `v` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
1307
 
  `c` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
1308
 
  `t` TEXT COLLATE utf8_general_ci,
 
1377
  `v` varchar(10) DEFAULT NULL,
 
1378
  `c` varchar(10) DEFAULT NULL,
 
1379
  `t` text,
1309
1380
  KEY `v` (`v`(5)),
1310
1381
  KEY `c` (`c`(5)),
1311
1382
  KEY `t` (`t`(5))
1312
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
1383
) ENGINE=MyISAM
1313
1384
drop table t1;
1314
1385
create TEMPORARY table t1 (v char(10));
1315
1386
show create table t1;
1316
1387
Table   Create Table
1317
1388
t1      CREATE TEMPORARY TABLE `t1` (
1318
 
  `v` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL
1319
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
1389
  `v` varchar(10) DEFAULT NULL
 
1390
) ENGINE=MyISAM
1320
1391
drop table t1;
1321
 
create TEMPORARY table t1 (v varchar(10), c char(10));
 
1392
create TEMPORARY table t1 (v varchar(10), c char(10)) row_format=fixed;
1322
1393
show create table t1;
1323
1394
Table   Create Table
1324
1395
t1      CREATE TEMPORARY TABLE `t1` (
1325
 
  `v` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
1326
 
  `c` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL
1327
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
1396
  `v` varchar(10) DEFAULT NULL,
 
1397
  `c` varchar(10) DEFAULT NULL
 
1398
) ENGINE=MyISAM ROW_FORMAT=FIXED
1328
1399
insert into t1 values('a','a'),('a ','a ');
1329
1400
select concat('*',v,'*',c,'*') from t1;
1330
1401
concat('*',v,'*',c,'*')
1349
1420
create temporary table t1 (v varchar(65535));
1350
1421
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1351
1422
set storage_engine=InnoDB;
1352
 
create temporary table t1 (a int, key(a)) engine=myisam;
 
1423
create table t1 (a int, key(a));
1353
1424
insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
1354
1425
analyze table t1;
1355
1426
Table   Op      Msg_type        Msg_text
1356
 
test.t1 analyze note    The storage engine for the table doesn't support analyze
 
1427
test.t1 analyze status  OK
1357
1428
show keys from t1;
1358
 
Table   Unique  Key_name        Seq_in_index    Column_name
1359
 
t1      NO      a       1       a
 
1429
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
 
1430
t1      1       a       1       a       A       8       NULL    NULL    YES     BTREE           
1360
1431
alter table t1 disable keys;
 
1432
Warnings:
 
1433
Note    1031    Table storage engine for 't1' doesn't have this option
1361
1434
alter table t1 enable keys;
 
1435
Warnings:
 
1436
Note    1031    Table storage engine for 't1' doesn't have this option
1362
1437
show keys from t1;
1363
 
Table   Unique  Key_name        Seq_in_index    Column_name
1364
 
t1      NO      a       1       a
 
1438
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
 
1439
t1      1       a       1       a       A       8       NULL    NULL    YES     BTREE           
1365
1440
drop table t1;
 
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;
 
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
 
1446
drop table t1, t2, t3;
1366
1447
CREATE TEMPORARY TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
1367
1448
INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5);
1368
1449
SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
1390
1471
1
1391
1472
DROP TABLE t1;
1392
1473
CREATE TEMPORARY TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
1393
 
show table status like 't1';
1394
 
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
1395
 
#       test    t1      TEMPORARY       MyISAM  #       #       #       #       #
 
1474
SHOW TABLE STATUS LIKE 't1';
 
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
1396
1476
INSERT INTO t1 VALUES (1,1);
1397
 
show table status like 't1';
1398
 
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
1399
 
#       test    t1      TEMPORARY       MyISAM  #       #       #       #       #
1400
 
ALTER TABLE t1 DISABLE KEYS;
1401
 
show table status like 't1';
1402
 
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
1403
 
#       test    t1      TEMPORARY       MyISAM  #       #       #       #       #
1404
 
ALTER TABLE t1 ENABLE KEYS;
1405
 
show table status like 't1';
1406
 
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
1407
 
#       test    t1      TEMPORARY       MyISAM  #       #       #       #       #
1408
 
ALTER TABLE t1 DISABLE KEYS;
1409
 
show table status like 't1';
1410
 
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
1411
 
#       test    t1      TEMPORARY       MyISAM  #       #       #       #       #
1412
 
ALTER TABLE t1 ENABLE KEYS;
1413
 
show table status like 't1';
1414
 
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
1415
 
#       test    t1      TEMPORARY       MyISAM  #       #       #       #       #
 
1477
SHOW TABLE STATUS LIKE 't1';
 
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
 
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
1416
1491
# Enable keys with parallel repair
 
1492
SET GLOBAL myisam_repair_threads=2;
1417
1493
ALTER TABLE t1 DISABLE KEYS;
1418
1494
ALTER TABLE t1 ENABLE KEYS;
1419
 
CHECK TABLE t1;
 
1495
SET GLOBAL myisam_repair_threads=1;
 
1496
CHECK TABLE t1 EXTENDED;
1420
1497
Table   Op      Msg_type        Msg_text
1421
1498
test.t1 check   status  OK
1422
1499
DROP TABLE t1;
1434
1511
3       2
1435
1512
4       5
1436
1513
4       4
 
1514
DELETE FROM a USING t1 AS a INNER JOIN t1 AS b USING (id) WHERE a.ref < b.ref;
 
1515
SELECT * FROM t1;
 
1516
id      ref
 
1517
1       3
 
1518
2       1
 
1519
3       2
 
1520
4       5
1437
1521
DROP TABLE t1, t2;
1438
1522
End of 5.0 tests
 
1523
create temporary table t1 (a int not null, key `a` (a) key_block_size=1024) ENGINE=MyISAM;
 
1524
show create table t1;
 
1525
Table   Create Table
 
1526
t1      CREATE TEMPORARY TABLE `t1` (
 
1527
  `a` int NOT NULL,
 
1528
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024
 
1529
) ENGINE=MyISAM
 
1530
drop table t1;
 
1531
create temporary table t1 (a int not null, key `a` (a) key_block_size=2048) ENGINE=MyISAM;
 
1532
show create table t1;
 
1533
Table   Create Table
 
1534
t1      CREATE TEMPORARY TABLE `t1` (
 
1535
  `a` int NOT NULL,
 
1536
  KEY `a` (`a`) KEY_BLOCK_SIZE=2048
 
1537
) ENGINE=MyISAM
 
1538
drop table t1;
 
1539
create temporary table t1 (a varchar(2048), key `a` (a)) ENGINE=MyISAM;
 
1540
Warnings:
 
1541
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1542
show create table t1;
 
1543
Table   Create Table
 
1544
t1      CREATE TEMPORARY TABLE `t1` (
 
1545
  `a` varchar(2048) DEFAULT NULL,
 
1546
  KEY `a` (`a`(333))
 
1547
) ENGINE=MyISAM
 
1548
drop table t1;
 
1549
create temporary table t1 (a varchar(2048), key `a` (a) key_block_size=1024) ENGINE=MyISAM;
 
1550
Warnings:
 
1551
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1552
show create table t1;
 
1553
Table   Create Table
 
1554
t1      CREATE TEMPORARY TABLE `t1` (
 
1555
  `a` varchar(2048) DEFAULT NULL,
 
1556
  KEY `a` (`a`(333)) KEY_BLOCK_SIZE=6144
 
1557
) ENGINE=MyISAM
 
1558
drop table t1;
 
1559
create temporary table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=1024;
 
1560
Warnings:
 
1561
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1562
show create table t1;
 
1563
Table   Create Table
 
1564
t1      CREATE TEMPORARY TABLE `t1` (
 
1565
  `a` int NOT NULL,
 
1566
  `b` varchar(2048) DEFAULT NULL,
 
1567
  KEY `a` (`a`),
 
1568
  KEY `b` (`b`(333)) KEY_BLOCK_SIZE=6144
 
1569
) ENGINE=MyISAM KEY_BLOCK_SIZE=1024
 
1570
alter table t1 key_block_size=2048;
 
1571
show create table t1;
 
1572
Table   Create Table
 
1573
t1      CREATE TEMPORARY TABLE `t1` (
 
1574
  `a` int NOT NULL,
 
1575
  `b` varchar(2048) DEFAULT NULL,
 
1576
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
 
1577
  KEY `b` (`b`(333)) KEY_BLOCK_SIZE=8192
 
1578
) ENGINE=MyISAM KEY_BLOCK_SIZE=2048
 
1579
alter table t1 add c int, add key (c);
 
1580
show create table t1;
 
1581
Table   Create Table
 
1582
t1      CREATE TEMPORARY TABLE `t1` (
 
1583
  `a` int NOT NULL,
 
1584
  `b` varchar(2048) DEFAULT NULL,
 
1585
  `c` int DEFAULT NULL,
 
1586
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
 
1587
  KEY `b` (`b`(333)) KEY_BLOCK_SIZE=8192,
 
1588
  KEY `c` (`c`)
 
1589
) ENGINE=MyISAM KEY_BLOCK_SIZE=2048
 
1590
alter table t1 key_block_size=0;
 
1591
alter table t1 add d int, add key (d);
 
1592
show create table t1;
 
1593
Table   Create Table
 
1594
t1      CREATE TEMPORARY TABLE `t1` (
 
1595
  `a` int NOT NULL,
 
1596
  `b` varchar(2048) DEFAULT NULL,
 
1597
  `c` int DEFAULT NULL,
 
1598
  `d` int DEFAULT NULL,
 
1599
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
 
1600
  KEY `b` (`b`(333)) KEY_BLOCK_SIZE=8192,
 
1601
  KEY `c` (`c`) KEY_BLOCK_SIZE=2048,
 
1602
  KEY `d` (`d`)
 
1603
) ENGINE=MyISAM
 
1604
drop table t1;
 
1605
create temporary table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=8192;
 
1606
Warnings:
 
1607
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1608
show create table t1;
 
1609
Table   Create Table
 
1610
t1      CREATE TEMPORARY TABLE `t1` (
 
1611
  `a` int NOT NULL,
 
1612
  `b` varchar(2048) DEFAULT NULL,
 
1613
  KEY `a` (`a`),
 
1614
  KEY `b` (`b`(333))
 
1615
) ENGINE=MyISAM KEY_BLOCK_SIZE=8192
 
1616
drop table t1;
 
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;
 
1618
Warnings:
 
1619
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1620
show create table t1;
 
1621
Table   Create Table
 
1622
t1      CREATE TEMPORARY TABLE `t1` (
 
1623
  `a` int NOT NULL,
 
1624
  `b` varchar(2048) DEFAULT NULL,
 
1625
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
 
1626
  KEY `b` (`b`(333))
 
1627
) ENGINE=MyISAM KEY_BLOCK_SIZE=8192
 
1628
drop table t1;
 
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;
 
1630
show create table t1;
 
1631
Table   Create Table
 
1632
t1      CREATE TEMPORARY TABLE `t1` (
 
1633
  `a` int NOT NULL,
 
1634
  `b` int DEFAULT NULL,
 
1635
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
 
1636
  KEY `b` (`b`) KEY_BLOCK_SIZE=8192
 
1637
) ENGINE=MyISAM KEY_BLOCK_SIZE=16384
 
1638
drop table t1;
 
1639
create temporary table t1 (a int not null, key `a` (a) key_block_size=512) ENGINE=MyISAM;
 
1640
show create table t1;
 
1641
Table   Create Table
 
1642
t1      CREATE TEMPORARY TABLE `t1` (
 
1643
  `a` int NOT NULL,
 
1644
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024
 
1645
) ENGINE=MyISAM
 
1646
drop table t1;
 
1647
create temporary table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000) ENGINE=MyISAM;
 
1648
Warnings:
 
1649
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1650
show create table t1;
 
1651
Table   Create Table
 
1652
t1      CREATE TEMPORARY TABLE `t1` (
 
1653
  `a` varchar(2048) DEFAULT NULL,
 
1654
  KEY `a` (`a`(333)) KEY_BLOCK_SIZE=6144
 
1655
) ENGINE=MyISAM
 
1656
drop table t1;
 
1657
create temporary table t1 (a int not null, key `a` (a) key_block_size=1025) ENGINE=MyISAM;
 
1658
show create table t1;
 
1659
Table   Create Table
 
1660
t1      CREATE TEMPORARY TABLE `t1` (
 
1661
  `a` int NOT NULL,
 
1662
  KEY `a` (`a`) KEY_BLOCK_SIZE=2048
 
1663
) ENGINE=MyISAM
 
1664
drop table t1;
 
1665
create temporary table t1 (a int not null, key key_block_size=1024 (a)) ENGINE=MyISAM;
 
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
 
1667
create temporary table t1 (a int not null, key `a` key_block_size=1024 (a)) ENGINE=MyISAM;
 
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
1439
1669
CREATE temporary TABLE t1 (
1440
1670
c1 INT,
1441
1671
c2 VARCHAR(300),
1508
1738
SELECT COUNT(*) FROM t1;
1509
1739
COUNT(*)
1510
1740
1
1511
 
CHECK TABLE t1;
 
1741
CHECK TABLE t1 EXTENDED;
1512
1742
Table   Op      Msg_type        Msg_text
1513
1743
test.t1 check   status  OK
1514
1744
SELECT COUNT(*) FROM t1;
1515
1745
COUNT(*)
1516
1746
1
1517
 
CHECK TABLE t1;
 
1747
CHECK TABLE t1 EXTENDED;
1518
1748
Table   Op      Msg_type        Msg_text
1519
1749
test.t1 check   status  OK
1520
1750
DROP TABLE t1;
1529
1759
SELECT COUNT(*) FROM t1;
1530
1760
COUNT(*)
1531
1761
2
1532
 
ALTER TABLE t1 ENGINE=MyISAM;
 
1762
OPTIMIZE TABLE t1;
 
1763
Table   Op      Msg_type        Msg_text
 
1764
test.t1 optimize        status  OK
1533
1765
SELECT COUNT(*) FROM t1;
1534
1766
COUNT(*)
1535
1767
2
1551
1783
CHECK TABLE t1;
1552
1784
Table   Op      Msg_type        Msg_text
1553
1785
test.t1 check   status  OK
1554
 
CHECK TABLE t1;
1555
 
Table   Op      Msg_type        Msg_text
1556
 
test.t1 check   status  OK
1557
 
DROP TABLE t1;
1558
 
CREATE temporary TABLE t1 (
1559
 
c1 CHAR(50),
1560
 
c2 VARCHAR(1)
1561
 
) ENGINE=MyISAM;
1562
 
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
1563
 
SELECT COUNT(*) FROM t1;
1564
 
COUNT(*)
1565
 
1
1566
 
CHECK TABLE t1;
1567
 
Table   Op      Msg_type        Msg_text
1568
 
test.t1 check   status  OK
1569
 
SELECT COUNT(*) FROM t1;
1570
 
COUNT(*)
1571
 
1
1572
 
CHECK TABLE t1;
1573
 
Table   Op      Msg_type        Msg_text
1574
 
test.t1 check   status  OK
1575
 
DROP TABLE t1;
1576
 
CREATE temporary TABLE t1 (
1577
 
c1 CHAR(50),
1578
 
c2 VARCHAR(1)
1579
 
) ENGINE=MyISAM;
1580
 
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
1581
 
SELECT COUNT(*) FROM t1;
1582
 
COUNT(*)
1583
 
1
1584
 
CHECK TABLE t1;
1585
 
Table   Op      Msg_type        Msg_text
1586
 
test.t1 check   status  OK
1587
 
SELECT COUNT(*) FROM t1;
1588
 
COUNT(*)
1589
 
1
1590
 
CHECK TABLE t1;
 
1786
CHECK TABLE t1 EXTENDED;
 
1787
Table   Op      Msg_type        Msg_text
 
1788
test.t1 check   status  OK
 
1789
DROP 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;
1591
1823
Table   Op      Msg_type        Msg_text
1592
1824
test.t1 check   status  OK
1593
1825
DROP TABLE t1;
1602
1834
SELECT COUNT(*) FROM t1;
1603
1835
COUNT(*)
1604
1836
2
1605
 
ALTER TABLE t1 ENGINE=MyISAM;
 
1837
OPTIMIZE TABLE t1;
 
1838
Table   Op      Msg_type        Msg_text
 
1839
test.t1 optimize        status  OK
1606
1840
SELECT COUNT(*) FROM t1;
1607
1841
COUNT(*)
1608
1842
2
1624
1858
CHECK TABLE t1;
1625
1859
Table   Op      Msg_type        Msg_text
1626
1860
test.t1 check   status  OK
1627
 
CHECK TABLE t1;
 
1861
CHECK TABLE t1 EXTENDED;
1628
1862
Table   Op      Msg_type        Msg_text
1629
1863
test.t1 check   status  OK
1630
1864
DROP TABLE t1;