396
396
insert into t1 (a) values(1);
397
397
show table status like 't1';
398
398
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
399
t1 MyISAM 10 Fixed 1 37 X X X X X X X X latin1_swedish_ci NULL
399
t1 MyISAM 10 Fixed 1 37 X X X X X X X X utf8_general_ci NULL
400
400
alter table t1 modify a int;
401
401
show table status like 't1';
402
402
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
403
t1 MyISAM 10 Fixed 1 37 X X X X X X X X latin1_swedish_ci NULL
403
t1 MyISAM 10 Fixed 1 37 X X X X X X X X utf8_general_ci NULL
405
405
create table t1 (a int not null default 0, b int not null default 0, c int not null default 0, d int not null default 0, e int not null default 0, f int not null default 0, g int not null default 0, h int not null default 0,i int not null default 0, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
406
406
insert into t1 (a) values(1);
407
407
show table status like 't1';
408
408
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
409
t1 MyISAM 10 Fixed 1 37 X X X X X X X X latin1_swedish_ci NULL
412
create table t1 (a char(10) character set koi8r);
413
insert into t1 values ('����');
414
select a,hex(a) from t1;
417
alter table t1 change a a char(10) character set cp1251;
418
select a,hex(a) from t1;
421
alter table t1 change a a varbinary(4);
422
select a,hex(a) from t1;
425
alter table t1 change a a char(10) character set cp1251;
426
select a,hex(a) from t1;
429
alter table t1 change a a char(10) character set koi8r;
430
select a,hex(a) from t1;
433
alter table t1 change a a varchar(10) character set cp1251;
434
select a,hex(a) from t1;
437
alter table t1 change a a char(10) character set koi8r;
438
select a,hex(a) from t1;
441
alter table t1 change a a text character set cp1251;
442
select a,hex(a) from t1;
445
alter table t1 change a a char(10) character set koi8r;
446
select a,hex(a) from t1;
450
show create table t1;
452
t1 CREATE TABLE `t1` (
453
`a` varchar(10) CHARACTER SET koi8r
454
) ENGINE=InnoDB DEFAULT CHARSET=latin1
455
alter table t1 DEFAULT CHARACTER SET latin1;
456
show create table t1;
458
t1 CREATE TABLE `t1` (
459
`a` varchar(10) CHARACTER SET koi8r
460
) ENGINE=InnoDB DEFAULT CHARSET=latin1
461
alter table t1 CONVERT TO CHARACTER SET latin1;
462
show create table t1;
464
t1 CREATE TABLE `t1` (
466
) ENGINE=InnoDB DEFAULT CHARSET=latin1
467
alter table t1 DEFAULT CHARACTER SET cp1251;
468
show create table t1;
470
t1 CREATE TABLE `t1` (
471
`a` varchar(10) CHARACTER SET latin1
472
) ENGINE=InnoDB DEFAULT CHARSET=cp1251
474
create table t1 (myblob longblob,mytext longtext)
475
default charset latin1 collate latin1_general_cs;
476
show create table t1;
478
t1 CREATE TABLE `t1` (
480
`mytext` text COLLATE latin1_general_cs
481
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs
482
alter table t1 character set latin2;
483
show create table t1;
485
t1 CREATE TABLE `t1` (
487
`mytext` text CHARACTER SET latin1 COLLATE latin1_general_cs
488
) ENGINE=InnoDB DEFAULT CHARSET=latin2
409
t1 MyISAM 10 Fixed 1 37 X X X X X X X X utf8_general_ci NULL
490
411
CREATE TABLE t1 (a int PRIMARY KEY, b INT UNIQUE);
491
412
ALTER TABLE t1 DROP PRIMARY KEY;
509
430
ALTER TABLE T12207 DISCARD TABLESPACE;
510
431
ERROR HY000: Table storage engine for 'T12207' doesn't have this option
511
432
DROP TABLE T12207;
512
create table t1 (a text) character set koi8r;
513
insert into t1 values (_koi8r'����');
514
select hex(a) from t1;
517
alter table t1 convert to character set cp1251;
518
select hex(a) from t1;
522
433
create table t1 ( a timestamp );
523
434
alter table t1 add unique ( a(1) );
524
435
ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
1004
914
Table Create Table
1005
915
tt+1 CREATE TEMPORARY TABLE `tt+1` (
1007
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1008
918
SHOW CREATE TABLE `tt+2`;
1009
919
Table Create Table
1010
920
tt+2 CREATE TEMPORARY TABLE `tt+2` (
1012
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1013
923
DROP TABLE `tt+1`, `tt+2`;
1014
924
CREATE TEMPORARY TABLE `#sql1` (c1 INT);
1015
925
CREATE TEMPORARY TABLE `@0023sql2` (c1 INT);