1--source include/have_tokudb.inc
2SET DEFAULT_STORAGE_ENGINE='tokudb';
3
4--disable_warnings
5DROP TABLE IF EXISTS foo,bar;
6--enable_warnings
7
8set session tokudb_disable_slow_alter=ON;
9
10let $diff_tables= test.foo, test.bar;
11
12create table foo (a int NOT NULL, b bigint NOT NULL, c mediumint NOT NULL, primary key (a))engine=TokuDB;
13create table bar like foo;
14alter table bar engine=MyISAM;
15
16insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
17insert into bar select * from foo;
18
19alter table foo add column d int default 20;
20alter table bar add column d int default 20;
21source include/diff_tables.inc;
22select * from foo;
23insert into foo values (3,30,300,3000);
24insert into bar values (3,30,300,3000);
25select * from foo;
26
27alter table foo drop column d;
28alter table bar drop column d;
29source include/diff_tables.inc;
30select * from foo;
31insert into foo values (4,40,400);
32insert into bar values (4,40,400);
33select * from foo;
34
35alter table foo add column d int default 20 first;
36alter table bar add column d int default 20 first;
37source include/diff_tables.inc;
38select * from foo;
39insert into foo values (5,50,500,5000);
40insert into bar values (5,50,500,5000);
41select * from foo;
42
43alter table foo drop column d;
44alter table bar drop column d;
45source include/diff_tables.inc;
46select * from foo;
47insert into foo values (6,60,600);
48insert into bar values (6,60,600);
49select * from foo;
50
51drop table foo;
52drop table bar;
53
54create table foo (a int NOT NULL, b bigint NOT NULL, c mediumint NOT NULL, primary key (c))engine=TokuDB;
55create table bar like foo;
56alter table bar engine=MyISAM;
57
58insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
59insert into bar select * from foo;
60
61alter table foo add column d int default 20;
62alter table bar add column d int default 20;
63source include/diff_tables.inc;
64select * from foo;
65insert into foo values (3,30,300,3000);
66insert into bar values (3,30,300,3000);
67select * from foo;
68
69alter table foo drop column d;
70alter table bar drop column d;
71source include/diff_tables.inc;
72select * from foo;
73insert into foo values (4,40,400);
74insert into bar values (4,40,400);
75select * from foo;
76
77alter table foo add column d int default 20 first;
78alter table bar add column d int default 20 first;
79source include/diff_tables.inc;
80select * from foo;
81insert into foo values (5,50,500,5000);
82insert into bar values (5,50,500,5000);
83select * from foo;
84
85alter table foo drop column d;
86alter table bar drop column d;
87source include/diff_tables.inc;
88select * from foo;
89insert into foo values (6,60,600);
90insert into bar values (6,60,600);
91select * from foo;
92
93drop table foo;
94drop table bar;
95
96