~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/myisam.result

  • Committer: Brian Aker
  • Date: 2009-03-05 07:54:39 UTC
  • mto: This revision was merged to the branch mainline in revision 911.
  • Revision ID: brian@tangent.org-20090305075439-ubkvoauwj5er551l
Remove some dead bits of string (and fix the semi_join test).

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 TEMPORARY TABLE t1 (
 
3
CREATE TABLE t1 (
4
4
STRING_DATA char(255) default NULL,
5
5
KEY string_data (STRING_DATA)
6
6
) ENGINE=MyISAM;
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
 
21
repair table t1;
 
22
Table   Op      Msg_type        Msg_text
 
23
test.t1 repair  note    The storage engine for the table doesn't support repair
21
24
delete from t1 where (a mod 2) = 1;
22
25
check table t1;
23
26
Table   Op      Msg_type        Msg_text
24
27
test.t1 check   status  OK
 
28
repair table t1;
 
29
Table   Op      Msg_type        Msg_text
 
30
test.t1 repair  note    The storage engine for the table doesn't support repair
 
31
check table t1;
 
32
Table   Op      Msg_type        Msg_text
 
33
test.t1 check   status  OK
25
34
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;
 
35
create table t1 (a int not null auto_increment, b int not null, primary key (a), index(b));
27
36
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
 
37
optimize table t1;
 
38
Table   Op      Msg_type        Msg_text
 
39
test.t1 optimize        status  OK
 
40
show index from t1;
 
41
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
 
42
t1      0       PRIMARY 1       a       A       5       NULL    NULL            BTREE           
 
43
t1      1       b       1       b       A       5       NULL    NULL            BTREE           
 
44
optimize table t1;
 
45
Table   Op      Msg_type        Msg_text
 
46
test.t1 optimize        status  OK
 
47
show index from t1;
 
48
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
 
49
t1      0       PRIMARY 1       a       A       5       NULL    NULL            BTREE           
 
50
t1      1       b       1       b       A       5       NULL    NULL            BTREE           
38
51
drop table t1;
39
 
create temporary table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=myisam;
 
52
create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=myisam;
40
53
insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
41
54
explain select * from t1 order by a;
42
55
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
63
76
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
64
77
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    4       
65
78
drop table t1;
66
 
create temporary table t1 ( t1 char(255), key(t1(250))) ENGINE=MYISAM;
 
79
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
 
80
INSERT INTO  t1 VALUES (1), (2), (3);
 
81
LOCK TABLES t1 WRITE;
 
82
INSERT INTO  t1 VALUES (1), (2), (3);
 
83
OPTIMIZE TABLE t1;
 
84
Table   Op      Msg_type        Msg_text
 
85
test.t1 optimize        status  OK
 
86
DROP TABLE t1;
 
87
create table t1 ( t1 char(255), key(t1(250)));
 
88
Warnings:
 
89
Warning 1071    Specified key was too long; max key length is 767 bytes
67
90
insert t1 values ('137513751375137513751375137513751375137569516951695169516951695169516951695169');
68
91
insert t1 values ('178417841784178417841784178417841784178403420342034203420342034203420342034203');
69
92
insert t1 values ('213872387238723872387238723872387238723867376737673767376737673767376737673767');
93
116
insert t1 values ('70'), ('84'), ('60'), ('20'), ('76'), ('89'), ('49'), ('50'),
94
117
('88'), ('61'), ('42'), ('98'), ('39'), ('30'), ('25'), ('66'), ('61'), ('48'),
95
118
('80'), ('84'), ('98'), ('19'), ('91'), ('42'), ('47');
96
 
alter table t1 ENGINE=myisam;
 
119
optimize table t1;
 
120
Table   Op      Msg_type        Msg_text
 
121
test.t1 optimize        status  OK
97
122
check table t1;
98
123
Table   Op      Msg_type        Msg_text
99
124
test.t1 check   status  OK
100
125
drop table t1;
101
 
create temporary table t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
 
126
create table t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
102
127
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
103
128
int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
104
129
i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34
274
299
Table   Op      Msg_type        Msg_text
275
300
test.t1 check   status  OK
276
301
drop table t1;
277
 
CREATE TEMPORARY TABLE `t1` (
 
302
CREATE TABLE `t1` (
278
303
`post_id` int NOT NULL auto_increment,
279
304
`topic_id` int NOT NULL default '0',
280
305
`post_time` datetime,
296
321
Table   Op      Msg_type        Msg_text
297
322
test.t1 check   status  OK
298
323
drop table t1;
299
 
CREATE TEMPORARY TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300), KEY t1 (a, b, c, d, e)) ENGINE=MyISAM;
 
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;
300
325
ERROR 42000: Specified key was too long; max key length is 1332 bytes
301
 
CREATE TEMPORARY TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300)) ENGINE=MyISAM;
 
326
CREATE TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300)) ENGINE=MyISAM;
302
327
ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
303
328
ERROR 42000: Specified key was too long; max key length is 1332 bytes
304
329
DROP TABLE t1;
305
 
CREATE TEMPORARY TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a)) ENGINE=MyISAM;
 
330
CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a)) ENGINE=MyISAM;
306
331
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;
 
332
create table t2 (a int not null, b int, c int, key(b), key(c), key(a));
308
333
INSERT into t2 values (1,1,1), (2,2,2);
309
 
alter table t1 ENGINE=MYISAM;
 
334
optimize table t1;
 
335
Table   Op      Msg_type        Msg_text
 
336
test.t1 optimize        status  OK
310
337
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
 
338
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
 
339
t1      1       b       1       b       A       5       NULL    NULL    YES     BTREE           
 
340
t1      1       c       1       c       A       5       NULL    NULL    YES     BTREE           
 
341
t1      1       a       1       a       A       1       NULL    NULL            BTREE           
 
342
t1      1       a       2       b       A       5       NULL    NULL    YES     BTREE           
 
343
t1      1       c_2     1       c       A       5       NULL    NULL    YES     BTREE           
 
344
t1      1       c_2     2       a       A       5       NULL    NULL            BTREE           
318
345
explain select * from t1,t2 where t1.a=t2.a;
319
346
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
320
347
1       SIMPLE  t2      ALL     a       NULL    NULL    NULL    2       
321
 
1       SIMPLE  t1      ref     a       a       4       test.t2.a       1       
 
348
1       SIMPLE  t1      ALL     a       NULL    NULL    NULL    5       Using where; Using join buffer
322
349
explain select * from t1,t2 force index(a) where t1.a=t2.a;
323
350
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
324
351
1       SIMPLE  t2      ALL     a       NULL    NULL    NULL    2       
325
 
1       SIMPLE  t1      ref     a       a       4       test.t2.a       1       
 
352
1       SIMPLE  t1      ALL     a       NULL    NULL    NULL    5       Using where; Using join buffer
326
353
explain select * from t1 force index(a),t2 force index(a) where t1.a=t2.a;
327
354
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
328
355
1       SIMPLE  t2      ALL     a       NULL    NULL    NULL    2       
329
 
1       SIMPLE  t1      ref     a       a       4       test.t2.a       1       
 
356
1       SIMPLE  t1      ref     a       a       4       test.t2.a       3       
330
357
explain select * from t1,t2 where t1.b=t2.b;
331
358
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
332
359
1       SIMPLE  t2      ALL     b       NULL    NULL    NULL    2       
333
 
1       SIMPLE  t1      ALL     b       NULL    NULL    NULL    5       Using where; Using join buffer
 
360
1       SIMPLE  t1      ref     b       b       5       test.t2.b       1       
334
361
explain select * from t1,t2 force index(c) where t1.a=t2.a;
335
362
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
336
363
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    2       
337
 
1       SIMPLE  t1      ref     a       a       4       test.t2.a       1       
 
364
1       SIMPLE  t1      ALL     a       NULL    NULL    NULL    5       Using where; Using join buffer
338
365
explain select * from t1 where a=0 or a=2;
339
366
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
340
367
1       SIMPLE  t1      ALL     a       NULL    NULL    NULL    5       Using where
341
368
explain select * from t1 force index (a) where a=0 or a=2;
342
369
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
343
 
1       SIMPLE  t1      range   a       a       4       NULL    4       Using where
 
370
1       SIMPLE  t1      range   a       a       4       NULL    4       Using where; Using MRR
344
371
explain select * from t1 where c=1;
345
372
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
 
373
1       SIMPLE  t1      ref     c,c_2   c       5       const   1       
347
374
explain select * from t1 use index() where c=1;
348
375
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
349
376
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    5       Using where
350
377
drop table t1,t2;
351
 
create temporary table t1 (a int not null auto_increment primary key, b varchar(255)) engine=myisam;
 
378
create table t1 (a int not null auto_increment primary key, b varchar(255));
352
379
insert into t1 (b) values (repeat('a',100)),(repeat('b',100)),(repeat('c',100));
353
380
update t1 set b=repeat(left(b,1),200) where a=1;
354
381
delete from t1 where (a mod 2) = 0;
370
397
Table   Op      Msg_type        Msg_text
371
398
test.t1 check   status  OK
372
399
drop table t1;
373
 
create temporary table t1 ( a text not null, key a (a(20))) engine=myisam;
 
400
create table t1 ( a text not null, key a (a(20)));
374
401
insert into t1 values ('aaa   '),('aaa'),('aa');
375
402
check table t1;
376
403
Table   Op      Msg_type        Msg_text
377
404
test.t1 check   status  OK
 
405
repair table t1;
 
406
Table   Op      Msg_type        Msg_text
 
407
test.t1 repair  note    The storage engine for the table doesn't support repair
378
408
select concat(a,'.') from t1 where a='aaa';
379
409
concat(a,'.')
380
410
aaa   .
389
419
bbb.
390
420
aa.
391
421
drop table t1;
392
 
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;
 
422
create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10)));
393
423
insert into t1 values('807780', '477', '165');
394
424
insert into t1 values('807780', '477', '162');
395
425
insert into t1 values('807780', '472', '162');
400
430
DROP TABLE IF EXISTS t1;
401
431
Warnings:
402
432
Note    1051    Unknown table 't1'
403
 
CREATE TEMPORARY TABLE t1 (a varchar(150) NOT NULL, KEY (a)) ENGINE=MyISAM;
 
433
CREATE TABLE t1 (a varchar(150) NOT NULL, KEY (a)) ENGINE=MyISAM;
404
434
INSERT t1 VALUES ("can \tcan");
405
435
INSERT t1 VALUES ("can   can");
406
436
INSERT t1 VALUES ("can");
413
443
Table   Op      Msg_type        Msg_text
414
444
test.t1 check   status  OK
415
445
DROP TABLE t1;
416
 
create temporary table t1 (a blob) engine=myisam;
 
446
create table t1 (a blob);
417
447
insert into t1 values('a '),('a');
418
448
select concat(a,'.') from t1 where a='a';
419
449
concat(a,'.')
429
459
concat(a,'.')
430
460
a .
431
461
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;
 
462
create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20)));
433
463
insert into t1 (b) values ('a'),('b'),('c');
434
464
select concat(b,'.') from t1;
435
465
concat(b,'.')
444
474
select * from t1;
445
475
a       b
446
476
1       a
447
 
2       b  
 
477
2       b 
448
478
3       c
449
479
delete from t1 where b='b';
450
480
select a,concat(b,'.') from t1;
452
482
1       a.
453
483
3       c.
454
484
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;
 
485
create table t1 (a int not null);
 
486
create table t2 (a int not null, primary key (a));
457
487
insert into t1 values (1);
458
488
insert into t2 values (1),(2);
459
489
select sql_big_result distinct t1.a from t1,t2 order by t2.a;
467
497
1
468
498
explain select sql_big_result distinct t1.a from t1,t2 order by t2.a;
469
499
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
 
500
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    1       Using temporary; Using filesort
 
501
1       SIMPLE  t2      index   NULL    PRIMARY 4       NULL    2       Using index; Distinct; Using join buffer
472
502
explain select distinct t1.a from t1,t2 order by t2.a;
473
503
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
 
504
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    1       Using temporary; Using filesort
 
505
1       SIMPLE  t2      index   NULL    PRIMARY 4       NULL    2       Using index; Distinct; Using join buffer
476
506
drop table t1,t2;
477
 
create temporary table t1 (
 
507
create table t1 (
478
508
c1 varchar(32),
479
509
key (c1)
480
510
) engine=myisam;
484
514
c1
485
515
a
486
516
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;
 
517
create table t1 (a int, b varchar(200), c text not null) checksum=1;
 
518
create table t2 (a int, b varchar(200), c text not null) checksum=0;
489
519
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
490
520
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  #       #       #       #       #
 
521
checksum table t1, t2, t3 quick;
 
522
Table   Checksum
 
523
test.t1 NULL
 
524
test.t2 NULL
 
525
test.t3 NULL
 
526
Warnings:
 
527
Error   1146    Table 'test.t3' doesn't exist
 
528
checksum table t1, t2, t3;
 
529
Table   Checksum
 
530
test.t1 2948697075
 
531
test.t2 2948697075
 
532
test.t3 NULL
 
533
Warnings:
 
534
Error   1146    Table 'test.t3' doesn't exist
 
535
checksum table t1, t2, t3 extended;
 
536
Table   Checksum
 
537
test.t1 2948697075
 
538
test.t2 2948697075
 
539
test.t3 NULL
 
540
Warnings:
 
541
Error   1146    Table 'test.t3' doesn't exist
495
542
drop table t1,t2;
496
 
create temporary table t1 ( a tinytext, b char(1), index idx (a(1),b) ) engine=myisam;
 
543
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
497
544
insert into t1 values (null,''), (null,'');
498
545
explain select count(*) from t1 where a is null;
499
546
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
502
549
count(*)
503
550
2
504
551
drop table t1;
505
 
create temporary table t1 (c1 int, c2 varchar(4) not null default '',
506
 
key(c2(3))) engine=myisam;
 
552
create table t1 (c1 int, c2 varchar(4) not null default '',
 
553
key(c2(3)));
507
554
insert into t1 values (1,'A'), (2, 'B'), (3, 'A');
508
555
update t1 set c2='A  B' where c1=2;
509
556
check table t1;
510
557
Table   Op      Msg_type        Msg_text
511
558
test.t1 check   status  OK
512
559
drop table t1;
513
 
create temporary table t1(
 
560
create table t1 (c1 int);
 
561
insert into t1 values (1),(2),(3),(4);
 
562
checksum table t1;
 
563
Table   Checksum
 
564
test.t1 149057747
 
565
delete from t1 where c1 = 1;
 
566
create table t2 as select * from t1;
 
567
checksum table t1;
 
568
Table   Checksum
 
569
test.t1 984116287
 
570
checksum table t2;
 
571
Table   Checksum
 
572
test.t2 984116287
 
573
drop table t1, t2;
 
574
create table t1(
514
575
cip INT NOT NULL,
515
576
score INT NOT NULL DEFAULT 0,
516
577
bob TINYBLOB
517
 
) engine=myisam;
 
578
);
518
579
insert into t1 (cip) VALUES (1), (2), (3);
519
580
insert into t1 (cip, bob) VALUES (4, 'a' ), (5, 'b'), 
520
581
(6, 'c');
526
587
cip     score   bob
527
588
1       0       NULL
528
589
drop table t1;
529
 
create temporary table t1 (
 
590
create table t1 (
530
591
id1 int not null auto_increment,
531
592
id2 int not null default '0',
532
593
t text not null,
544
605
count(id1)
545
606
5
546
607
drop table t1;
547
 
CREATE TEMPORARY TABLE t1(a int, KEY(a)) ENGINE=MyISAM;
 
608
CREATE TABLE t1(a int, KEY(a)) ENGINE=MyISAM;
548
609
INSERT INTO t1 VALUES(1);
549
610
SELECT MAX(a) FROM t1 IGNORE INDEX(a);
550
611
MAX(a)
557
618
MAX(a)
558
619
1
559
620
DROP TABLE t1;
560
 
CREATE TEMPORARY TABLE t1 (
561
 
`_id` int NOT NULL default '0',
562
 
`url` text,
563
 
`email` text,
564
 
`description` text,
565
 
`loverlap` int default NULL,
566
 
`roverlap` int default NULL,
567
 
`lneighbor_id` int default NULL,
568
 
`rneighbor_id` int default NULL,
569
 
`length_` int default NULL,
570
 
`sequence` text,
571
 
`name` text,
572
 
`_obj_class` text NOT NULL,
573
 
PRIMARY KEY  (`_id`),
574
 
UNIQUE KEY `sequence_name_index` (`name`(50)),
575
 
KEY (`length_`)
576
 
) ENGINE=MyISAM;
577
 
INSERT INTO t1 VALUES
578
 
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
579
 
(2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
580
 
(3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample3',''),
581
 
(4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample4',''),
582
 
(5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample5',''),
583
 
(6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample6',''),
584
 
(7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample7',''),
585
 
(8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample8',''),
586
 
(9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample9','');
587
 
SELECT _id FROM t1;
588
 
_id
589
 
1
590
 
2
591
 
3
592
 
4
593
 
5
594
 
6
595
 
7
596
 
8
597
 
9
598
 
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  #       #       #       #       #
612
 
SELECT _id FROM t1;
613
 
_id
614
 
8
615
 
9
616
 
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  #       #       #       #       #
621
 
DROP TABLE t1;
622
 
CREATE TEMPORARY TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM;
 
621
CREATE TABLE t1(a CHAR(9), b VARCHAR(7)) ENGINE=MyISAM;
 
622
INSERT INTO t1(a) VALUES('xxxxxxxxx'),('xxxxxxxxx');
 
623
UPDATE t1 AS ta1,t1 AS ta2 SET ta1.b='aaaaaa',ta2.b='bbbbbb';
 
624
SELECT * FROM t1;
 
625
a       b
 
626
xxxxxxxxx       bbbbbb
 
627
xxxxxxxxx       bbbbbb
 
628
DROP TABLE t1;
 
629
SET GLOBAL myisam_repair_threads=2;
 
630
SHOW VARIABLES LIKE 'myisam_repair%';
 
631
Variable_name   Value
 
632
myisam_repair_threads   2
 
633
CREATE TABLE t1 (
 
634
`_id` int NOT NULL default '0',
 
635
`url` text,
 
636
`email` text,
 
637
`description` text,
 
638
`loverlap` int default NULL,
 
639
`roverlap` int default NULL,
 
640
`lneighbor_id` int default NULL,
 
641
`rneighbor_id` int default NULL,
 
642
`length_` int default NULL,
 
643
`sequence` text,
 
644
`name` text,
 
645
`_obj_class` text NOT NULL,
 
646
PRIMARY KEY  (`_id`),
 
647
UNIQUE KEY `sequence_name_index` (`name`(50)),
 
648
KEY (`length_`)
 
649
) ENGINE=MyISAM;
 
650
INSERT INTO t1 VALUES
 
651
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
 
652
(2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
 
653
(3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample3',''),
 
654
(4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample4',''),
 
655
(5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample5',''),
 
656
(6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample6',''),
 
657
(7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample7',''),
 
658
(8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample8',''),
 
659
(9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample9','');
 
660
SELECT _id FROM t1;
 
661
_id
 
662
1
 
663
2
 
664
3
 
665
4
 
666
5
 
667
6
 
668
7
 
669
8
 
670
9
 
671
DELETE FROM t1 WHERE _id < 8;
 
672
SHOW TABLE STATUS LIKE 't1';
 
673
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
 
674
t1      MyISAM  0       Dynamic 2       #       #       #       #       168     #       #       #       #       #       #               
 
675
CHECK TABLE t1 EXTENDED;
 
676
Table   Op      Msg_type        Msg_text
 
677
test.t1 check   status  OK
 
678
OPTIMIZE TABLE t1;
 
679
Table   Op      Msg_type        Msg_text
 
680
test.t1 optimize        status  OK
 
681
CHECK TABLE t1 EXTENDED;
 
682
Table   Op      Msg_type        Msg_text
 
683
test.t1 check   status  OK
 
684
SHOW TABLE STATUS LIKE 't1';
 
685
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
 
686
t1      MyISAM  0       Dynamic 2       #       #       #       #       0       #       #       #       #       #       #               
 
687
SELECT _id FROM t1;
 
688
_id
 
689
8
 
690
9
 
691
DROP TABLE t1;
 
692
CREATE TABLE t1 (
 
693
`_id` int NOT NULL default '0',
 
694
`url` text,
 
695
`email` text,
 
696
`description` text,
 
697
`loverlap` int default NULL,
 
698
`roverlap` int default NULL,
 
699
`lneighbor_id` int default NULL,
 
700
`rneighbor_id` int default NULL,
 
701
`length_` int default NULL,
 
702
`sequence` text,
 
703
`name` text,
 
704
`_obj_class` text NOT NULL,
 
705
PRIMARY KEY  (`_id`),
 
706
UNIQUE KEY `sequence_name_index` (`name`(50)),
 
707
KEY (`length_`)
 
708
) ENGINE=MyISAM;
 
709
INSERT INTO t1 VALUES
 
710
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
 
711
(2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
 
712
(3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample3',''),
 
713
(4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample4',''),
 
714
(5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample5',''),
 
715
(6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample6',''),
 
716
(7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample7',''),
 
717
(8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample8',''),
 
718
(9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample9','');
 
719
SELECT _id FROM t1;
 
720
_id
 
721
1
 
722
2
 
723
3
 
724
4
 
725
5
 
726
6
 
727
7
 
728
8
 
729
9
 
730
DELETE FROM t1 WHERE _id < 8;
 
731
SHOW TABLE STATUS LIKE 't1';
 
732
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
 
733
t1      MyISAM  0       Dynamic 2       #       #       #       #       168     #       #       #       #       #       #               
 
734
CHECK TABLE t1 EXTENDED;
 
735
Table   Op      Msg_type        Msg_text
 
736
test.t1 check   status  OK
 
737
REPAIR TABLE t1 QUICK;
 
738
Table   Op      Msg_type        Msg_text
 
739
test.t1 repair  status  OK
 
740
CHECK TABLE t1 EXTENDED;
 
741
Table   Op      Msg_type        Msg_text
 
742
test.t1 check   status  OK
 
743
SHOW TABLE STATUS LIKE 't1';
 
744
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
 
745
t1      MyISAM  0       Dynamic 2       #       #       #       #       168     #       #       #       #       #       #               
 
746
SELECT _id FROM t1;
 
747
_id
 
748
8
 
749
9
 
750
DROP TABLE t1;
 
751
SET GLOBAL myisam_repair_threads=1;
 
752
SHOW VARIABLES LIKE 'myisam_repair%';
 
753
Variable_name   Value
 
754
myisam_repair_threads   1
 
755
CREATE TABLE t1(a VARCHAR(16)) ENGINE=MyISAM;
 
756
INSERT INTO t1 VALUES('aaaaaaaa'),(NULL);
 
757
UPDATE t1 AS ta1, t1 AS ta2 SET ta1.a='aaaaaaaaaaaaaaaa';
 
758
SELECT * FROM t1;
 
759
a
 
760
aaaaaaaaaaaaaaaa
 
761
aaaaaaaaaaaaaaaa
 
762
DROP TABLE t1;
 
763
CREATE TABLE t1(a INT) ENGINE=MyISAM;
 
764
INSERT INTO t1 VALUES(1),(2);
 
765
UPDATE t1,t1 AS t2 SET t1.a=t1.a+2 WHERE t1.a=t2.a-1;
 
766
SELECT * FROM t1 ORDER BY a;
 
767
a
 
768
2
 
769
3
 
770
DROP TABLE t1;
 
771
CREATE TABLE t1 (c1 TEXT) ENGINE=MyISAM AVG_ROW_LENGTH=70100 MAX_ROWS=4100100100;
 
772
SHOW TABLE STATUS LIKE 't1';
 
773
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
 
774
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        
 
775
DROP TABLE t1;
 
776
CREATE TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM;
623
777
INSERT INTO t1 VALUES
624
778
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
625
779
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
774
928
drop table if exists t1,t2,t3;
775
929
--- Testing varchar ---
776
930
--- Testing varchar ---
777
 
create TEMPORARY table t1 (v varchar(10), c char(10), t text);
 
931
create table t1 (v varchar(10), c char(10), t text);
778
932
insert into t1 values('+ ', '+ ', '+ ');
779
933
set @a=repeat(' ',20);
780
934
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));
 
935
Warnings:
 
936
Note    1265    Data truncated for column 'v' at row 1
 
937
Note    1265    Data truncated for column 'c' at row 1
787
938
select concat('*',v,'*',c,'*',t,'*') from t1;
788
939
concat('*',v,'*',c,'*',t,'*')
789
940
*+ *+ *+ *
790
 
*+         *+         *+         *
 
941
*+         *+         *+                    *
791
942
show create table t1;
792
943
Table   Create Table
793
 
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
798
 
create TEMPORARY table t2 like t1;
 
944
t1      CREATE TABLE `t1` (
 
945
  `v` varchar(10) DEFAULT NULL,
 
946
  `c` varchar(10) DEFAULT NULL,
 
947
  `t` text
 
948
) ENGINE=MyISAM
 
949
create table t2 like t1;
799
950
show create table t2;
800
951
Table   Create Table
801
 
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
806
 
create TEMPORARY table t3 select * from t1;
 
952
t2      CREATE TABLE `t2` (
 
953
  `v` varchar(10) DEFAULT NULL,
 
954
  `c` varchar(10) DEFAULT NULL,
 
955
  `t` text
 
956
) ENGINE=MyISAM
 
957
create table t3 select * from t1;
807
958
show create table t3;
808
959
Table   Create Table
809
 
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
 
960
t3      CREATE TABLE `t3` (
 
961
  `v` varchar(10) DEFAULT NULL,
 
962
  `c` varchar(10) DEFAULT NULL,
 
963
  `t` text
 
964
) ENGINE=MyISAM
814
965
alter table t1 modify c varchar(10);
815
966
show create table t1;
816
967
Table   Create Table
817
 
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
 
968
t1      CREATE TABLE `t1` (
 
969
  `v` varchar(10) DEFAULT NULL,
 
970
  `c` varchar(10) DEFAULT NULL,
 
971
  `t` text
 
972
) ENGINE=MyISAM
822
973
alter table t1 modify v char(10);
823
974
show create table t1;
824
975
Table   Create Table
825
 
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
 
976
t1      CREATE TABLE `t1` (
 
977
  `v` varchar(10) DEFAULT NULL,
 
978
  `c` varchar(10) DEFAULT NULL,
 
979
  `t` text
 
980
) ENGINE=MyISAM
830
981
alter table t1 modify t varchar(10);
 
982
Warnings:
 
983
Note    1265    Data truncated for column 't' at row 2
831
984
show create table t1;
832
985
Table   Create Table
833
 
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
 
986
t1      CREATE TABLE `t1` (
 
987
  `v` varchar(10) DEFAULT NULL,
 
988
  `c` varchar(10) DEFAULT NULL,
 
989
  `t` varchar(10) DEFAULT NULL
 
990
) ENGINE=MyISAM
838
991
select concat('*',v,'*',c,'*',t,'*') from t1;
839
992
concat('*',v,'*',c,'*',t,'*')
840
993
*+ *+ *+ *
841
994
*+         *+         *+         *
842
995
drop table t1,t2,t3;
843
 
create TEMPORARY table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
 
996
create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
844
997
show create table t1;
845
998
Table   Create Table
846
 
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,
 
999
t1      CREATE TABLE `t1` (
 
1000
  `v` varchar(10) DEFAULT NULL,
 
1001
  `c` varchar(10) DEFAULT NULL,
 
1002
  `t` text,
850
1003
  KEY `v` (`v`),
851
1004
  KEY `c` (`c`),
852
 
  KEY `t` (`t`(10))
853
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
1005
  KEY `t` (`t`())
 
1006
) ENGINE=MyISAM
854
1007
select count(*) from t1;
855
1008
count(*)
856
1009
270
1062
1215
alter table t1 modify v varchar(300), drop key v, drop key v_2, add key v (v);
1063
1216
show create table t1;
1064
1217
Table   Create Table
1065
 
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,
 
1218
t1      CREATE TABLE `t1` (
 
1219
  `v` varchar(300) DEFAULT NULL,
 
1220
  `c` varchar(10) DEFAULT NULL,
 
1221
  `t` text,
1069
1222
  KEY `c` (`c`),
1070
 
  KEY `t` (`t`(10)),
 
1223
  KEY `t` (`t`()),
1071
1224
  KEY `v` (`v`)
1072
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
1225
) ENGINE=MyISAM
1073
1226
select count(*) from t1 where v='a';
1074
1227
count(*)
1075
1228
10
1142
1295
alter table t1 drop key v, add key v (v(30));
1143
1296
show create table t1;
1144
1297
Table   Create Table
1145
 
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,
 
1298
t1      CREATE TABLE `t1` (
 
1299
  `v` varchar(300) DEFAULT NULL,
 
1300
  `c` varchar(10) DEFAULT NULL,
 
1301
  `t` text,
1149
1302
  KEY `c` (`c`),
1150
 
  KEY `t` (`t`(10)),
1151
 
  KEY `v` (`v`(30))
1152
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
1303
  KEY `t` (`t`()),
 
1304
  KEY `v` (`v`())
 
1305
) ENGINE=MyISAM
1153
1306
select count(*) from t1 where v='a';
1154
1307
count(*)
1155
1308
10
1222
1375
alter table t1 modify v varchar(600), drop key v, add key v (v);
1223
1376
Warnings:
1224
1377
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1378
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1379
Warning 1071    Specified key was too long; max key length is 1332 bytes
1225
1380
show create table t1;
1226
1381
Table   Create Table
1227
 
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,
 
1382
t1      CREATE TABLE `t1` (
 
1383
  `v` varchar(600) DEFAULT NULL,
 
1384
  `c` varchar(10) DEFAULT NULL,
 
1385
  `t` text,
1231
1386
  KEY `c` (`c`),
1232
 
  KEY `t` (`t`(10)),
1233
 
  KEY `v` (`v`(333))
1234
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
1387
  KEY `t` (`t`()),
 
1388
  KEY `v` (`v`())
 
1389
) ENGINE=MyISAM
1235
1390
select v,count(*) from t1 group by v limit 10;
1236
1391
v       count(*)
1237
1392
a      1
1269
1424
h       10
1270
1425
i       10
1271
1426
drop table t1;
1272
 
create TEMPORARY table t1 (a char(10), unique (a));
 
1427
create table t1 (a char(10), unique (a));
1273
1428
insert into t1 values ('a   ');
1274
1429
insert into t1 values ('a ');
1275
1430
ERROR 23000: Duplicate entry 'a ' for key 'a'
1279
1434
insert into t1 values ('a     ');
1280
1435
ERROR 23000: Duplicate entry 'a     ' for key 'a'
1281
1436
insert into t1 values ('a          ');
1282
 
ERROR 22001: Data too long for column 'a' at row 1
 
1437
ERROR 23000: Duplicate entry 'a         ' for key 'a'
1283
1438
insert into t1 values ('a ');
1284
1439
ERROR 23000: Duplicate entry 'a ' for key 'a'
1285
1440
update t1 set a='a  ' where a like 'a%';
1299
1454
concat(a,'.')
1300
1455
a  .
1301
1456
drop table t1;
1302
 
create TEMPORARY table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
1303
 
show create table t1;
1304
 
Table   Create Table
1305
 
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,
1309
 
  KEY `v` (`v`(5)),
1310
 
  KEY `c` (`c`(5)),
1311
 
  KEY `t` (`t`(5))
1312
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
1313
 
drop table t1;
1314
 
create TEMPORARY table t1 (v char(10));
1315
 
show create table t1;
1316
 
Table   Create Table
1317
 
t1      CREATE TEMPORARY TABLE `t1` (
1318
 
  `v` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL
1319
 
) ENGINE=MyISAM COLLATE = utf8_general_ci
1320
 
drop table t1;
1321
 
create TEMPORARY table t1 (v varchar(10), c char(10));
1322
 
show create table t1;
1323
 
Table   Create Table
1324
 
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
 
1457
create table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
 
1458
show create table t1;
 
1459
Table   Create Table
 
1460
t1      CREATE TABLE `t1` (
 
1461
  `v` varchar(10) DEFAULT NULL,
 
1462
  `c` varchar(10) DEFAULT NULL,
 
1463
  `t` text,
 
1464
  KEY `v` (`v`()),
 
1465
  KEY `c` (`c`()),
 
1466
  KEY `t` (`t`())
 
1467
) ENGINE=MyISAM
 
1468
drop table t1;
 
1469
create table t1 (v char(10));
 
1470
show create table t1;
 
1471
Table   Create Table
 
1472
t1      CREATE TABLE `t1` (
 
1473
  `v` varchar(10) DEFAULT NULL
 
1474
) ENGINE=MyISAM
 
1475
drop table t1;
 
1476
create table t1 (v varchar(10), c char(10)) row_format=fixed;
 
1477
show create table t1;
 
1478
Table   Create Table
 
1479
t1      CREATE TABLE `t1` (
 
1480
  `v` varchar(10) DEFAULT NULL,
 
1481
  `c` varchar(10) DEFAULT NULL
 
1482
) ENGINE=MyISAM ROW_FORMAT=FIXED
1328
1483
insert into t1 values('a','a'),('a ','a ');
1329
1484
select concat('*',v,'*',c,'*') from t1;
1330
1485
concat('*',v,'*',c,'*')
1331
1486
*a*a*
1332
1487
*a *a *
1333
1488
drop table t1;
1334
 
create TEMPORARY table t1(a int, b varchar(12), key ba(b, a));
 
1489
create table t1(a int, b varchar(12), key ba(b, a));
1335
1490
insert into t1 values (1, 'A'), (20, NULL);
1336
1491
explain select * from t1 where a=20 and b is null;
1337
1492
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1340
1495
a       b
1341
1496
20      NULL
1342
1497
drop table t1;
1343
 
create temporary table t1 (v varchar(65530), key(v));
1344
 
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1345
 
create temporary table t1 (v varchar(65536));
1346
 
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1347
 
create temporary table t1 (v varchar(65530));
1348
 
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1349
 
create temporary table t1 (v varchar(65535));
 
1498
create table t1 (v varchar(65530), key(v));
 
1499
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
 
1500
create table t1 (v varchar(65536));
 
1501
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
 
1502
create table t1 (v varchar(65530));
 
1503
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
 
1504
create table t1 (v varchar(65535));
1350
1505
ERROR 42000: Column length too big for column 'v' (max = 16383); use BLOB or TEXT instead
1351
1506
set storage_engine=InnoDB;
1352
 
create temporary table t1 (a int, key(a)) engine=myisam;
 
1507
create table t1 (a int, key(a));
1353
1508
insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
1354
1509
analyze table t1;
1355
1510
Table   Op      Msg_type        Msg_text
1356
 
test.t1 analyze note    The storage engine for the table doesn't support analyze
 
1511
test.t1 analyze status  OK
1357
1512
show keys from t1;
1358
 
Table   Unique  Key_name        Seq_in_index    Column_name
1359
 
t1      NO      a       1       a
 
1513
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
 
1514
t1      1       a       1       a       A       8       NULL    NULL    YES     BTREE           
1360
1515
alter table t1 disable keys;
 
1516
Warnings:
 
1517
Note    1031    Table storage engine for 't1' doesn't have this option
1361
1518
alter table t1 enable keys;
 
1519
Warnings:
 
1520
Note    1031    Table storage engine for 't1' doesn't have this option
1362
1521
show keys from t1;
1363
 
Table   Unique  Key_name        Seq_in_index    Column_name
1364
 
t1      NO      a       1       a
 
1522
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
 
1523
t1      1       a       1       a       A       8       NULL    NULL    YES     BTREE           
1365
1524
drop table t1;
1366
 
CREATE TEMPORARY TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
 
1525
create table t1 (c1 int) engine=myisam pack_keys=0;
 
1526
create table t2 (c1 int) engine=myisam pack_keys=1;
 
1527
create table t3 (c1 int) engine=myisam pack_keys=default;
 
1528
create table t4 (c1 int) engine=myisam pack_keys=2;
 
1529
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
 
1530
drop table t1, t2, t3;
 
1531
CREATE TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
1367
1532
INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5);
1368
1533
SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
1369
1534
a
1389
1554
a
1390
1555
1
1391
1556
DROP TABLE t1;
1392
 
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  #       #       #       #       #
 
1557
CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
 
1558
SHOW TABLE STATUS LIKE 't1';
 
1559
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
 
1560
t1      MyISAM  0       Fixed   0       #       #       #       1024    #       #       #       #       #       #       #               
1396
1561
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  #       #       #       #       #
 
1562
SHOW TABLE STATUS LIKE 't1';
 
1563
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
 
1564
t1      MyISAM  0       Fixed   1       #       #       #       3072    #       #       #       #       #       #       #               
 
1565
ALTER TABLE t1 DISABLE KEYS;
 
1566
SHOW TABLE STATUS LIKE 't1';
 
1567
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
 
1568
t1      MyISAM  0       Fixed   1       #       #       #       3072    #       #       #       #       #       #       #               
 
1569
ALTER TABLE t1 ENABLE KEYS;
 
1570
SHOW TABLE STATUS LIKE 't1';
 
1571
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
 
1572
t1      MyISAM  0       Fixed   1       #       #       #       3072    #       #       #       #       #       #       #               
 
1573
ALTER TABLE t1 DISABLE KEYS;
 
1574
SHOW TABLE STATUS LIKE 't1';
 
1575
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
 
1576
t1      MyISAM  0       Fixed   1       #       #       #       3072    #       #       #       #       #       #       #               
 
1577
ALTER TABLE t1 ENABLE KEYS;
 
1578
SHOW TABLE STATUS LIKE 't1';
 
1579
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
 
1580
t1      MyISAM  0       Fixed   1       #       #       #       3072    #       #       #       #       #       #       #               
1416
1581
# Enable keys with parallel repair
 
1582
SET GLOBAL myisam_repair_threads=2;
1417
1583
ALTER TABLE t1 DISABLE KEYS;
1418
1584
ALTER TABLE t1 ENABLE KEYS;
1419
 
CHECK TABLE t1;
 
1585
SET GLOBAL myisam_repair_threads=1;
 
1586
CHECK TABLE t1 EXTENDED;
1420
1587
Table   Op      Msg_type        Msg_text
1421
1588
test.t1 check   status  OK
1422
1589
DROP TABLE t1;
1423
 
CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id));
 
1590
CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id)) ENGINE=MyISAM;
1424
1591
CREATE TABLE t2 LIKE t1;
1425
1592
INSERT INTO t2 (id, ref) VALUES (1,3), (2,1), (3,2), (4,5), (4,4);
1426
1593
INSERT INTO t1 SELECT * FROM t2;
1434
1601
3       2
1435
1602
4       5
1436
1603
4       4
 
1604
DELETE FROM a USING t1 AS a INNER JOIN t1 AS b USING (id) WHERE a.ref < b.ref;
 
1605
SELECT * FROM t1;
 
1606
id      ref
 
1607
1       3
 
1608
2       1
 
1609
3       2
 
1610
4       5
1437
1611
DROP TABLE t1, t2;
1438
1612
End of 5.0 tests
1439
 
CREATE temporary TABLE t1 (
 
1613
create table t1 (a int not null, key `a` (a) key_block_size=1024) ENGINE=MyISAM;
 
1614
show create table t1;
 
1615
Table   Create Table
 
1616
t1      CREATE TABLE `t1` (
 
1617
  `a` int NOT NULL,
 
1618
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024
 
1619
) ENGINE=MyISAM
 
1620
drop table t1;
 
1621
create table t1 (a int not null, key `a` (a) key_block_size=2048) ENGINE=MyISAM;
 
1622
show create table t1;
 
1623
Table   Create Table
 
1624
t1      CREATE TABLE `t1` (
 
1625
  `a` int NOT NULL,
 
1626
  KEY `a` (`a`) KEY_BLOCK_SIZE=2048
 
1627
) ENGINE=MyISAM
 
1628
drop table t1;
 
1629
create table t1 (a varchar(2048), key `a` (a)) ENGINE=MyISAM;
 
1630
Warnings:
 
1631
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1632
show create table t1;
 
1633
Table   Create Table
 
1634
t1      CREATE TABLE `t1` (
 
1635
  `a` varchar(2048) DEFAULT NULL,
 
1636
  KEY `a` (`a`())
 
1637
) ENGINE=MyISAM
 
1638
drop table t1;
 
1639
create table t1 (a varchar(2048), key `a` (a) key_block_size=1024) ENGINE=MyISAM;
 
1640
Warnings:
 
1641
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1642
show create table t1;
 
1643
Table   Create Table
 
1644
t1      CREATE TABLE `t1` (
 
1645
  `a` varchar(2048) DEFAULT NULL,
 
1646
  KEY `a` (`a`()) KEY_BLOCK_SIZE=6144
 
1647
) ENGINE=MyISAM
 
1648
drop table t1;
 
1649
create table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=1024;
 
1650
Warnings:
 
1651
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1652
show create table t1;
 
1653
Table   Create Table
 
1654
t1      CREATE TABLE `t1` (
 
1655
  `a` int NOT NULL,
 
1656
  `b` varchar(2048) DEFAULT NULL,
 
1657
  KEY `a` (`a`),
 
1658
  KEY `b` (`b`()) KEY_BLOCK_SIZE=6144
 
1659
) ENGINE=MyISAM KEY_BLOCK_SIZE=1024
 
1660
alter table t1 key_block_size=2048;
 
1661
show create table t1;
 
1662
Table   Create Table
 
1663
t1      CREATE TABLE `t1` (
 
1664
  `a` int NOT NULL,
 
1665
  `b` varchar(2048) DEFAULT NULL,
 
1666
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
 
1667
  KEY `b` (`b`()) KEY_BLOCK_SIZE=8192
 
1668
) ENGINE=MyISAM KEY_BLOCK_SIZE=2048
 
1669
alter table t1 add c int, add key (c);
 
1670
show create table t1;
 
1671
Table   Create Table
 
1672
t1      CREATE TABLE `t1` (
 
1673
  `a` int NOT NULL,
 
1674
  `b` varchar(2048) DEFAULT NULL,
 
1675
  `c` int DEFAULT NULL,
 
1676
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
 
1677
  KEY `b` (`b`()) KEY_BLOCK_SIZE=8192,
 
1678
  KEY `c` (`c`)
 
1679
) ENGINE=MyISAM KEY_BLOCK_SIZE=2048
 
1680
alter table t1 key_block_size=0;
 
1681
alter table t1 add d int, add key (d);
 
1682
show create table t1;
 
1683
Table   Create Table
 
1684
t1      CREATE TABLE `t1` (
 
1685
  `a` int NOT NULL,
 
1686
  `b` varchar(2048) DEFAULT NULL,
 
1687
  `c` int DEFAULT NULL,
 
1688
  `d` int DEFAULT NULL,
 
1689
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
 
1690
  KEY `b` (`b`()) KEY_BLOCK_SIZE=8192,
 
1691
  KEY `c` (`c`) KEY_BLOCK_SIZE=2048,
 
1692
  KEY `d` (`d`)
 
1693
) ENGINE=MyISAM
 
1694
drop table t1;
 
1695
create table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=8192;
 
1696
Warnings:
 
1697
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1698
show create table t1;
 
1699
Table   Create Table
 
1700
t1      CREATE TABLE `t1` (
 
1701
  `a` int NOT NULL,
 
1702
  `b` varchar(2048) DEFAULT NULL,
 
1703
  KEY `a` (`a`),
 
1704
  KEY `b` (`b`())
 
1705
) ENGINE=MyISAM KEY_BLOCK_SIZE=8192
 
1706
drop table t1;
 
1707
create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) ENGINE=MyISAM key_block_size=8192;
 
1708
Warnings:
 
1709
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1710
show create table t1;
 
1711
Table   Create Table
 
1712
t1      CREATE TABLE `t1` (
 
1713
  `a` int NOT NULL,
 
1714
  `b` varchar(2048) DEFAULT NULL,
 
1715
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
 
1716
  KEY `b` (`b`())
 
1717
) ENGINE=MyISAM KEY_BLOCK_SIZE=8192
 
1718
drop table t1;
 
1719
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;
 
1720
show create table t1;
 
1721
Table   Create Table
 
1722
t1      CREATE TABLE `t1` (
 
1723
  `a` int NOT NULL,
 
1724
  `b` int DEFAULT NULL,
 
1725
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
 
1726
  KEY `b` (`b`) KEY_BLOCK_SIZE=8192
 
1727
) ENGINE=MyISAM KEY_BLOCK_SIZE=16384
 
1728
drop table t1;
 
1729
create table t1 (a int not null, key `a` (a) key_block_size=512) ENGINE=MyISAM;
 
1730
show create table t1;
 
1731
Table   Create Table
 
1732
t1      CREATE TABLE `t1` (
 
1733
  `a` int NOT NULL,
 
1734
  KEY `a` (`a`) KEY_BLOCK_SIZE=1024
 
1735
) ENGINE=MyISAM
 
1736
drop table t1;
 
1737
create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000) ENGINE=MyISAM;
 
1738
Warnings:
 
1739
Warning 1071    Specified key was too long; max key length is 1332 bytes
 
1740
show create table t1;
 
1741
Table   Create Table
 
1742
t1      CREATE TABLE `t1` (
 
1743
  `a` varchar(2048) DEFAULT NULL,
 
1744
  KEY `a` (`a`()) KEY_BLOCK_SIZE=6144
 
1745
) ENGINE=MyISAM
 
1746
drop table t1;
 
1747
create table t1 (a int not null, key `a` (a) key_block_size=1025) ENGINE=MyISAM;
 
1748
show create table t1;
 
1749
Table   Create Table
 
1750
t1      CREATE TABLE `t1` (
 
1751
  `a` int NOT NULL,
 
1752
  KEY `a` (`a`) KEY_BLOCK_SIZE=2048
 
1753
) ENGINE=MyISAM
 
1754
drop table t1;
 
1755
create table t1 (a int not null, key key_block_size=1024 (a)) ENGINE=MyISAM;
 
1756
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
 
1757
create table t1 (a int not null, key `a` key_block_size=1024 (a)) ENGINE=MyISAM;
 
1758
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
 
1759
CREATE TABLE t1 (
1440
1760
c1 INT,
1441
1761
c2 VARCHAR(300),
1442
1762
KEY (c1) KEY_BLOCK_SIZE 1024,
1468
1788
(33, REPEAT('x', CEIL(RAND() * 300))),
1469
1789
(34, REPEAT('y', CEIL(RAND() * 300))),
1470
1790
(35, REPEAT('z', CEIL(RAND() * 300)));
1471
 
CREATE TEMPORARY TABLE t2 AS SELECT * FROM t1;
1472
 
INSERT INTO t1 SELECT * FROM t2;
1473
 
DROP TABLE t2;
1474
 
CREATE TEMPORARY TABLE t2 AS SELECT * FROM t1;
1475
 
INSERT INTO t1 SELECT * FROM t2;
1476
 
DROP TABLE t2;
 
1791
INSERT INTO t1 SELECT * FROM t1;
 
1792
INSERT INTO t1 SELECT * FROM t1;
1477
1793
CHECK TABLE t1;
1478
1794
Table   Op      Msg_type        Msg_text
1479
1795
test.t1 check   status  OK
 
1796
REPAIR TABLE t1;
 
1797
Table   Op      Msg_type        Msg_text
 
1798
test.t1 repair  status  OK
1480
1799
DELETE FROM t1 WHERE c1 >= 10;
1481
1800
CHECK TABLE t1;
1482
1801
Table   Op      Msg_type        Msg_text
1483
1802
test.t1 check   status  OK
1484
1803
DROP TABLE t1;
1485
 
CREATE temporary TABLE t1 (
1486
 
c1 CHAR(130),
1487
 
c2 VARCHAR(1)
1488
 
) ENGINE=MyISAM;
1489
 
INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
1490
 
SELECT COUNT(*) FROM t1;
1491
 
COUNT(*)
1492
 
1
1493
 
CHECK TABLE t1;
1494
 
Table   Op      Msg_type        Msg_text
1495
 
test.t1 check   status  OK
1496
 
SELECT COUNT(*) FROM t1;
1497
 
COUNT(*)
1498
 
1
1499
 
CHECK TABLE t1;
1500
 
Table   Op      Msg_type        Msg_text
1501
 
test.t1 check   status  OK
1502
 
DROP TABLE t1;
1503
 
CREATE temporary TABLE t1 (
1504
 
c1 CHAR(130),
1505
 
c2 VARCHAR(1)
1506
 
) ENGINE=MyISAM;
1507
 
INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
1508
 
SELECT COUNT(*) FROM t1;
1509
 
COUNT(*)
1510
 
1
1511
 
CHECK TABLE t1;
1512
 
Table   Op      Msg_type        Msg_text
1513
 
test.t1 check   status  OK
1514
 
SELECT COUNT(*) FROM t1;
1515
 
COUNT(*)
1516
 
1
1517
 
CHECK TABLE t1;
1518
 
Table   Op      Msg_type        Msg_text
1519
 
test.t1 check   status  OK
1520
 
DROP TABLE t1;
1521
 
CREATE temporary TABLE t1 (
 
1804
CREATE TABLE t1 (
 
1805
c1 CHAR(130),
 
1806
c2 VARCHAR(1)
 
1807
) ENGINE=MyISAM;
 
1808
INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
 
1809
SELECT COUNT(*) FROM t1;
 
1810
COUNT(*)
 
1811
1
 
1812
CHECK TABLE t1;
 
1813
Table   Op      Msg_type        Msg_text
 
1814
test.t1 check   status  OK
 
1815
REPAIR TABLE t1;
 
1816
Table   Op      Msg_type        Msg_text
 
1817
test.t1 repair  status  OK
 
1818
SELECT COUNT(*) FROM t1;
 
1819
COUNT(*)
 
1820
1
 
1821
CHECK TABLE t1;
 
1822
Table   Op      Msg_type        Msg_text
 
1823
test.t1 check   status  OK
 
1824
DROP TABLE t1;
 
1825
CREATE TABLE t1 (
 
1826
c1 CHAR(130),
 
1827
c2 VARCHAR(1)
 
1828
) ENGINE=MyISAM;
 
1829
INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
 
1830
SELECT COUNT(*) FROM t1;
 
1831
COUNT(*)
 
1832
1
 
1833
CHECK TABLE t1 EXTENDED;
 
1834
Table   Op      Msg_type        Msg_text
 
1835
test.t1 check   status  OK
 
1836
REPAIR TABLE t1 EXTENDED;
 
1837
Table   Op      Msg_type        Msg_text
 
1838
test.t1 repair  status  OK
 
1839
SELECT COUNT(*) FROM t1;
 
1840
COUNT(*)
 
1841
1
 
1842
CHECK TABLE t1 EXTENDED;
 
1843
Table   Op      Msg_type        Msg_text
 
1844
test.t1 check   status  OK
 
1845
DROP TABLE t1;
 
1846
CREATE TABLE t1 (
1522
1847
c1 CHAR(130),
1523
1848
c2 VARCHAR(1)
1524
1849
) ENGINE=MyISAM;
1529
1854
SELECT COUNT(*) FROM t1;
1530
1855
COUNT(*)
1531
1856
2
1532
 
ALTER TABLE t1 ENGINE=MyISAM;
 
1857
OPTIMIZE TABLE t1;
 
1858
Table   Op      Msg_type        Msg_text
 
1859
test.t1 optimize        status  OK
1533
1860
SELECT COUNT(*) FROM t1;
1534
1861
COUNT(*)
1535
1862
2
1536
1863
DROP TABLE t1;
1537
 
CREATE temporary TABLE t1 (
 
1864
CREATE TABLE t1 (
1538
1865
c1 CHAR(130),
1539
1866
c2 VARCHAR(1),
1540
1867
KEY (c1)
1551
1878
CHECK TABLE t1;
1552
1879
Table   Op      Msg_type        Msg_text
1553
1880
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;
1591
 
Table   Op      Msg_type        Msg_text
1592
 
test.t1 check   status  OK
1593
 
DROP TABLE t1;
1594
 
CREATE temporary TABLE t1 (
 
1881
CHECK TABLE t1 EXTENDED;
 
1882
Table   Op      Msg_type        Msg_text
 
1883
test.t1 check   status  OK
 
1884
DROP TABLE t1;
 
1885
CREATE TABLE t1 (
 
1886
c1 CHAR(50),
 
1887
c2 VARCHAR(1)
 
1888
) ENGINE=MyISAM;
 
1889
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
 
1890
SELECT COUNT(*) FROM t1;
 
1891
COUNT(*)
 
1892
1
 
1893
CHECK TABLE t1;
 
1894
Table   Op      Msg_type        Msg_text
 
1895
test.t1 check   status  OK
 
1896
REPAIR TABLE t1;
 
1897
Table   Op      Msg_type        Msg_text
 
1898
test.t1 repair  status  OK
 
1899
SELECT COUNT(*) FROM t1;
 
1900
COUNT(*)
 
1901
1
 
1902
CHECK TABLE t1;
 
1903
Table   Op      Msg_type        Msg_text
 
1904
test.t1 check   status  OK
 
1905
DROP TABLE t1;
 
1906
CREATE TABLE t1 (
 
1907
c1 CHAR(50),
 
1908
c2 VARCHAR(1)
 
1909
) ENGINE=MyISAM;
 
1910
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
 
1911
SELECT COUNT(*) FROM t1;
 
1912
COUNT(*)
 
1913
1
 
1914
CHECK TABLE t1 EXTENDED;
 
1915
Table   Op      Msg_type        Msg_text
 
1916
test.t1 check   status  OK
 
1917
REPAIR TABLE t1 EXTENDED;
 
1918
Table   Op      Msg_type        Msg_text
 
1919
test.t1 repair  status  OK
 
1920
SELECT COUNT(*) FROM t1;
 
1921
COUNT(*)
 
1922
1
 
1923
CHECK TABLE t1 EXTENDED;
 
1924
Table   Op      Msg_type        Msg_text
 
1925
test.t1 check   status  OK
 
1926
DROP TABLE t1;
 
1927
CREATE TABLE t1 (
1595
1928
c1 CHAR(50),
1596
1929
c2 VARCHAR(1)
1597
1930
) ENGINE=MyISAM;
1602
1935
SELECT COUNT(*) FROM t1;
1603
1936
COUNT(*)
1604
1937
2
1605
 
ALTER TABLE t1 ENGINE=MyISAM;
 
1938
OPTIMIZE TABLE t1;
 
1939
Table   Op      Msg_type        Msg_text
 
1940
test.t1 optimize        status  OK
1606
1941
SELECT COUNT(*) FROM t1;
1607
1942
COUNT(*)
1608
1943
2
1609
1944
DROP TABLE t1;
1610
 
CREATE temporary TABLE t1 (
 
1945
CREATE TABLE t1 (
1611
1946
c1 CHAR(50),
1612
1947
c2 VARCHAR(1),
1613
1948
KEY (c1)
1624
1959
CHECK TABLE t1;
1625
1960
Table   Op      Msg_type        Msg_text
1626
1961
test.t1 check   status  OK
1627
 
CHECK TABLE t1;
 
1962
CHECK TABLE t1 EXTENDED;
1628
1963
Table   Op      Msg_type        Msg_text
1629
1964
test.t1 check   status  OK
1630
1965
DROP TABLE t1;