1
#--source include/have_tokudb.inc
2
SET DEFAULT_STORAGE_ENGINE='tokudb';
5
DROP TABLE IF EXISTS foo,bar, foo_isam, bar_isam;
8
set session tokudb_disable_slow_alter=OFF;
9
let $diff_tables= test.foo, test.foo_isam;
11
create table foo (aa int, bb int, cc int, dd int, ee int, a int, b varchar(20), c int, d int, e int, primary key (e), key(d), unique key(c), key (b) clustering=yes)engine=TokuDB;
12
create table foo_isam like foo;
13
alter table foo_isam engine=MyISAM;
14
create table bar (a int) engine=TokuDB;
15
create table bar_isam like bar;
16
alter table bar_isam engine=MyISAM;
18
insert into foo values (1,10,100,1000,10000,1,"bb",10,100,1000);
19
insert into foo values (2,20,200,2000,20000,2,"bbb",20,200,2000);
20
insert into foo values (3,30,300,3000,30000,3,"bbbb",30,300,3000);
21
insert into foo_isam select * from foo;
24
alter table foo drop primary key;
25
alter table foo_isam drop primary key;
26
source include/diff_tables.inc;
27
alter table foo add primary key (e);
28
alter table foo_isam add primary key (e);
29
source include/diff_tables.inc;
30
alter table foo drop primary key, add primary key(a);
31
alter table foo_isam drop primary key, add primary key (a);
32
source include/diff_tables.inc;
34
--error ER_TABLE_CANT_HANDLE_FT
35
alter table foo add fulltext key(b);
36
--error ER_TABLE_CANT_HANDLE_SPKEYS
37
alter table foo add spatial key (aa);
39
# Supporting these should be trivial
40
alter table foo alter column cc set default 101010;
41
alter table foo_isam alter column cc set default 101010;
42
source include/diff_tables.inc;
43
alter table foo alter column cc set default NULL;
44
alter table foo_isam alter column cc set default NULL;
45
source include/diff_tables.inc;
46
alter table foo alter column cc drop default;
47
alter table foo_isam alter column cc drop default;
48
source include/diff_tables.inc;
51
alter table foo change column aa aaa int;
52
alter table foo_isam change column aa aaa int;
53
source include/diff_tables.inc;
54
alter table foo change column aaa aa int;
55
alter table foo_isam change column aaa aa int;
56
source include/diff_tables.inc;
59
alter table foo change column e epk int;
60
alter table foo_isam change column e epk int;
61
source include/diff_tables.inc;
62
alter table foo change column epk e int;
63
alter table foo_isam change column epk e int;
64
source include/diff_tables.inc;
66
show create table foo;
67
show create table foo_isam;
69
# the following changes of a column should be slow
70
alter table foo change column aa aa int NOT NULL;
71
alter table foo_isam change column aa aa int NOT NULL;
72
source include/diff_tables.inc;
73
alter table foo change column aa aa bigint;
74
alter table foo_isam change column aa aa bigint;
75
source include/diff_tables.inc;
76
alter table foo change column aa aa varchar(20);
77
alter table foo_isam change column aa aa varchar(20);
78
source include/diff_tables.inc;
79
alter table foo change column aa aa int after cc;
80
alter table foo_isam change column aa aa int after cc;
81
source include/diff_tables.inc;
84
alter table foo modify column aa int NOT NULL;
85
alter table foo_isam modify column aa int NOT NULL;
86
source include/diff_tables.inc;
87
alter table foo modify column aa bigint;
88
alter table foo_isam modify column aa bigint;
89
source include/diff_tables.inc;
90
alter table foo modify column aa varchar(20);
91
alter table foo_isam modify column aa varchar(20);
92
source include/diff_tables.inc;
93
alter table foo modify column aa int after cc;
94
alter table foo_isam modify column aa int after cc;
95
source include/diff_tables.inc;