1
SET DEFAULT_STORAGE_ENGINE='tokudb';
2
DROP TABLE IF EXISTS foo,bar;
3
set session tokudb_disable_slow_alter=ON;
4
create table foo (a int NOT NULL, b bigint NOT NULL, c tinyint NOT NULL, d int NOT NULL, primary key (b))engine=TokuDB;
5
insert into foo values (122,10,1,1000),(1,110,1,0),(0,3234,0,657),(0,0,0,0),(99,99,0,99), (-1,-1,-1,-1);
6
create table bar like foo;
7
alter table bar engine=MyISAM;
8
insert into bar select * from foo;
9
include/diff_tables.inc [test.foo, test.bar]
10
alter table foo add column e int default NULL first;
11
alter table bar add column e int default NULL first;
20
include/diff_tables.inc [test.foo, test.bar]
21
alter table foo drop column e;
22
alter table bar drop column e;
23
include/diff_tables.inc [test.foo, test.bar]
24
alter table foo add column e int default -1 first;
25
alter table bar add column e int default -1 first;
26
include/diff_tables.inc [test.foo, test.bar]
27
alter table foo drop column e;
28
alter table bar drop column e;
29
include/diff_tables.inc [test.foo, test.bar]
30
alter table foo add column e int NOT NULL default -1 first;
31
alter table bar add column e int NOT NULL default -1 first;
32
include/diff_tables.inc [test.foo, test.bar]
43
create table foo (a int, b int not null, c int, d int not null, e int, primary key (e))engine=TokuDB;
44
alter table foo drop column e;
45
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this XYZ version
46
create table bar like foo;
47
alter table bar engine=MyISAM;
48
insert into foo values (NULL, -1, NULL, -1,1),(0,0,0,0,0),(NULL,234,234,324,234),(98567,76,NULL,7668,90909);
49
insert into bar select * from foo;
50
include/diff_tables.inc [test.foo, test.bar]
51
alter table foo drop column b;
52
alter table bar drop column b;
53
include/diff_tables.inc [test.foo, test.bar]
54
alter table foo drop column d;
55
alter table bar drop column d;
56
include/diff_tables.inc [test.foo, test.bar]
57
alter table foo drop column a;
58
alter table bar drop column a;
59
include/diff_tables.inc [test.foo, test.bar]
62
create table foo (a varchar(20), b varchar(20) not null, c varchar(20), d varchar(20) not null, e int, primary key (e))engine=TokuDB;
63
alter table foo drop column e;
64
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this XYZ version
65
create table bar like foo;
66
alter table bar engine=MyISAM;
67
insert into foo values (NULL, "-1", NULL, "-1",1),("dfg0","0rrr","eee0","qwert",0),(NULL,"234","234","324",234),("98567","76",NULL,"7668","90909");
68
insert into bar select * from foo;
69
include/diff_tables.inc [test.foo, test.bar]
70
alter table foo drop column b;
71
alter table bar drop column b;
72
include/diff_tables.inc [test.foo, test.bar]
73
alter table foo drop column d;
74
alter table bar drop column d;
75
include/diff_tables.inc [test.foo, test.bar]
76
alter table foo drop column a;
77
alter table bar drop column a;
78
include/diff_tables.inc [test.foo, test.bar]
95
create table bar like foo;
96
alter table bar engine=MyISAM;
97
insert into foo values (NULL,-1,NULL,-1,NULL,-1,NULL,-1,NULL,-1,NULL,-1);
98
insert into foo values (-1,NULL,-1,NULL,-1,NULL,-1,NULL,-1,NULL,-1,NULL);
99
insert into foo values (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
100
insert into foo values (-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1);
101
insert into bar select * from foo;
102
include/diff_tables.inc [test.foo, test.bar]
104
a b c d e f g h aa bb cc dd
105
NULL -1 NULL -1 NULL -1 NULL -1 NULL -1 NULL -1
106
-1 NULL -1 NULL -1 NULL -1 NULL -1 NULL -1 NULL
107
NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
108
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
109
alter table foo drop column a, drop column aa, drop column c, drop column cc, drop column e, drop column f;
110
alter table bar drop column a, drop column aa, drop column c, drop column cc, drop column e, drop column f;
111
include/diff_tables.inc [test.foo, test.bar]
115
NULL NULL -1 NULL NULL NULL
116
NULL NULL NULL NULL NULL NULL
118
alter table foo add column a int default -1 first, add column aa int NOT NULL default -1 after h, add column c int default NULL after b, add column cc int default 0 after bb, add column f int default NULL after d, add column e int NOT NULL default 12345 after d;
119
alter table bar add column a int default -1 first, add column aa int NOT NULL default -1 after h, add column c int default NULL after b, add column cc int default 0 after bb, add column f int default NULL after d, add column e int NOT NULL default 12345 after d;
120
include/diff_tables.inc [test.foo, test.bar]
122
a b c d e f g h aa bb cc dd
123
-1 -1 NULL -1 12345 NULL NULL -1 -1 -1 0 -1
124
-1 NULL NULL NULL 12345 NULL -1 NULL -1 NULL 0 NULL
125
-1 NULL NULL NULL 12345 NULL NULL NULL -1 NULL 0 NULL
126
-1 -1 NULL -1 12345 NULL -1 -1 -1 -1 0 -1