mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 03:51:50 +01:00
#4621 move tokudb.alter_table mysql tests to common mysql test dir. sort out later. refs[t:4621]
git-svn-id: file:///svn/mysql/tests/mysql-test@40916 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
642a4fb63a
commit
f006f151a3
78 changed files with 224408 additions and 0 deletions
50
mysql-test/suite/tokudb.alter_table/r/ai_di.result
Normal file
50
mysql-test/suite/tokudb.alter_table/r/ai_di.result
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (a int, b int, c int, key(a))engine=TokuDB;
|
||||||
|
insert into foo values (1,10,100),(2,20,200),(3,30,300),(3,30,300);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
3 30 300
|
||||||
|
explain select sum(a) from foo;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo index NULL a 5 NULL 4 Using index
|
||||||
|
select sum(a) from foo;
|
||||||
|
sum(a)
|
||||||
|
9
|
||||||
|
alter table foo add unique index b(b), drop index a;
|
||||||
|
ERROR 23000: Can't write; duplicate key in table 'foo'
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
3 30 300
|
||||||
|
explain select sum(a) from foo;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo index NULL a 5 NULL 4 Using index
|
||||||
|
select sum(a) from foo;
|
||||||
|
sum(a)
|
||||||
|
9
|
||||||
|
#test that we can still add an index named 'b'
|
||||||
|
alter table foo add index b(b);
|
||||||
|
explain select sum(b) from foo;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo index NULL b 5 NULL 4 Using index
|
||||||
|
select sum(b) from foo;
|
||||||
|
sum(b)
|
||||||
|
90
|
||||||
|
set autocommit=0;
|
||||||
|
drop index b on foo;
|
||||||
|
create index b on foo (b);
|
||||||
|
explain select sum(b) from foo;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo index NULL b 5 NULL 4 Using index
|
||||||
|
select sum(b) from foo;
|
||||||
|
sum(b)
|
||||||
|
90
|
||||||
|
set autocommit=1;
|
||||||
|
drop table foo;
|
16061
mysql-test/suite/tokudb.alter_table/r/hcad_all_add.result
Normal file
16061
mysql-test/suite/tokudb.alter_table/r/hcad_all_add.result
Normal file
File diff suppressed because it is too large
Load diff
16061
mysql-test/suite/tokudb.alter_table/r/hcad_all_add2.result
Normal file
16061
mysql-test/suite/tokudb.alter_table/r/hcad_all_add2.result
Normal file
File diff suppressed because it is too large
Load diff
16061
mysql-test/suite/tokudb.alter_table/r/hcad_all_add3.result
Normal file
16061
mysql-test/suite/tokudb.alter_table/r/hcad_all_add3.result
Normal file
File diff suppressed because it is too large
Load diff
3041
mysql-test/suite/tokudb.alter_table/r/hcad_all_blob_add.result
Normal file
3041
mysql-test/suite/tokudb.alter_table/r/hcad_all_blob_add.result
Normal file
File diff suppressed because it is too large
Load diff
283
mysql-test/suite/tokudb.alter_table/r/hcad_all_blob_drop.result
Normal file
283
mysql-test/suite/tokudb.alter_table/r/hcad_all_blob_drop.result
Normal file
|
@ -0,0 +1,283 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aa;
|
||||||
|
alter table bar drop column aa;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column bb;
|
||||||
|
alter table bar drop column bb;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column cc;
|
||||||
|
alter table bar drop column cc;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column dd;
|
||||||
|
alter table bar drop column dd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aa, drop column bb;
|
||||||
|
alter table bar drop column aa, drop column bb;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aa, drop column cc;
|
||||||
|
alter table bar drop column aa, drop column cc;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aa, drop column dd;
|
||||||
|
alter table bar drop column aa, drop column dd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column bb, drop column aa;
|
||||||
|
alter table bar drop column bb, drop column aa;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column bb, drop column cc;
|
||||||
|
alter table bar drop column bb, drop column cc;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column bb, drop column dd;
|
||||||
|
alter table bar drop column bb, drop column dd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column cc, drop column aa;
|
||||||
|
alter table bar drop column cc, drop column aa;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column cc, drop column bb;
|
||||||
|
alter table bar drop column cc, drop column bb;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column cc, drop column dd;
|
||||||
|
alter table bar drop column cc, drop column dd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column dd, drop column aa;
|
||||||
|
alter table bar drop column dd, drop column aa;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column dd, drop column bb;
|
||||||
|
alter table bar drop column dd, drop column bb;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column dd, drop column cc;
|
||||||
|
alter table bar drop column dd, drop column cc;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aa, drop column bb, drop column cc;
|
||||||
|
alter table bar drop column aa, drop column bb, drop column cc;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aa, drop column bb, drop column dd;
|
||||||
|
alter table bar drop column aa, drop column bb, drop column dd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aa, drop column cc, drop column dd;
|
||||||
|
alter table bar drop column aa, drop column cc, drop column dd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column bb, drop column cc, drop column dd;
|
||||||
|
alter table bar drop column bb, drop column cc, drop column dd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
11399
mysql-test/suite/tokudb.alter_table/r/hcad_all_drop.result
Normal file
11399
mysql-test/suite/tokudb.alter_table/r/hcad_all_drop.result
Normal file
File diff suppressed because it is too large
Load diff
3041
mysql-test/suite/tokudb.alter_table/r/hcad_all_fixed_add.result
Normal file
3041
mysql-test/suite/tokudb.alter_table/r/hcad_all_fixed_add.result
Normal file
File diff suppressed because it is too large
Load diff
283
mysql-test/suite/tokudb.alter_table/r/hcad_all_fixed_drop.result
Normal file
283
mysql-test/suite/tokudb.alter_table/r/hcad_all_fixed_drop.result
Normal file
|
@ -0,0 +1,283 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column a;
|
||||||
|
alter table bar drop column a;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column b;
|
||||||
|
alter table bar drop column b;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column c;
|
||||||
|
alter table bar drop column c;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column a, drop column b;
|
||||||
|
alter table bar drop column a, drop column b;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column a, drop column c;
|
||||||
|
alter table bar drop column a, drop column c;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column a, drop column d;
|
||||||
|
alter table bar drop column a, drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column b, drop column a;
|
||||||
|
alter table bar drop column b, drop column a;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column b, drop column c;
|
||||||
|
alter table bar drop column b, drop column c;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column b, drop column d;
|
||||||
|
alter table bar drop column b, drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column c, drop column a;
|
||||||
|
alter table bar drop column c, drop column a;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column c, drop column b;
|
||||||
|
alter table bar drop column c, drop column b;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column c, drop column d;
|
||||||
|
alter table bar drop column c, drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column d, drop column a;
|
||||||
|
alter table bar drop column d, drop column a;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column d, drop column b;
|
||||||
|
alter table bar drop column d, drop column b;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column d, drop column c;
|
||||||
|
alter table bar drop column d, drop column c;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column a, drop column b, drop column c;
|
||||||
|
alter table bar drop column a, drop column b, drop column c;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column a, drop column b, drop column d;
|
||||||
|
alter table bar drop column a, drop column b, drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column a, drop column c, drop column d;
|
||||||
|
alter table bar drop column a, drop column c, drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column b, drop column c, drop column d;
|
||||||
|
alter table bar drop column b, drop column c, drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
3041
mysql-test/suite/tokudb.alter_table/r/hcad_all_var_add.result
Normal file
3041
mysql-test/suite/tokudb.alter_table/r/hcad_all_var_add.result
Normal file
File diff suppressed because it is too large
Load diff
283
mysql-test/suite/tokudb.alter_table/r/hcad_all_var_drop.result
Normal file
283
mysql-test/suite/tokudb.alter_table/r/hcad_all_var_drop.result
Normal file
|
@ -0,0 +1,283 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aaa;
|
||||||
|
alter table bar drop column aaa;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column bbb;
|
||||||
|
alter table bar drop column bbb;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column ccc;
|
||||||
|
alter table bar drop column ccc;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column ddd;
|
||||||
|
alter table bar drop column ddd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aaa, drop column bbb;
|
||||||
|
alter table bar drop column aaa, drop column bbb;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aaa, drop column ccc;
|
||||||
|
alter table bar drop column aaa, drop column ccc;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aaa, drop column ddd;
|
||||||
|
alter table bar drop column aaa, drop column ddd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column bbb, drop column aaa;
|
||||||
|
alter table bar drop column bbb, drop column aaa;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column bbb, drop column ccc;
|
||||||
|
alter table bar drop column bbb, drop column ccc;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column bbb, drop column ddd;
|
||||||
|
alter table bar drop column bbb, drop column ddd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column ccc, drop column aaa;
|
||||||
|
alter table bar drop column ccc, drop column aaa;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column ccc, drop column bbb;
|
||||||
|
alter table bar drop column ccc, drop column bbb;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column ccc, drop column ddd;
|
||||||
|
alter table bar drop column ccc, drop column ddd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column ddd, drop column aaa;
|
||||||
|
alter table bar drop column ddd, drop column aaa;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column ddd, drop column bbb;
|
||||||
|
alter table bar drop column ddd, drop column bbb;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column ddd, drop column ccc;
|
||||||
|
alter table bar drop column ddd, drop column ccc;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aaa, drop column bbb, drop column ccc;
|
||||||
|
alter table bar drop column aaa, drop column bbb, drop column ccc;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aaa, drop column bbb, drop column ddd;
|
||||||
|
alter table bar drop column aaa, drop column bbb, drop column ddd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column aaa, drop column ccc, drop column ddd;
|
||||||
|
alter table bar drop column aaa, drop column ccc, drop column ddd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column bbb, drop column ccc, drop column ddd;
|
||||||
|
alter table bar drop column bbb, drop column ccc, drop column ddd;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
281
mysql-test/suite/tokudb.alter_table/r/hcad_clustering.result
Normal file
281
mysql-test/suite/tokudb.alter_table/r/hcad_clustering.result
Normal file
|
@ -0,0 +1,281 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (a int NOT NULL, b bigint NOT NULL, c mediumint NOT NULL, primary key (a), clustering key (b))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
alter table foo add column d int default 20;
|
||||||
|
alter table bar add column d int default 20;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c d
|
||||||
|
2 20 200 20
|
||||||
|
1 10 100 20
|
||||||
|
-1 -1 -1 20
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
3 30 300 3000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c d
|
||||||
|
3 30 300 3000
|
||||||
|
2 20 200 20
|
||||||
|
1 10 100 20
|
||||||
|
-1 -1 -1 20
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
4 40 400
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
alter table foo add column d int default 20 first;
|
||||||
|
alter table bar add column d int default 20 first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
select * from foo order by b desc;
|
||||||
|
d a b c
|
||||||
|
20 4 40 400
|
||||||
|
20 3 30 300
|
||||||
|
20 2 20 200
|
||||||
|
20 1 10 100
|
||||||
|
20 -1 -1 -1
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
5 50 500 5000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
d a b c
|
||||||
|
5 50 500 5000
|
||||||
|
20 4 40 400
|
||||||
|
20 3 30 300
|
||||||
|
20 2 20 200
|
||||||
|
20 1 10 100
|
||||||
|
20 -1 -1 -1
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
50 500 5000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
50 500 5000
|
||||||
|
4 40 400
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
6 60 600
|
||||||
|
50 500 5000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
50 500 5000
|
||||||
|
6 60 600
|
||||||
|
4 40 400
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int NOT NULL, b bigint NOT NULL, c mediumint NOT NULL, primary key (c), clustering key (b))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
alter table foo add column d int default 20;
|
||||||
|
alter table bar add column d int default 20;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c d
|
||||||
|
2 20 200 20
|
||||||
|
1 10 100 20
|
||||||
|
-1 -1 -1 20
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
3 30 300 3000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c d
|
||||||
|
3 30 300 3000
|
||||||
|
2 20 200 20
|
||||||
|
1 10 100 20
|
||||||
|
-1 -1 -1 20
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
4 40 400
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
alter table foo add column d int default 20 first;
|
||||||
|
alter table bar add column d int default 20 first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
select * from foo order by b desc;
|
||||||
|
d a b c
|
||||||
|
20 4 40 400
|
||||||
|
20 3 30 300
|
||||||
|
20 2 20 200
|
||||||
|
20 1 10 100
|
||||||
|
20 -1 -1 -1
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
5 50 500 5000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
d a b c
|
||||||
|
5 50 500 5000
|
||||||
|
20 4 40 400
|
||||||
|
20 3 30 300
|
||||||
|
20 2 20 200
|
||||||
|
20 1 10 100
|
||||||
|
20 -1 -1 -1
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
50 500 5000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
50 500 5000
|
||||||
|
4 40 400
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
6 60 600
|
||||||
|
50 500 5000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
50 500 5000
|
||||||
|
6 60 600
|
||||||
|
4 40 400
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
281
mysql-test/suite/tokudb.alter_table/r/hcad_clustering2.result
Normal file
281
mysql-test/suite/tokudb.alter_table/r/hcad_clustering2.result
Normal file
|
@ -0,0 +1,281 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (a varchar(10) NOT NULL, b varchar(10) NOT NULL, c varchar(10) NOT NULL, primary key (a), clustering key (b))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
alter table foo add column d varchar(10) default 20;
|
||||||
|
alter table bar add column d varchar(10) default 20;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c d
|
||||||
|
2 20 200 20
|
||||||
|
1 10 100 20
|
||||||
|
-1 -1 -1 20
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
3 30 300 3000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c d
|
||||||
|
3 30 300 3000
|
||||||
|
2 20 200 20
|
||||||
|
1 10 100 20
|
||||||
|
-1 -1 -1 20
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
4 40 400
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
alter table foo add column d varchar(10) default 20 first;
|
||||||
|
alter table bar add column d varchar(10) default 20 first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
select * from foo order by b desc;
|
||||||
|
d a b c
|
||||||
|
20 4 40 400
|
||||||
|
20 3 30 300
|
||||||
|
20 2 20 200
|
||||||
|
20 1 10 100
|
||||||
|
20 -1 -1 -1
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
5 50 500 5000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
d a b c
|
||||||
|
5 50 500 5000
|
||||||
|
20 4 40 400
|
||||||
|
20 3 30 300
|
||||||
|
20 2 20 200
|
||||||
|
20 1 10 100
|
||||||
|
20 -1 -1 -1
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
50 500 5000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
50 500 5000
|
||||||
|
4 40 400
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
50 500 5000
|
||||||
|
6 60 600
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
6 60 600
|
||||||
|
50 500 5000
|
||||||
|
4 40 400
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a varchar(10) NOT NULL, b varchar(10) NOT NULL, c varchar(10) NOT NULL, primary key (c), clustering key (b))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
alter table foo add column d varchar(10) default 20;
|
||||||
|
alter table bar add column d varchar(10) default 20;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c d
|
||||||
|
2 20 200 20
|
||||||
|
1 10 100 20
|
||||||
|
-1 -1 -1 20
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
3 30 300 3000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c d
|
||||||
|
3 30 300 3000
|
||||||
|
2 20 200 20
|
||||||
|
1 10 100 20
|
||||||
|
-1 -1 -1 20
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
4 40 400
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
alter table foo add column d varchar(10) default 20 first;
|
||||||
|
alter table bar add column d varchar(10) default 20 first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
select * from foo order by b desc;
|
||||||
|
d a b c
|
||||||
|
20 4 40 400
|
||||||
|
20 3 30 300
|
||||||
|
20 2 20 200
|
||||||
|
20 1 10 100
|
||||||
|
20 -1 -1 -1
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
5 50 500 5000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
d a b c
|
||||||
|
5 50 500 5000
|
||||||
|
20 4 40 400
|
||||||
|
20 3 30 300
|
||||||
|
20 2 20 200
|
||||||
|
20 1 10 100
|
||||||
|
20 -1 -1 -1
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
50 500 5000
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
50 500 5000
|
||||||
|
4 40 400
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
50 500 5000
|
||||||
|
6 60 600
|
||||||
|
select * from foo order by b desc;
|
||||||
|
a b c
|
||||||
|
6 60 600
|
||||||
|
50 500 5000
|
||||||
|
4 40 400
|
||||||
|
3 30 300
|
||||||
|
2 20 200
|
||||||
|
1 10 100
|
||||||
|
-1 -1 -1
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
|
@ -0,0 +1,74 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo(a varchar(10), b varchar (10), c varchar(10), d varchar(10))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (NULL, "bobby",NULL,"heehee");
|
||||||
|
insert into foo values ("BIGGER",NULL,"smaller",NULL);
|
||||||
|
insert into foo values ("aaaaaaaaaa","bbbbbbbbbb","cccccccccc","dddddddddd");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e varchar(3000) default NULL;
|
||||||
|
alter table bar add column e varchar(3000) default NULL;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e varchar(3000) default NULL first;
|
||||||
|
alter table bar add column e varchar(3000) default NULL first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e varchar(3000) default NULL after b;
|
||||||
|
alter table bar add column e varchar(3000) default NULL after b;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e varchar(3000) default "abracadabraabracadabra";
|
||||||
|
alter table bar add column e varchar(3000) default "abracadabraabracadabra";
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e varchar(3000) default "abracadabraabracadabra" first;
|
||||||
|
alter table bar add column e varchar(3000) default "abracadabraabracadabra" first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e varchar(3000) default "abracadabraabracadabra" after b;
|
||||||
|
alter table bar add column e varchar(3000) default "abracadabraabracadabra" after b;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e varchar(3000) default NULL after b;
|
||||||
|
alter table bar add column e varchar(3000) default NULL after b;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e varchar(3000) NOT NULL default "abracadabraabracadabra";
|
||||||
|
alter table bar add column e varchar(3000) NOT NULL default "abracadabraabracadabra";
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e varchar(3000) NOT NULL default "abracadabraabracadabra" first;
|
||||||
|
alter table bar add column e varchar(3000) NOT NULL default "abracadabraabracadabra" first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e varchar(3000) NOT NULL default "abracadabraabracadabra" after b;
|
||||||
|
alter table bar add column e varchar(3000) NOT NULL default "abracadabraabracadabra" after b;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
5645
mysql-test/suite/tokudb.alter_table/r/hcad_fixedblob_add.result
Normal file
5645
mysql-test/suite/tokudb.alter_table/r/hcad_fixedblob_add.result
Normal file
File diff suppressed because it is too large
Load diff
5645
mysql-test/suite/tokudb.alter_table/r/hcad_fixedblob_add2.result
Normal file
5645
mysql-test/suite/tokudb.alter_table/r/hcad_fixedblob_add2.result
Normal file
File diff suppressed because it is too large
Load diff
1823
mysql-test/suite/tokudb.alter_table/r/hcad_fixedblob_drop.result
Normal file
1823
mysql-test/suite/tokudb.alter_table/r/hcad_fixedblob_drop.result
Normal file
File diff suppressed because it is too large
Load diff
5645
mysql-test/suite/tokudb.alter_table/r/hcad_fixedvar_add.result
Normal file
5645
mysql-test/suite/tokudb.alter_table/r/hcad_fixedvar_add.result
Normal file
File diff suppressed because it is too large
Load diff
5645
mysql-test/suite/tokudb.alter_table/r/hcad_fixedvar_add2.result
Normal file
5645
mysql-test/suite/tokudb.alter_table/r/hcad_fixedvar_add2.result
Normal file
File diff suppressed because it is too large
Load diff
1823
mysql-test/suite/tokudb.alter_table/r/hcad_fixedvar_drop.result
Normal file
1823
mysql-test/suite/tokudb.alter_table/r/hcad_fixedvar_drop.result
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,74 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
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), clustering key (b))engine=TokuDB;
|
||||||
|
alter table foo drop column e;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop column d;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop column c;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop column b;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int first;
|
||||||
|
alter table foo drop column aaa;
|
||||||
|
alter table foo add column aaa int first;
|
||||||
|
alter table foo drop column aaa, drop index d;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop column aaa, add index (bb);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop index b, add index b(b);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop column aaa, drop index b, add index b(d);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop column aaa, drop index b, add index b(b);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop column aaa, drop index b, add clustering index b(b(5));
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop column aaa, drop index b, add clustering index b(b);
|
||||||
|
alter table foo add column aaa int, drop index d;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, add index (bb);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, drop index b, add index b(b);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, drop index b, add index b(d);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, drop index b, add unique index b(b);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, drop index b, add index b(b);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, drop index b, add clustering index b(b(5));
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, drop index b, add clustering index b(b);
|
||||||
|
alter table foo drop column aaa, drop index c;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop column aaa, add index (bb);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop index c, add index c(c);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop column aaa, drop index c, add index c(d);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop column aaa, drop index c, add index c(c);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop column aaa, drop index c, add unique index c(c);
|
||||||
|
alter table foo add column aaa int, drop index c;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, add index (bb);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, drop index c, add index c(c);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, drop index c, add index c(d);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, drop index c, add clustering index c(c);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, drop index c, add index c(c);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaa int, drop index c, add unique index c(c);
|
||||||
|
alter table foo add column aaaa int, drop column c;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaaa int, add column bbbb int, drop column c;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add column aaaa int, drop column c, drop column b;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
drop table foo;
|
128
mysql-test/suite/tokudb.alter_table/r/hcad_null_bits.result
Normal file
128
mysql-test/suite/tokudb.alter_table/r/hcad_null_bits.result
Normal file
|
@ -0,0 +1,128 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (a int NOT NULL, b bigint NOT NULL, c tinyint NOT NULL, d int NOT NULL, primary key (b))engine=TokuDB;
|
||||||
|
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);
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e int default NULL first;
|
||||||
|
alter table bar add column e int default NULL first;
|
||||||
|
select * from foo;
|
||||||
|
e a b c d
|
||||||
|
NULL -1 -1 -1 -1
|
||||||
|
NULL 0 0 0 0
|
||||||
|
NULL 122 10 1 1000
|
||||||
|
NULL 99 99 0 99
|
||||||
|
NULL 1 110 1 0
|
||||||
|
NULL 0 3234 0 657
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e int default -1 first;
|
||||||
|
alter table bar add column e int default -1 first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo add column e int NOT NULL default -1 first;
|
||||||
|
alter table bar add column e int NOT NULL default -1 first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
e a b c d
|
||||||
|
-1 -1 -1 -1 -1
|
||||||
|
-1 0 0 0 0
|
||||||
|
-1 122 10 1 1000
|
||||||
|
-1 99 99 0 99
|
||||||
|
-1 1 110 1 0
|
||||||
|
-1 0 3234 0 657
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int, b int not null, c int, d int not null, e int, primary key (e))engine=TokuDB;
|
||||||
|
alter table foo drop column e;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL, -1, NULL, -1,1),(0,0,0,0,0),(NULL,234,234,324,234),(98567,76,NULL,7668,90909);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column b;
|
||||||
|
alter table bar drop column b;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column a;
|
||||||
|
alter table bar drop column a;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
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;
|
||||||
|
alter table foo drop column e;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL, "-1", NULL, "-1",1),("dfg0","0rrr","eee0","qwert",0),(NULL,"234","234","324",234),("98567","76",NULL,"7668","90909");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column b;
|
||||||
|
alter table bar drop column b;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
alter table foo drop column a;
|
||||||
|
alter table bar drop column a;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo(
|
||||||
|
a int,
|
||||||
|
b int,
|
||||||
|
c int,
|
||||||
|
d int,
|
||||||
|
e int,
|
||||||
|
f int,
|
||||||
|
g int,
|
||||||
|
h int,
|
||||||
|
aa int,
|
||||||
|
bb int,
|
||||||
|
cc int,
|
||||||
|
dd int
|
||||||
|
)engine = TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,-1,NULL,-1,NULL,-1,NULL,-1,NULL,-1,NULL,-1);
|
||||||
|
insert into foo values (-1,NULL,-1,NULL,-1,NULL,-1,NULL,-1,NULL,-1,NULL);
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c d e f g h aa bb cc dd
|
||||||
|
NULL -1 NULL -1 NULL -1 NULL -1 NULL -1 NULL -1
|
||||||
|
-1 NULL -1 NULL -1 NULL -1 NULL -1 NULL -1 NULL
|
||||||
|
NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||||
|
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
|
||||||
|
alter table foo drop column a, drop column aa, drop column c, drop column cc, drop column e, drop column f;
|
||||||
|
alter table bar drop column a, drop column aa, drop column c, drop column cc, drop column e, drop column f;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
b d g h bb dd
|
||||||
|
-1 -1 NULL -1 -1 -1
|
||||||
|
NULL NULL -1 NULL NULL NULL
|
||||||
|
NULL NULL NULL NULL NULL NULL
|
||||||
|
-1 -1 -1 -1 -1 -1
|
||||||
|
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;
|
||||||
|
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;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c d e f g h aa bb cc dd
|
||||||
|
-1 -1 NULL -1 12345 NULL NULL -1 -1 -1 0 -1
|
||||||
|
-1 NULL NULL NULL 12345 NULL -1 NULL -1 NULL 0 NULL
|
||||||
|
-1 NULL NULL NULL 12345 NULL NULL NULL -1 NULL 0 NULL
|
||||||
|
-1 -1 NULL -1 12345 NULL -1 -1 -1 -1 0 -1
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
169
mysql-test/suite/tokudb.alter_table/r/hcad_pk.result
Normal file
169
mysql-test/suite/tokudb.alter_table/r/hcad_pk.result
Normal file
|
@ -0,0 +1,169 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (a int NOT NULL, b bigint NOT NULL, c mediumint NOT NULL, primary key (a))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
alter table foo add column d int default 20;
|
||||||
|
alter table bar add column d int default 20;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
3 30 300 3000
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
alter table foo add column d int default 20 first;
|
||||||
|
alter table bar add column d int default 20 first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
5 50 500 5000
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
50 500 5000
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
6 60 600
|
||||||
|
50 500 5000
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a int NOT NULL, b bigint NOT NULL, c mediumint NOT NULL, primary key (c))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
alter table foo add column d int default 20;
|
||||||
|
alter table bar add column d int default 20;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
3 30 300 3000
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
alter table foo add column d int default 20 first;
|
||||||
|
alter table bar add column d int default 20 first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
5 50 500 5000
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
50 500 5000
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
6 60 600
|
||||||
|
50 500 5000
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
169
mysql-test/suite/tokudb.alter_table/r/hcad_pk2.result
Normal file
169
mysql-test/suite/tokudb.alter_table/r/hcad_pk2.result
Normal file
|
@ -0,0 +1,169 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (a varchar(10) NOT NULL, b varchar(10) NOT NULL, c varchar(10) NOT NULL, primary key (a))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
alter table foo add column d varchar(10) default 20;
|
||||||
|
alter table bar add column d varchar(10) default 20;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
3 30 300 3000
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
alter table foo add column d varchar(10) default 20 first;
|
||||||
|
alter table bar add column d varchar(10) default 20 first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
5 50 500 5000
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
50 500 5000
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
50 500 5000
|
||||||
|
6 60 600
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
create table foo (a varchar(10) NOT NULL, b varchar(10) NOT NULL, c varchar(10) NOT NULL, primary key (c))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
alter table foo add column d varchar(10) default 20;
|
||||||
|
alter table bar add column d varchar(10) default 20;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
a b c d
|
||||||
|
-1 -1 -1 20
|
||||||
|
1 10 100 20
|
||||||
|
2 20 200 20
|
||||||
|
3 30 300 3000
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
alter table foo add column d varchar(10) default 20 first;
|
||||||
|
alter table bar add column d varchar(10) default 20 first;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
d a b c
|
||||||
|
20 -1 -1 -1
|
||||||
|
20 1 10 100
|
||||||
|
20 2 20 200
|
||||||
|
20 3 30 300
|
||||||
|
20 4 40 400
|
||||||
|
5 50 500 5000
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
include/diff_tables.inc [test.foo, test.bar]
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
50 500 5000
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
-1 -1 -1
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
50 500 5000
|
||||||
|
6 60 600
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
|
@ -0,0 +1,3 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
24
mysql-test/suite/tokudb.alter_table/r/hcad_tmp_tables.result
Normal file
24
mysql-test/suite/tokudb.alter_table/r/hcad_tmp_tables.result
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS bar;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create temporary table bar (a int, key(a))engine=TOkuDB;
|
||||||
|
alter table bar add column c int;
|
||||||
|
ERROR 42000: Table 'bar' uses an extension that doesn't exist in this MySQL version
|
||||||
|
create index blah on bar(a);
|
||||||
|
ERROR 42000: Table 'bar' uses an extension that doesn't exist in this MySQL version
|
||||||
|
drop index a on bar;
|
||||||
|
ERROR 42000: Table 'bar' uses an extension that doesn't exist in this MySQL version
|
||||||
|
set session tokudb_disable_slow_alter=OFF;
|
||||||
|
insert into bar values (1),(2),(3);
|
||||||
|
alter table bar add column b int default 1 first;
|
||||||
|
select * from bar;
|
||||||
|
b a
|
||||||
|
1 1
|
||||||
|
1 2
|
||||||
|
1 3
|
||||||
|
create index blah on bar (b);
|
||||||
|
select sum(b) from bar;
|
||||||
|
sum(b)
|
||||||
|
3
|
||||||
|
drop index a on bar;
|
||||||
|
drop table bar;
|
5645
mysql-test/suite/tokudb.alter_table/r/hcad_varblob_add.result
Normal file
5645
mysql-test/suite/tokudb.alter_table/r/hcad_varblob_add.result
Normal file
File diff suppressed because it is too large
Load diff
5645
mysql-test/suite/tokudb.alter_table/r/hcad_varblob_add2.result
Normal file
5645
mysql-test/suite/tokudb.alter_table/r/hcad_varblob_add2.result
Normal file
File diff suppressed because it is too large
Load diff
1823
mysql-test/suite/tokudb.alter_table/r/hcad_varblob_drop.result
Normal file
1823
mysql-test/suite/tokudb.alter_table/r/hcad_varblob_drop.result
Normal file
File diff suppressed because it is too large
Load diff
20
mysql-test/suite/tokudb.alter_table/r/hcad_with_dels.result
Normal file
20
mysql-test/suite/tokudb.alter_table/r/hcad_with_dels.result
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
SET STORAGE_ENGINE = 'tokudb';
|
||||||
|
set session transaction isolation level repeatable read;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
# Establish connection conn1 (user = root)
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
set session transaction isolation level repeatable read;
|
||||||
|
create table foo (a int, b int) engine=TokuDB;
|
||||||
|
create table bar (a int) engine=TokuDB;
|
||||||
|
insert into foo values (1,10),(2,20),(3,30);
|
||||||
|
begin;
|
||||||
|
select * from bar;
|
||||||
|
a
|
||||||
|
delete from foo;
|
||||||
|
select * from foo;
|
||||||
|
a b
|
||||||
|
alter table foo add column c int first;
|
||||||
|
alter table foo drop column b;
|
||||||
|
commit;
|
||||||
|
set session transaction isolation level serializable;
|
||||||
|
DROP TABLE foo,bar;
|
180
mysql-test/suite/tokudb.alter_table/r/hcad_with_lock_sps.result
Normal file
180
mysql-test/suite/tokudb.alter_table/r/hcad_with_lock_sps.result
Normal file
|
@ -0,0 +1,180 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
drop procedure if exists p0;
|
||||||
|
drop procedure if exists p1;
|
||||||
|
drop function if exists f0;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (a int, b int, c int, clustering key (b))engine=TokuDB;
|
||||||
|
insert into foo values (1,10,100),(2,20,200),(3,30,300);
|
||||||
|
set autocommit=off;
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
alter table foo add column z int default 999 first;
|
||||||
|
explain select * from foo;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo ALL NULL NULL NULL NULL 4
|
||||||
|
select * from foo;
|
||||||
|
z a b c
|
||||||
|
999 1 10 100
|
||||||
|
999 2 20 200
|
||||||
|
999 3 30 300
|
||||||
|
999 4 40 400
|
||||||
|
explain select * from foo where b > 20;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo range b b 5 NULL 2 Using where
|
||||||
|
select* from foo where b > 10;
|
||||||
|
z a b c
|
||||||
|
999 2 20 200
|
||||||
|
999 3 30 300
|
||||||
|
999 4 40 400
|
||||||
|
set autocommit=on;
|
||||||
|
begin;
|
||||||
|
alter table foo drop column z;
|
||||||
|
explain select * from foo;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo ALL NULL NULL NULL NULL 4
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
explain select * from foo where b > 20;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo range b b 5 NULL 2 Using where
|
||||||
|
select* from foo where b > 10;
|
||||||
|
a b c
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
lock tables foo write;
|
||||||
|
alter table foo add column z int;
|
||||||
|
explain select * from foo;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo ALL NULL NULL NULL NULL 4
|
||||||
|
select * from foo;
|
||||||
|
a b c z
|
||||||
|
1 10 100 NULL
|
||||||
|
2 20 200 NULL
|
||||||
|
3 30 300 NULL
|
||||||
|
4 40 400 NULL
|
||||||
|
explain select * from foo where b > 20;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo range b b 5 NULL 2 Using where
|
||||||
|
select* from foo where b > 10;
|
||||||
|
a b c z
|
||||||
|
2 20 200 NULL
|
||||||
|
3 30 300 NULL
|
||||||
|
4 40 400 NULL
|
||||||
|
unlock tables;
|
||||||
|
select * from foo;
|
||||||
|
a b c z
|
||||||
|
1 10 100 NULL
|
||||||
|
2 20 200 NULL
|
||||||
|
3 30 300 NULL
|
||||||
|
4 40 400 NULL
|
||||||
|
select * from foo where b > 10;
|
||||||
|
a b c z
|
||||||
|
2 20 200 NULL
|
||||||
|
3 30 300 NULL
|
||||||
|
4 40 400 NULL
|
||||||
|
create procedure p0()
|
||||||
|
begin
|
||||||
|
alter table foo drop column z;
|
||||||
|
explain select * from foo;
|
||||||
|
select * from foo;
|
||||||
|
explain select * from foo where b > 20;
|
||||||
|
select* from foo where b > 10;
|
||||||
|
end |
|
||||||
|
call p0();
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo ALL NULL NULL NULL NULL 4
|
||||||
|
a b c
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo range b b 5 NULL 2 Using where
|
||||||
|
a b c
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
explain select * from foo;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo ALL NULL NULL NULL NULL 4
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
explain select * from foo where b > 20;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo range b b 5 NULL 2 Using where
|
||||||
|
select* from foo where b > 10;
|
||||||
|
a b c
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
create function f0() returns int
|
||||||
|
begin
|
||||||
|
alter table foo add column ggg int;
|
||||||
|
end|
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
set autocommit=0;
|
||||||
|
create procedure p1()
|
||||||
|
begin
|
||||||
|
insert into foo values(5,50,500);
|
||||||
|
select * from foo;
|
||||||
|
savepoint x;
|
||||||
|
alter table foo add column g int;
|
||||||
|
explain select * from foo;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo where b > 10;
|
||||||
|
explain select * from foo where b > 20;
|
||||||
|
end|
|
||||||
|
call p1();
|
||||||
|
a b c
|
||||||
|
1 10 100
|
||||||
|
2 20 200
|
||||||
|
3 30 300
|
||||||
|
4 40 400
|
||||||
|
5 50 500
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo ALL NULL NULL NULL NULL 5
|
||||||
|
a b c g
|
||||||
|
1 10 100 NULL
|
||||||
|
2 20 200 NULL
|
||||||
|
3 30 300 NULL
|
||||||
|
4 40 400 NULL
|
||||||
|
5 50 500 NULL
|
||||||
|
a b c g
|
||||||
|
2 20 200 NULL
|
||||||
|
3 30 300 NULL
|
||||||
|
4 40 400 NULL
|
||||||
|
5 50 500 NULL
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo range b b 5 NULL 3 Using where
|
||||||
|
set autocommit=on;
|
||||||
|
explain select * from foo;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo ALL NULL NULL NULL NULL 5
|
||||||
|
select * from foo;
|
||||||
|
a b c g
|
||||||
|
1 10 100 NULL
|
||||||
|
2 20 200 NULL
|
||||||
|
3 30 300 NULL
|
||||||
|
4 40 400 NULL
|
||||||
|
5 50 500 NULL
|
||||||
|
explain select * from foo where b > 10;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo range b b 5 NULL 4 Using where
|
||||||
|
select * from foo where b > 10;
|
||||||
|
a b c g
|
||||||
|
2 20 200 NULL
|
||||||
|
3 30 300 NULL
|
||||||
|
4 40 400 NULL
|
||||||
|
5 50 500 NULL
|
||||||
|
drop table foo;
|
||||||
|
drop procedure p0;
|
||||||
|
drop procedure p1;
|
24
mysql-test/suite/tokudb.alter_table/r/hcad_with_locks.result
Normal file
24
mysql-test/suite/tokudb.alter_table/r/hcad_with_locks.result
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
SET STORAGE_ENGINE = 'tokudb';
|
||||||
|
set session transaction isolation level repeatable read;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
# Establish connection conn1 (user = root)
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
set session transaction isolation level repeatable read;
|
||||||
|
create table foo (a int, b int) engine=TokuDB;
|
||||||
|
insert into foo values (1,10);
|
||||||
|
begin;
|
||||||
|
select * from foo;
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
alter table foo add column c int;
|
||||||
|
alter table foo drop column b;
|
||||||
|
commit;
|
||||||
|
begin;
|
||||||
|
insert into foo values (1,10);
|
||||||
|
alter table foo add column cc int;
|
||||||
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||||
|
alter table foo drop column c;
|
||||||
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||||
|
commit;
|
||||||
|
set session transaction isolation level serializable;
|
||||||
|
DROP TABLE foo;
|
45
mysql-test/suite/tokudb.alter_table/r/hcr.result
Normal file
45
mysql-test/suite/tokudb.alter_table/r/hcr.result
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (a int, b varchar(10), c blob)engine=TokuDB;
|
||||||
|
insert into foo values(1,"bb","cccc");
|
||||||
|
alter table foo change a aa int, change b bb varchar(10);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change b bb varchar(11);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change a aa bigint;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change a aa int NOT NULL;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change a aa int, alter column b drop default;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change b bb varchar(10) CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change c cc mediumblob;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change a aa int, add column d int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change a aa int, drop column c;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change a aa int, add index (b);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add index(b);
|
||||||
|
alter table foo change a aa int, drop index b;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
show create table foo;
|
||||||
|
Table Create Table
|
||||||
|
foo CREATE TABLE `foo` (
|
||||||
|
`a` int(11) DEFAULT NULL,
|
||||||
|
`b` varchar(10) DEFAULT NULL,
|
||||||
|
`c` blob,
|
||||||
|
KEY `b` (`b`)
|
||||||
|
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||||
|
select * from foo;
|
||||||
|
a b c
|
||||||
|
1 bb cccc
|
||||||
|
alter table foo change a aa int DEFAULT 1000;
|
||||||
|
drop table foo;
|
||||||
|
create table foo (a int, b int, c int) engine=TokuDB;
|
||||||
|
alter table foo change c cc int, change a b int, change b a int first;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
drop table foo;
|
71
mysql-test/suite/tokudb.alter_table/r/hcr2.result
Normal file
71
mysql-test/suite/tokudb.alter_table/r/hcr2.result
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (
|
||||||
|
a1 int,
|
||||||
|
a2 int unsigned,
|
||||||
|
a3 tinyint,
|
||||||
|
a4 tinyint unsigned,
|
||||||
|
a5 bit,
|
||||||
|
a6 smallint,
|
||||||
|
a7 smallint unsigned,
|
||||||
|
a8 mediumint,
|
||||||
|
a9 mediumint unsigned,
|
||||||
|
a10 bigint,
|
||||||
|
a11 bigint unsigned,
|
||||||
|
a12 double,
|
||||||
|
a13 double unsigned,
|
||||||
|
a14 float,
|
||||||
|
a15 float unsigned,
|
||||||
|
a16 decimal,
|
||||||
|
a17 date,
|
||||||
|
a18 datetime,
|
||||||
|
a19 timestamp,
|
||||||
|
a20 time,
|
||||||
|
a21 year,
|
||||||
|
a22 binary(100),
|
||||||
|
a23 varbinary(100),
|
||||||
|
a24 varchar(10),
|
||||||
|
a25 varchar(10) CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a26 char(10),
|
||||||
|
a27 char(10) CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a28 ENUM('a','b','c') CHARACTER SET binary,
|
||||||
|
a29 tinyblob,
|
||||||
|
a30 tinytext CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a31 blob,
|
||||||
|
a32 text CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a33 mediumblob,
|
||||||
|
a34 mediumtext CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a35 longblob,
|
||||||
|
a36 longtext CHARACTER SET latin1 COLLATE latin1_general_cs
|
||||||
|
)engine = TokuDB;
|
||||||
|
alter table foo change a1 aa1 int;
|
||||||
|
alter table foo change a2 aa2 int unsigned;
|
||||||
|
alter table foo change a3 aa3 tinyint;
|
||||||
|
alter table foo change a4 aa4 tinyint unsigned;
|
||||||
|
alter table foo change a5 aa5 bit;
|
||||||
|
alter table foo change a6 aa6 smallint;
|
||||||
|
alter table foo change a7 aa7 smallint unsigned;
|
||||||
|
alter table foo change a8 aa8 mediumint;
|
||||||
|
alter table foo change a9 aa9 mediumint unsigned;
|
||||||
|
alter table foo change a10 aa10 bigint;
|
||||||
|
alter table foo change a11 aa11 bigint unsigned;
|
||||||
|
alter table foo change a12 aa12 double;
|
||||||
|
alter table foo change a13 aa13 double unsigned;
|
||||||
|
alter table foo change a14 aa14 float;
|
||||||
|
alter table foo change a15 aa15 float unsigned;
|
||||||
|
alter table foo change a16 aa16 decimal;
|
||||||
|
alter table foo change a17 aa17 date;
|
||||||
|
alter table foo change a18 aa18 datetime;
|
||||||
|
alter table foo change a19 aa19 timestamp;
|
||||||
|
alter table foo change a21 aa21 year;
|
||||||
|
alter table foo change a23 aa23 varbinary(100);
|
||||||
|
alter table foo change a24 aa24 varchar(10);
|
||||||
|
alter table foo change a25 aa25 varchar(10) CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
alter table foo change a26 aa26 char(10);
|
||||||
|
alter table foo change a27 aa27 char(10) CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
alter table foo change a30 aa30 tinytext CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
alter table foo change a32 aa32 text CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
alter table foo change a34 aa34 mediumtext CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
alter table foo change a36 aa36 longtext CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
drop table foo;
|
69
mysql-test/suite/tokudb.alter_table/r/hcr3.result
Normal file
69
mysql-test/suite/tokudb.alter_table/r/hcr3.result
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (a int, b bigint, c char(10), d varchar(10), e text, primary key (a), key(b), clustering key (d))engine=TOkuDB;
|
||||||
|
insert into foo values (1,10,"cc","dddd","eeeee");
|
||||||
|
select * from foo;
|
||||||
|
a b c d e
|
||||||
|
1 10 cc dddd eeeee
|
||||||
|
alter table foo change a aa int;
|
||||||
|
show create table foo;
|
||||||
|
Table Create Table
|
||||||
|
foo CREATE TABLE `foo` (
|
||||||
|
`aa` int(11) NOT NULL DEFAULT '0',
|
||||||
|
`b` bigint(20) DEFAULT NULL,
|
||||||
|
`c` char(10) DEFAULT NULL,
|
||||||
|
`d` varchar(10) DEFAULT NULL,
|
||||||
|
`e` text,
|
||||||
|
PRIMARY KEY (`aa`),
|
||||||
|
KEY `b` (`b`),
|
||||||
|
CLUSTERING KEY `d` (`d`)
|
||||||
|
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||||
|
select * from foo;
|
||||||
|
aa b c d e
|
||||||
|
1 10 cc dddd eeeee
|
||||||
|
explain select * from foo where aa > 0;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 1 Using where
|
||||||
|
select * from foo where aa > 0;
|
||||||
|
aa b c d e
|
||||||
|
1 10 cc dddd eeeee
|
||||||
|
alter table foo change b bb bigint;
|
||||||
|
show create table foo;
|
||||||
|
Table Create Table
|
||||||
|
foo CREATE TABLE `foo` (
|
||||||
|
`aa` int(11) NOT NULL DEFAULT '0',
|
||||||
|
`bb` bigint(20) DEFAULT NULL,
|
||||||
|
`c` char(10) DEFAULT NULL,
|
||||||
|
`d` varchar(10) DEFAULT NULL,
|
||||||
|
`e` text,
|
||||||
|
PRIMARY KEY (`aa`),
|
||||||
|
KEY `b` (`bb`),
|
||||||
|
CLUSTERING KEY `d` (`d`)
|
||||||
|
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||||
|
explain select bb from foo FORCE INDEX (b) where bb > 5;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo index b b 9 NULL 1 Using where; Using index
|
||||||
|
select bb from foo FORCE INDEX (b) where bb > 5;
|
||||||
|
bb
|
||||||
|
10
|
||||||
|
alter table foo change d dd varchar(10);
|
||||||
|
show create table foo;
|
||||||
|
Table Create Table
|
||||||
|
foo CREATE TABLE `foo` (
|
||||||
|
`aa` int(11) NOT NULL DEFAULT '0',
|
||||||
|
`bb` bigint(20) DEFAULT NULL,
|
||||||
|
`c` char(10) DEFAULT NULL,
|
||||||
|
`dd` varchar(10) DEFAULT NULL,
|
||||||
|
`e` text,
|
||||||
|
PRIMARY KEY (`aa`),
|
||||||
|
KEY `b` (`bb`),
|
||||||
|
CLUSTERING KEY `d` (`dd`)
|
||||||
|
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||||
|
explain select * from foo where dd > "d";
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE foo range d d 13 NULL 1 Using where
|
||||||
|
select * from foo where dd > "d";
|
||||||
|
aa bb c dd e
|
||||||
|
1 10 cc dddd eeeee
|
||||||
|
drop table foo;
|
119
mysql-test/suite/tokudb.alter_table/r/other_alter.result
Normal file
119
mysql-test/suite/tokudb.alter_table/r/other_alter.result
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
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), clustering key (b))engine=TokuDB;
|
||||||
|
create table bar (a int) engine=TokuDB;
|
||||||
|
alter table foo drop primary key;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop primary key, add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop primary key, drop column aa;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table bar add primary key (a);
|
||||||
|
ERROR 42000: Table 'bar' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table bar add primary key (a), add column z int;
|
||||||
|
ERROR 42000: Table 'bar' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop primary key, add primary key (b);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop primary key, add primary key (b), add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo drop primary key, add primary key (b), drop column aa;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo add fulltext key(b);
|
||||||
|
ERROR HY000: The used table type doesn't support FULLTEXT indexes
|
||||||
|
alter table foo add spatial key (aa);
|
||||||
|
ERROR HY000: The used table type doesn't support SPATIAL indexes
|
||||||
|
alter table foo alter column cc set default 101010;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo alter column cc set default NULL;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo alter column cc drop default;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo alter column cc set default 101010, add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo alter column cc set default NULL, add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo alter column cc drop default, add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo alter column cc set default 101010, drop column aa;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo alter column cc set default NULL, drop column aa;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo alter column cc drop default, drop column aa;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aaa int, add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column e epk int, add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aaa int, drop column bb;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column e epk int, drop column bb;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
show create table foo;
|
||||||
|
Table Create Table
|
||||||
|
foo CREATE TABLE `foo` (
|
||||||
|
`aa` int(11) DEFAULT NULL,
|
||||||
|
`bb` int(11) DEFAULT NULL,
|
||||||
|
`cc` int(11) DEFAULT NULL,
|
||||||
|
`dd` int(11) DEFAULT NULL,
|
||||||
|
`ee` int(11) DEFAULT NULL,
|
||||||
|
`a` int(11) DEFAULT NULL,
|
||||||
|
`b` varchar(20) DEFAULT NULL,
|
||||||
|
`c` int(11) DEFAULT NULL,
|
||||||
|
`d` int(11) DEFAULT NULL,
|
||||||
|
`e` int(11) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`e`),
|
||||||
|
UNIQUE KEY `c` (`c`),
|
||||||
|
KEY `d` (`d`),
|
||||||
|
CLUSTERING KEY `b` (`b`)
|
||||||
|
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||||
|
alter table foo change column aa aa int NOT NULL;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aa bigint;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aa varchar(20);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aa int after cc;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo modify column aa int NOT NULL;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo modify column aa bigint;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo modify column aa varchar(20);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo modify column aa int after cc;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aa int NOT NULL, add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aa bigint, add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aa varchar(20), add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aa int after cc, add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo modify column aa int NOT NULL, add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo modify column aa bigint, add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo modify column aa varchar(20), add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo modify column aa int after cc, add column z int;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aa int NOT NULL, drop column bb;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aa bigint, drop column bb;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aa varchar(20), drop column bb;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo change column aa aa int after cc, drop column bb;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo modify column aa int NOT NULL, drop column bb;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo modify column aa bigint, drop column bb;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo modify column aa varchar(20), drop column bb;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
alter table foo modify column aa int after cc, drop column bb;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
111
mysql-test/suite/tokudb.alter_table/r/other_alter2.result
Normal file
111
mysql-test/suite/tokudb.alter_table/r/other_alter2.result
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo,bar, foo_isam, bar_isam;
|
||||||
|
set session tokudb_disable_slow_alter=OFF;
|
||||||
|
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), clustering key (b))engine=TokuDB;
|
||||||
|
create table foo_isam like foo;
|
||||||
|
alter table foo_isam engine=MyISAM;
|
||||||
|
create table bar (a int) engine=TokuDB;
|
||||||
|
create table bar_isam like bar;
|
||||||
|
alter table bar_isam engine=MyISAM;
|
||||||
|
insert into foo values (1,10,100,1000,10000,1,"bb",10,100,1000);
|
||||||
|
insert into foo values (2,20,200,2000,20000,2,"bbb",20,200,2000);
|
||||||
|
insert into foo values (3,30,300,3000,30000,3,"bbbb",30,300,3000);
|
||||||
|
insert into foo_isam select * from foo;
|
||||||
|
alter table foo drop primary key;
|
||||||
|
alter table foo_isam drop primary key;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo add primary key (e);
|
||||||
|
alter table foo_isam add primary key (e);
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo drop primary key, add primary key(a);
|
||||||
|
alter table foo_isam drop primary key, add primary key (a);
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo add fulltext key(b);
|
||||||
|
ERROR HY000: The used table type doesn't support FULLTEXT indexes
|
||||||
|
alter table foo add spatial key (aa);
|
||||||
|
ERROR HY000: The used table type doesn't support SPATIAL indexes
|
||||||
|
alter table foo alter column cc set default 101010;
|
||||||
|
alter table foo_isam alter column cc set default 101010;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo alter column cc set default NULL;
|
||||||
|
alter table foo_isam alter column cc set default NULL;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo alter column cc drop default;
|
||||||
|
alter table foo_isam alter column cc drop default;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo change column aa aaa int;
|
||||||
|
alter table foo_isam change column aa aaa int;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo change column aaa aa int;
|
||||||
|
alter table foo_isam change column aaa aa int;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo change column e epk int;
|
||||||
|
alter table foo_isam change column e epk int;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo change column epk e int;
|
||||||
|
alter table foo_isam change column epk e int;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
show create table foo;
|
||||||
|
Table Create Table
|
||||||
|
foo CREATE TABLE `foo` (
|
||||||
|
`aa` int(11) DEFAULT NULL,
|
||||||
|
`bb` int(11) DEFAULT NULL,
|
||||||
|
`cc` int(11),
|
||||||
|
`dd` int(11) DEFAULT NULL,
|
||||||
|
`ee` int(11) DEFAULT NULL,
|
||||||
|
`a` int(11) NOT NULL DEFAULT '0',
|
||||||
|
`b` varchar(20) DEFAULT NULL,
|
||||||
|
`c` int(11) DEFAULT NULL,
|
||||||
|
`d` int(11) DEFAULT NULL,
|
||||||
|
`e` int(11) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`a`),
|
||||||
|
UNIQUE KEY `c` (`c`),
|
||||||
|
KEY `d` (`d`),
|
||||||
|
CLUSTERING KEY `b` (`b`)
|
||||||
|
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||||
|
show create table foo_isam;
|
||||||
|
Table Create Table
|
||||||
|
foo_isam CREATE TABLE `foo_isam` (
|
||||||
|
`aa` int(11) DEFAULT NULL,
|
||||||
|
`bb` int(11) DEFAULT NULL,
|
||||||
|
`cc` int(11),
|
||||||
|
`dd` int(11) DEFAULT NULL,
|
||||||
|
`ee` int(11) DEFAULT NULL,
|
||||||
|
`a` int(11) NOT NULL DEFAULT '0',
|
||||||
|
`b` varchar(20) DEFAULT NULL,
|
||||||
|
`c` int(11) DEFAULT NULL,
|
||||||
|
`d` int(11) DEFAULT NULL,
|
||||||
|
`e` int(11) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`a`),
|
||||||
|
UNIQUE KEY `c` (`c`),
|
||||||
|
KEY `d` (`d`),
|
||||||
|
CLUSTERING KEY `b` (`b`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
alter table foo change column aa aa int NOT NULL;
|
||||||
|
alter table foo_isam change column aa aa int NOT NULL;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo change column aa aa bigint;
|
||||||
|
alter table foo_isam change column aa aa bigint;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo change column aa aa varchar(20);
|
||||||
|
alter table foo_isam change column aa aa varchar(20);
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo change column aa aa int after cc;
|
||||||
|
alter table foo_isam change column aa aa int after cc;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo modify column aa int NOT NULL;
|
||||||
|
alter table foo_isam modify column aa int NOT NULL;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo modify column aa bigint;
|
||||||
|
alter table foo_isam modify column aa bigint;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo modify column aa varchar(20);
|
||||||
|
alter table foo_isam modify column aa varchar(20);
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
alter table foo modify column aa int after cc;
|
||||||
|
alter table foo_isam modify column aa int after cc;
|
||||||
|
include/diff_tables.inc [test.foo, test.foo_isam]
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
drop table foo_isam;
|
||||||
|
drop table bar_isam;
|
Binary file not shown.
11
mysql-test/suite/tokudb.alter_table/r/virtual_columns.result
Normal file
11
mysql-test/suite/tokudb.alter_table/r/virtual_columns.result
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
create table foo (a int, b int, c int, d int as (a mod 10) virtual, key(a))engine=TokuDB;
|
||||||
|
ERROR HY000: TokuDB storage engine does not support computed columns
|
||||||
|
create table foo (a int, b int, c int)engine=TokuDB;
|
||||||
|
alter table foo add column d int as (a mod 10) virtual;
|
||||||
|
ERROR HY000: TokuDB storage engine does not support computed columns
|
||||||
|
alter table foo add column d int as (a mod 10) persistent;
|
||||||
|
ERROR HY000: TokuDB storage engine does not support computed columns
|
||||||
|
drop table foo;
|
38
mysql-test/suite/tokudb.alter_table/t/ai_di.test
Executable file
38
mysql-test/suite/tokudb.alter_table/t/ai_di.test
Executable file
|
@ -0,0 +1,38 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
create table foo (a int, b int, c int, key(a))engine=TokuDB;
|
||||||
|
|
||||||
|
insert into foo values (1,10,100),(2,20,200),(3,30,300),(3,30,300);
|
||||||
|
|
||||||
|
select * from foo;
|
||||||
|
explain select sum(a) from foo;
|
||||||
|
select sum(a) from foo;
|
||||||
|
|
||||||
|
--error ER_DUP_KEY
|
||||||
|
alter table foo add unique index b(b), drop index a;
|
||||||
|
|
||||||
|
select * from foo;
|
||||||
|
explain select sum(a) from foo;
|
||||||
|
select sum(a) from foo;
|
||||||
|
|
||||||
|
--echo #test that we can still add an index named 'b'
|
||||||
|
alter table foo add index b(b);
|
||||||
|
explain select sum(b) from foo;
|
||||||
|
select sum(b) from foo;
|
||||||
|
|
||||||
|
set autocommit=0;
|
||||||
|
drop index b on foo;
|
||||||
|
create index b on foo (b);
|
||||||
|
explain select sum(b) from foo;
|
||||||
|
select sum(b) from foo;
|
||||||
|
set autocommit=1;
|
||||||
|
|
||||||
|
|
||||||
|
drop table foo;
|
16285
mysql-test/suite/tokudb.alter_table/t/hcad_all_add.test
Normal file
16285
mysql-test/suite/tokudb.alter_table/t/hcad_all_add.test
Normal file
File diff suppressed because it is too large
Load diff
16285
mysql-test/suite/tokudb.alter_table/t/hcad_all_add2.test
Normal file
16285
mysql-test/suite/tokudb.alter_table/t/hcad_all_add2.test
Normal file
File diff suppressed because it is too large
Load diff
16285
mysql-test/suite/tokudb.alter_table/t/hcad_all_add3.test
Normal file
16285
mysql-test/suite/tokudb.alter_table/t/hcad_all_add3.test
Normal file
File diff suppressed because it is too large
Load diff
3265
mysql-test/suite/tokudb.alter_table/t/hcad_all_blob_add.test
Normal file
3265
mysql-test/suite/tokudb.alter_table/t/hcad_all_blob_add.test
Normal file
File diff suppressed because it is too large
Load diff
310
mysql-test/suite/tokudb.alter_table/t/hcad_all_blob_drop.test
Normal file
310
mysql-test/suite/tokudb.alter_table/t/hcad_all_blob_drop.test
Normal file
|
@ -0,0 +1,310 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
let $diff_tables= test.foo, test.bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aa;
|
||||||
|
alter table bar drop column aa;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column bb;
|
||||||
|
alter table bar drop column bb;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column cc;
|
||||||
|
alter table bar drop column cc;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column dd;
|
||||||
|
alter table bar drop column dd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aa, drop column bb;
|
||||||
|
alter table bar drop column aa, drop column bb;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aa, drop column cc;
|
||||||
|
alter table bar drop column aa, drop column cc;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aa, drop column dd;
|
||||||
|
alter table bar drop column aa, drop column dd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column bb, drop column aa;
|
||||||
|
alter table bar drop column bb, drop column aa;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column bb, drop column cc;
|
||||||
|
alter table bar drop column bb, drop column cc;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column bb, drop column dd;
|
||||||
|
alter table bar drop column bb, drop column dd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column cc, drop column aa;
|
||||||
|
alter table bar drop column cc, drop column aa;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column cc, drop column bb;
|
||||||
|
alter table bar drop column cc, drop column bb;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column cc, drop column dd;
|
||||||
|
alter table bar drop column cc, drop column dd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column dd, drop column aa;
|
||||||
|
alter table bar drop column dd, drop column aa;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column dd, drop column bb;
|
||||||
|
alter table bar drop column dd, drop column bb;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column dd, drop column cc;
|
||||||
|
alter table bar drop column dd, drop column cc;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aa, drop column bb, drop column cc;
|
||||||
|
alter table bar drop column aa, drop column bb, drop column cc;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aa, drop column bb, drop column dd;
|
||||||
|
alter table bar drop column aa, drop column bb, drop column dd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aa, drop column cc, drop column dd;
|
||||||
|
alter table bar drop column aa, drop column cc, drop column dd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aa blob, bb longblob, cc tinyblob, dd mediumblob) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values ("adsf",NULL,"hjfdshj",NULL);
|
||||||
|
insert into foo values (NULL,"oifds",NULL,"fdsjfds");
|
||||||
|
insert into foo values ("rewoiu","fds","fr","oiufdsrew");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column bb, drop column cc, drop column dd;
|
||||||
|
alter table bar drop column bb, drop column cc, drop column dd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
11560
mysql-test/suite/tokudb.alter_table/t/hcad_all_drop.test
Normal file
11560
mysql-test/suite/tokudb.alter_table/t/hcad_all_drop.test
Normal file
File diff suppressed because it is too large
Load diff
3265
mysql-test/suite/tokudb.alter_table/t/hcad_all_fixed_add.test
Normal file
3265
mysql-test/suite/tokudb.alter_table/t/hcad_all_fixed_add.test
Normal file
File diff suppressed because it is too large
Load diff
310
mysql-test/suite/tokudb.alter_table/t/hcad_all_fixed_drop.test
Normal file
310
mysql-test/suite/tokudb.alter_table/t/hcad_all_fixed_drop.test
Normal file
|
@ -0,0 +1,310 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
let $diff_tables= test.foo, test.bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column a;
|
||||||
|
alter table bar drop column a;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column b;
|
||||||
|
alter table bar drop column b;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column c;
|
||||||
|
alter table bar drop column c;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column a, drop column b;
|
||||||
|
alter table bar drop column a, drop column b;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column a, drop column c;
|
||||||
|
alter table bar drop column a, drop column c;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column a, drop column d;
|
||||||
|
alter table bar drop column a, drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column b, drop column a;
|
||||||
|
alter table bar drop column b, drop column a;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column b, drop column c;
|
||||||
|
alter table bar drop column b, drop column c;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column b, drop column d;
|
||||||
|
alter table bar drop column b, drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column c, drop column a;
|
||||||
|
alter table bar drop column c, drop column a;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column c, drop column b;
|
||||||
|
alter table bar drop column c, drop column b;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column c, drop column d;
|
||||||
|
alter table bar drop column c, drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column d, drop column a;
|
||||||
|
alter table bar drop column d, drop column a;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column d, drop column b;
|
||||||
|
alter table bar drop column d, drop column b;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column d, drop column c;
|
||||||
|
alter table bar drop column d, drop column c;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column a, drop column b, drop column c;
|
||||||
|
alter table bar drop column a, drop column b, drop column c;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column a, drop column b, drop column d;
|
||||||
|
alter table bar drop column a, drop column b, drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column a, drop column c, drop column d;
|
||||||
|
alter table bar drop column a, drop column c, drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c date, d tinyint) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column b, drop column c, drop column d;
|
||||||
|
alter table bar drop column b, drop column c, drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
3265
mysql-test/suite/tokudb.alter_table/t/hcad_all_var_add.test
Normal file
3265
mysql-test/suite/tokudb.alter_table/t/hcad_all_var_add.test
Normal file
File diff suppressed because it is too large
Load diff
310
mysql-test/suite/tokudb.alter_table/t/hcad_all_var_drop.test
Normal file
310
mysql-test/suite/tokudb.alter_table/t/hcad_all_var_drop.test
Normal file
|
@ -0,0 +1,310 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
let $diff_tables= test.foo, test.bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aaa;
|
||||||
|
alter table bar drop column aaa;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column bbb;
|
||||||
|
alter table bar drop column bbb;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column ccc;
|
||||||
|
alter table bar drop column ccc;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column ddd;
|
||||||
|
alter table bar drop column ddd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aaa, drop column bbb;
|
||||||
|
alter table bar drop column aaa, drop column bbb;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aaa, drop column ccc;
|
||||||
|
alter table bar drop column aaa, drop column ccc;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aaa, drop column ddd;
|
||||||
|
alter table bar drop column aaa, drop column ddd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column bbb, drop column aaa;
|
||||||
|
alter table bar drop column bbb, drop column aaa;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column bbb, drop column ccc;
|
||||||
|
alter table bar drop column bbb, drop column ccc;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column bbb, drop column ddd;
|
||||||
|
alter table bar drop column bbb, drop column ddd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column ccc, drop column aaa;
|
||||||
|
alter table bar drop column ccc, drop column aaa;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column ccc, drop column bbb;
|
||||||
|
alter table bar drop column ccc, drop column bbb;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column ccc, drop column ddd;
|
||||||
|
alter table bar drop column ccc, drop column ddd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column ddd, drop column aaa;
|
||||||
|
alter table bar drop column ddd, drop column aaa;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column ddd, drop column bbb;
|
||||||
|
alter table bar drop column ddd, drop column bbb;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column ddd, drop column ccc;
|
||||||
|
alter table bar drop column ddd, drop column ccc;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aaa, drop column bbb, drop column ccc;
|
||||||
|
alter table bar drop column aaa, drop column bbb, drop column ccc;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aaa, drop column bbb, drop column ddd;
|
||||||
|
alter table bar drop column aaa, drop column bbb, drop column ddd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column aaa, drop column ccc, drop column ddd;
|
||||||
|
alter table bar drop column aaa, drop column ccc, drop column ddd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (aaa varchar(12), bbb varbinary(20), ccc varchar(50), ddd varchar(3000)) engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,NULL,'2008-1-1',NULL);
|
||||||
|
insert into foo values (NULL,12345678987,NULL,1);
|
||||||
|
insert into foo values (2,20,'1999-11-11',0);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column bbb, drop column ccc, drop column ddd;
|
||||||
|
alter table bar drop column bbb, drop column ccc, drop column ddd;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
drop table foo; drop table bar;
|
111
mysql-test/suite/tokudb.alter_table/t/hcad_clustering.test
Executable file
111
mysql-test/suite/tokudb.alter_table/t/hcad_clustering.test
Executable file
|
@ -0,0 +1,111 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
let $diff_tables= test.foo, test.bar;
|
||||||
|
|
||||||
|
create table foo (a int NOT NULL, b bigint NOT NULL, c mediumint NOT NULL, primary key (a), clustering key (b))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column d int default 20;
|
||||||
|
alter table bar add column d int default 20;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
alter table foo add column d int default 20 first;
|
||||||
|
alter table bar add column d int default 20 first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
|
||||||
|
create table foo (a int NOT NULL, b bigint NOT NULL, c mediumint NOT NULL, primary key (c), clustering key (b))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column d int default 20;
|
||||||
|
alter table bar add column d int default 20;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
alter table foo add column d int default 20 first;
|
||||||
|
alter table bar add column d int default 20 first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
|
111
mysql-test/suite/tokudb.alter_table/t/hcad_clustering2.test
Executable file
111
mysql-test/suite/tokudb.alter_table/t/hcad_clustering2.test
Executable file
|
@ -0,0 +1,111 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
let $diff_tables= test.foo, test.bar;
|
||||||
|
|
||||||
|
create table foo (a varchar(10) NOT NULL, b varchar(10) NOT NULL, c varchar(10) NOT NULL, primary key (a), clustering key (b))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column d varchar(10) default 20;
|
||||||
|
alter table bar add column d varchar(10) default 20;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
alter table foo add column d varchar(10) default 20 first;
|
||||||
|
alter table bar add column d varchar(10) default 20 first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
|
||||||
|
create table foo (a varchar(10) NOT NULL, b varchar(10) NOT NULL, c varchar(10) NOT NULL, primary key (c), clustering key (b))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column d varchar(10) default 20;
|
||||||
|
alter table bar add column d varchar(10) default 20;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
alter table foo add column d varchar(10) default 20 first;
|
||||||
|
alter table bar add column d varchar(10) default 20 first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
select * from foo order by b desc;
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
|
102
mysql-test/suite/tokudb.alter_table/t/hcad_diff_num_offset_bytes.test
Executable file
102
mysql-test/suite/tokudb.alter_table/t/hcad_diff_num_offset_bytes.test
Executable file
|
@ -0,0 +1,102 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
let $diff_tables= test.foo, test.bar;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo(a varchar(10), b varchar (10), c varchar(10), d varchar(10))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (NULL, "bobby",NULL,"heehee");
|
||||||
|
insert into foo values ("BIGGER",NULL,"smaller",NULL);
|
||||||
|
insert into foo values ("aaaaaaaaaa","bbbbbbbbbb","cccccccccc","dddddddddd");
|
||||||
|
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
alter table foo add column e varchar(3000) default NULL;
|
||||||
|
alter table bar add column e varchar(3000) default NULL;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
alter table foo add column e varchar(3000) default NULL first;
|
||||||
|
alter table bar add column e varchar(3000) default NULL first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
|
||||||
|
alter table foo add column e varchar(3000) default NULL after b;
|
||||||
|
alter table bar add column e varchar(3000) default NULL after b;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
alter table foo add column e varchar(3000) default "abracadabraabracadabra";
|
||||||
|
alter table bar add column e varchar(3000) default "abracadabraabracadabra";
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
alter table foo add column e varchar(3000) default "abracadabraabracadabra" first;
|
||||||
|
alter table bar add column e varchar(3000) default "abracadabraabracadabra" first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
|
||||||
|
alter table foo add column e varchar(3000) default "abracadabraabracadabra" after b;
|
||||||
|
alter table bar add column e varchar(3000) default "abracadabraabracadabra" after b;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
|
||||||
|
alter table foo add column e varchar(3000) default NULL after b;
|
||||||
|
alter table bar add column e varchar(3000) default NULL after b;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
alter table foo add column e varchar(3000) NOT NULL default "abracadabraabracadabra";
|
||||||
|
alter table bar add column e varchar(3000) NOT NULL default "abracadabraabracadabra";
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
alter table foo add column e varchar(3000) NOT NULL default "abracadabraabracadabra" first;
|
||||||
|
alter table bar add column e varchar(3000) NOT NULL default "abracadabraabracadabra" first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
|
||||||
|
alter table foo add column e varchar(3000) NOT NULL default "abracadabraabracadabra" after b;
|
||||||
|
alter table bar add column e varchar(3000) NOT NULL default "abracadabraabracadabra" after b;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
5869
mysql-test/suite/tokudb.alter_table/t/hcad_fixedblob_add.test
Normal file
5869
mysql-test/suite/tokudb.alter_table/t/hcad_fixedblob_add.test
Normal file
File diff suppressed because it is too large
Load diff
5869
mysql-test/suite/tokudb.alter_table/t/hcad_fixedblob_add2.test
Normal file
5869
mysql-test/suite/tokudb.alter_table/t/hcad_fixedblob_add2.test
Normal file
File diff suppressed because it is too large
Load diff
1900
mysql-test/suite/tokudb.alter_table/t/hcad_fixedblob_drop.test
Normal file
1900
mysql-test/suite/tokudb.alter_table/t/hcad_fixedblob_drop.test
Normal file
File diff suppressed because it is too large
Load diff
5869
mysql-test/suite/tokudb.alter_table/t/hcad_fixedvar_add.test
Normal file
5869
mysql-test/suite/tokudb.alter_table/t/hcad_fixedvar_add.test
Normal file
File diff suppressed because it is too large
Load diff
5869
mysql-test/suite/tokudb.alter_table/t/hcad_fixedvar_add2.test
Normal file
5869
mysql-test/suite/tokudb.alter_table/t/hcad_fixedvar_add2.test
Normal file
File diff suppressed because it is too large
Load diff
1900
mysql-test/suite/tokudb.alter_table/t/hcad_fixedvar_drop.test
Normal file
1900
mysql-test/suite/tokudb.alter_table/t/hcad_fixedvar_drop.test
Normal file
File diff suppressed because it is too large
Load diff
98
mysql-test/suite/tokudb.alter_table/t/hcad_indexing_mix.test
Normal file
98
mysql-test/suite/tokudb.alter_table/t/hcad_indexing_mix.test
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
|
||||||
|
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), clustering key (b))engine=TokuDB;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column e;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column d;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column c;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column aaa int first;
|
||||||
|
alter table foo drop column aaa;
|
||||||
|
|
||||||
|
alter table foo add column aaa int first;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column aaa, drop index d;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column aaa, add index (bb);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop index b, add index b(b);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column aaa, drop index b, add index b(d);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column aaa, drop index b, add index b(b);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column aaa, drop index b, add clustering index b(b(5));
|
||||||
|
# successfully drop it
|
||||||
|
alter table foo drop column aaa, drop index b, add clustering index b(b);
|
||||||
|
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, drop index d;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, add index (bb);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, drop index b, add index b(b);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, drop index b, add index b(d);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, drop index b, add unique index b(b);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, drop index b, add index b(b);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, drop index b, add clustering index b(b(5));
|
||||||
|
# successfully add it
|
||||||
|
alter table foo add column aaa int, drop index b, add clustering index b(b);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column aaa, drop index c;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column aaa, add index (bb);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop index c, add index c(c);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column aaa, drop index c, add index c(d);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column aaa, drop index c, add index c(c);
|
||||||
|
# successfully drop it
|
||||||
|
alter table foo drop column aaa, drop index c, add unique index c(c);
|
||||||
|
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, drop index c;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, add index (bb);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, drop index c, add index c(c);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, drop index c, add index c(d);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, drop index c, add clustering index c(c);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaa int, drop index c, add index c(c);
|
||||||
|
# successfully add it
|
||||||
|
alter table foo add column aaa int, drop index c, add unique index c(c);
|
||||||
|
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaaa int, drop column c;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaaa int, add column bbbb int, drop column c;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo add column aaaa int, drop column c, drop column b;
|
||||||
|
|
||||||
|
|
||||||
|
drop table foo;
|
121
mysql-test/suite/tokudb.alter_table/t/hcad_null_bits.test
Normal file
121
mysql-test/suite/tokudb.alter_table/t/hcad_null_bits.test
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
let $diff_tables= test.foo, test.bar;
|
||||||
|
|
||||||
|
# test adding the first null bit to a table
|
||||||
|
create table foo (a int NOT NULL, b bigint NOT NULL, c tinyint NOT NULL, d int NOT NULL, primary key (b))engine=TokuDB;
|
||||||
|
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);
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
alter table foo add column e int default NULL first;
|
||||||
|
alter table bar add column e int default NULL first;
|
||||||
|
select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo add column e int default -1 first;
|
||||||
|
alter table bar add column e int default -1 first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column e;
|
||||||
|
alter table bar drop column e;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo add column e int NOT NULL default -1 first;
|
||||||
|
alter table bar add column e int NOT NULL default -1 first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
########################### some simple tests ###############
|
||||||
|
create table foo (a int, b int not null, c int, d int not null, e int, primary key (e))engine=TokuDB;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column e;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
|
||||||
|
insert into foo values (NULL, -1, NULL, -1,1),(0,0,0,0,0),(NULL,234,234,324,234),(98567,76,NULL,7668,90909);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
alter table foo drop column b;
|
||||||
|
alter table bar drop column b;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column a;
|
||||||
|
alter table bar drop column a;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
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;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop column e;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
|
||||||
|
insert into foo values (NULL, "-1", NULL, "-1",1),("dfg0","0rrr","eee0","qwert",0),(NULL,"234","234","324",234),("98567","76",NULL,"7668","90909");
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
alter table foo drop column b;
|
||||||
|
alter table bar drop column b;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop column a;
|
||||||
|
alter table bar drop column a;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
drop table foo; drop table bar;
|
||||||
|
|
||||||
|
create table foo(
|
||||||
|
a int,
|
||||||
|
b int,
|
||||||
|
c int,
|
||||||
|
d int,
|
||||||
|
e int,
|
||||||
|
f int,
|
||||||
|
g int,
|
||||||
|
h int,
|
||||||
|
aa int,
|
||||||
|
bb int,
|
||||||
|
cc int,
|
||||||
|
dd int
|
||||||
|
)engine = TokuDB;
|
||||||
|
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
|
||||||
|
insert into foo values (NULL,-1,NULL,-1,NULL,-1,NULL,-1,NULL,-1,NULL,-1);
|
||||||
|
insert into foo values (-1,NULL,-1,NULL,-1,NULL,-1,NULL,-1,NULL,-1,NULL);
|
||||||
|
insert into foo values (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||||
|
insert into foo values (-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column a, drop column aa, drop column c, drop column cc, drop column e, drop column f;
|
||||||
|
alter table bar drop column a, drop column aa, drop column c, drop column cc, drop column e, drop column f;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
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;
|
||||||
|
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;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
drop table foo; drop table bar;
|
95
mysql-test/suite/tokudb.alter_table/t/hcad_pk.test
Executable file
95
mysql-test/suite/tokudb.alter_table/t/hcad_pk.test
Executable file
|
@ -0,0 +1,95 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
let $diff_tables= test.foo, test.bar;
|
||||||
|
|
||||||
|
create table foo (a int NOT NULL, b bigint NOT NULL, c mediumint NOT NULL, primary key (a))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column d int default 20;
|
||||||
|
alter table bar add column d int default 20;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column d int default 20 first;
|
||||||
|
alter table bar add column d int default 20 first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
|
||||||
|
create table foo (a int NOT NULL, b bigint NOT NULL, c mediumint NOT NULL, primary key (c))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column d int default 20;
|
||||||
|
alter table bar add column d int default 20;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column d int default 20 first;
|
||||||
|
alter table bar add column d int default 20 first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
|
95
mysql-test/suite/tokudb.alter_table/t/hcad_pk2.test
Executable file
95
mysql-test/suite/tokudb.alter_table/t/hcad_pk2.test
Executable file
|
@ -0,0 +1,95 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
let $diff_tables= test.foo, test.bar;
|
||||||
|
|
||||||
|
create table foo (a varchar(10) NOT NULL, b varchar(10) NOT NULL, c varchar(10) NOT NULL, primary key (a))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column d varchar(10) default 20;
|
||||||
|
alter table bar add column d varchar(10) default 20;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column d varchar(10) default 20 first;
|
||||||
|
alter table bar add column d varchar(10) default 20 first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
|
||||||
|
create table foo (a varchar(10) NOT NULL, b varchar(10) NOT NULL, c varchar(10) NOT NULL, primary key (c))engine=TokuDB;
|
||||||
|
create table bar like foo;
|
||||||
|
alter table bar engine=MyISAM;
|
||||||
|
|
||||||
|
insert into foo values (1,10,100),(-1,-1,-1),(2,20,200);
|
||||||
|
insert into bar select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column d varchar(10) default 20;
|
||||||
|
alter table bar add column d varchar(10) default 20;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (3,30,300,3000);
|
||||||
|
insert into bar values (3,30,300,3000);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
insert into bar values (4,40,400);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column d varchar(10) default 20 first;
|
||||||
|
alter table bar add column d varchar(10) default 20 first;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (5,50,500,5000);
|
||||||
|
insert into bar values (5,50,500,5000);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo drop column d;
|
||||||
|
alter table bar drop column d;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
select * from foo;
|
||||||
|
insert into foo values (6,60,600);
|
||||||
|
insert into bar values (6,60,600);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
|
12
mysql-test/suite/tokudb.alter_table/t/hcad_template.test
Normal file
12
mysql-test/suite/tokudb.alter_table/t/hcad_template.test
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#drop table foo;
|
26
mysql-test/suite/tokudb.alter_table/t/hcad_tmp_tables.test
Normal file
26
mysql-test/suite/tokudb.alter_table/t/hcad_tmp_tables.test
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
create temporary table bar (a int, key(a))engine=TOkuDB;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table bar add column c int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
create index blah on bar(a);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
drop index a on bar;
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=OFF;
|
||||||
|
insert into bar values (1),(2),(3);
|
||||||
|
alter table bar add column b int default 1 first;
|
||||||
|
select * from bar;
|
||||||
|
create index blah on bar (b);
|
||||||
|
select sum(b) from bar;
|
||||||
|
drop index a on bar;
|
||||||
|
|
||||||
|
drop table bar;
|
5869
mysql-test/suite/tokudb.alter_table/t/hcad_varblob_add.test
Normal file
5869
mysql-test/suite/tokudb.alter_table/t/hcad_varblob_add.test
Normal file
File diff suppressed because it is too large
Load diff
5869
mysql-test/suite/tokudb.alter_table/t/hcad_varblob_add2.test
Normal file
5869
mysql-test/suite/tokudb.alter_table/t/hcad_varblob_add2.test
Normal file
File diff suppressed because it is too large
Load diff
1900
mysql-test/suite/tokudb.alter_table/t/hcad_varblob_drop.test
Normal file
1900
mysql-test/suite/tokudb.alter_table/t/hcad_varblob_drop.test
Normal file
File diff suppressed because it is too large
Load diff
39
mysql-test/suite/tokudb.alter_table/t/hcad_with_dels.test
Executable file
39
mysql-test/suite/tokudb.alter_table/t/hcad_with_dels.test
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
# test simple MVCC, that a transaction does not read something committed after it
|
||||||
|
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE = 'tokudb';
|
||||||
|
set session transaction isolation level repeatable read;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
--echo # Establish connection conn1 (user = root)
|
||||||
|
connect (conn1,localhost,root,,);
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
connection conn1;
|
||||||
|
set session transaction isolation level repeatable read;
|
||||||
|
create table foo (a int, b int) engine=TokuDB;
|
||||||
|
create table bar (a int) engine=TokuDB;
|
||||||
|
insert into foo values (1,10),(2,20),(3,30);
|
||||||
|
|
||||||
|
begin;
|
||||||
|
select * from bar;
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
delete from foo;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo add column c int first;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
connection conn1;
|
||||||
|
commit;
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
disconnect conn1;
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
# Final cleanup.
|
||||||
|
set session transaction isolation level serializable;
|
||||||
|
DROP TABLE foo,bar;
|
|
@ -0,0 +1,99 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
drop procedure if exists p0;
|
||||||
|
drop procedure if exists p1;
|
||||||
|
drop function if exists f0;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
create table foo (a int, b int, c int, clustering key (b))engine=TokuDB;
|
||||||
|
insert into foo values (1,10,100),(2,20,200),(3,30,300);
|
||||||
|
|
||||||
|
#test that alter table works with autocommit off;
|
||||||
|
set autocommit=off;
|
||||||
|
insert into foo values (4,40,400);
|
||||||
|
alter table foo add column z int default 999 first;
|
||||||
|
explain select * from foo;
|
||||||
|
select * from foo;
|
||||||
|
explain select * from foo where b > 20;
|
||||||
|
select* from foo where b > 10;
|
||||||
|
set autocommit=on;
|
||||||
|
|
||||||
|
#test that alter table works with autocommit off;
|
||||||
|
begin;
|
||||||
|
alter table foo drop column z;
|
||||||
|
explain select * from foo;
|
||||||
|
select * from foo;
|
||||||
|
explain select * from foo where b > 20;
|
||||||
|
select* from foo where b > 10;
|
||||||
|
|
||||||
|
|
||||||
|
#simple test with lock tables
|
||||||
|
|
||||||
|
lock tables foo write;
|
||||||
|
alter table foo add column z int;
|
||||||
|
explain select * from foo;
|
||||||
|
select * from foo;
|
||||||
|
explain select * from foo where b > 20;
|
||||||
|
select* from foo where b > 10;
|
||||||
|
unlock tables;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo where b > 10;
|
||||||
|
|
||||||
|
delimiter |;
|
||||||
|
create procedure p0()
|
||||||
|
begin
|
||||||
|
alter table foo drop column z;
|
||||||
|
explain select * from foo;
|
||||||
|
select * from foo;
|
||||||
|
explain select * from foo where b > 20;
|
||||||
|
select* from foo where b > 10;
|
||||||
|
end |
|
||||||
|
delimiter ;|
|
||||||
|
|
||||||
|
call p0();
|
||||||
|
explain select * from foo;
|
||||||
|
select * from foo;
|
||||||
|
explain select * from foo where b > 20;
|
||||||
|
select* from foo where b > 10;
|
||||||
|
|
||||||
|
delimiter |;
|
||||||
|
--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
create function f0() returns int
|
||||||
|
begin
|
||||||
|
alter table foo add column ggg int;
|
||||||
|
end|
|
||||||
|
|
||||||
|
delimiter ;|
|
||||||
|
|
||||||
|
|
||||||
|
set autocommit=0;
|
||||||
|
|
||||||
|
delimiter |;
|
||||||
|
create procedure p1()
|
||||||
|
begin
|
||||||
|
insert into foo values(5,50,500);
|
||||||
|
select * from foo;
|
||||||
|
savepoint x;
|
||||||
|
alter table foo add column g int;
|
||||||
|
explain select * from foo;
|
||||||
|
select * from foo;
|
||||||
|
select * from foo where b > 10;
|
||||||
|
explain select * from foo where b > 20;
|
||||||
|
end|
|
||||||
|
delimiter ;|
|
||||||
|
|
||||||
|
call p1();
|
||||||
|
set autocommit=on;
|
||||||
|
explain select * from foo;
|
||||||
|
select * from foo;
|
||||||
|
explain select * from foo where b > 10;
|
||||||
|
select * from foo where b > 10;
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
drop procedure p0;
|
||||||
|
drop procedure p1;
|
46
mysql-test/suite/tokudb.alter_table/t/hcad_with_locks.test
Executable file
46
mysql-test/suite/tokudb.alter_table/t/hcad_with_locks.test
Executable file
|
@ -0,0 +1,46 @@
|
||||||
|
# test simple MVCC, that a transaction does not read something committed after it
|
||||||
|
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE = 'tokudb';
|
||||||
|
set session transaction isolation level repeatable read;
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
--echo # Establish connection conn1 (user = root)
|
||||||
|
connect (conn1,localhost,root,,);
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
connection conn1;
|
||||||
|
set session transaction isolation level repeatable read;
|
||||||
|
create table foo (a int, b int) engine=TokuDB;
|
||||||
|
insert into foo values (1,10);
|
||||||
|
begin;
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
alter table foo add column c int;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
connection conn1;
|
||||||
|
commit;
|
||||||
|
begin;
|
||||||
|
insert into foo values (1,10);
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
--error ER_LOCK_WAIT_TIMEOUT
|
||||||
|
alter table foo add column cc int;
|
||||||
|
--error ER_LOCK_WAIT_TIMEOUT
|
||||||
|
alter table foo drop column c;
|
||||||
|
|
||||||
|
connection conn1;
|
||||||
|
commit;
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
disconnect conn1;
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
# Final cleanup.
|
||||||
|
set session transaction isolation level serializable;
|
||||||
|
DROP TABLE foo;
|
49
mysql-test/suite/tokudb.alter_table/t/hcr.test
Normal file
49
mysql-test/suite/tokudb.alter_table/t/hcr.test
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
# test that modifying a column with more than just a rename is not fast
|
||||||
|
create table foo (a int, b varchar(10), c blob)engine=TokuDB;
|
||||||
|
insert into foo values(1,"bb","cccc");
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change a aa int, change b bb varchar(10);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change b bb varchar(11);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change a aa bigint;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change a aa int NOT NULL;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change a aa int, alter column b drop default;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change b bb varchar(10) CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change c cc mediumblob;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change a aa int, add column d int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change a aa int, drop column c;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change a aa int, add index (b);
|
||||||
|
alter table foo add index(b);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change a aa int, drop index b;
|
||||||
|
show create table foo;
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
#--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change a aa int DEFAULT 1000;
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
|
||||||
|
create table foo (a int, b int, c int) engine=TokuDB;
|
||||||
|
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change c cc int, change a b int, change b a int first;
|
||||||
|
|
||||||
|
drop table foo;
|
86
mysql-test/suite/tokudb.alter_table/t/hcr2.test
Normal file
86
mysql-test/suite/tokudb.alter_table/t/hcr2.test
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
create table foo (
|
||||||
|
a1 int,
|
||||||
|
a2 int unsigned,
|
||||||
|
a3 tinyint,
|
||||||
|
a4 tinyint unsigned,
|
||||||
|
a5 bit,
|
||||||
|
a6 smallint,
|
||||||
|
a7 smallint unsigned,
|
||||||
|
a8 mediumint,
|
||||||
|
a9 mediumint unsigned,
|
||||||
|
a10 bigint,
|
||||||
|
a11 bigint unsigned,
|
||||||
|
a12 double,
|
||||||
|
a13 double unsigned,
|
||||||
|
a14 float,
|
||||||
|
a15 float unsigned,
|
||||||
|
a16 decimal,
|
||||||
|
a17 date,
|
||||||
|
a18 datetime,
|
||||||
|
a19 timestamp,
|
||||||
|
a20 time,
|
||||||
|
a21 year,
|
||||||
|
a22 binary(100),
|
||||||
|
a23 varbinary(100),
|
||||||
|
a24 varchar(10),
|
||||||
|
a25 varchar(10) CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a26 char(10),
|
||||||
|
a27 char(10) CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a28 ENUM('a','b','c') CHARACTER SET binary,
|
||||||
|
a29 tinyblob,
|
||||||
|
a30 tinytext CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a31 blob,
|
||||||
|
a32 text CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a33 mediumblob,
|
||||||
|
a34 mediumtext CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a35 longblob,
|
||||||
|
a36 longtext CHARACTER SET latin1 COLLATE latin1_general_cs
|
||||||
|
)engine = TokuDB;
|
||||||
|
|
||||||
|
alter table foo change a1 aa1 int;
|
||||||
|
alter table foo change a2 aa2 int unsigned;
|
||||||
|
alter table foo change a3 aa3 tinyint;
|
||||||
|
alter table foo change a4 aa4 tinyint unsigned;
|
||||||
|
alter table foo change a5 aa5 bit;
|
||||||
|
alter table foo change a6 aa6 smallint;
|
||||||
|
alter table foo change a7 aa7 smallint unsigned;
|
||||||
|
alter table foo change a8 aa8 mediumint;
|
||||||
|
alter table foo change a9 aa9 mediumint unsigned;
|
||||||
|
alter table foo change a10 aa10 bigint;
|
||||||
|
alter table foo change a11 aa11 bigint unsigned;
|
||||||
|
alter table foo change a12 aa12 double;
|
||||||
|
alter table foo change a13 aa13 double unsigned;
|
||||||
|
alter table foo change a14 aa14 float;
|
||||||
|
alter table foo change a15 aa15 float unsigned;
|
||||||
|
alter table foo change a16 aa16 decimal;
|
||||||
|
alter table foo change a17 aa17 date;
|
||||||
|
alter table foo change a18 aa18 datetime;
|
||||||
|
alter table foo change a19 aa19 timestamp;
|
||||||
|
#alter table foo change a20 aa20 time;
|
||||||
|
alter table foo change a21 aa21 year;
|
||||||
|
#alter table foo change a22 aa22 binary(100);
|
||||||
|
alter table foo change a23 aa23 varbinary(100);
|
||||||
|
alter table foo change a24 aa24 varchar(10);
|
||||||
|
alter table foo change a25 aa25 varchar(10) CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
alter table foo change a26 aa26 char(10);
|
||||||
|
alter table foo change a27 aa27 char(10) CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
#alter table foo change a28 aa28 ENUM('a','b','c') CHARACTER SET binary;
|
||||||
|
#alter table foo change a29 aa29 tinyblob;
|
||||||
|
alter table foo change a30 aa30 tinytext CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
#alter table foo change a31 aa31 blob;
|
||||||
|
alter table foo change a32 aa32 text CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
#alter table foo change a33 aa33 mediumblob;
|
||||||
|
alter table foo change a34 aa34 mediumtext CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
#alter table foo change a35 aa35 longblob;
|
||||||
|
alter table foo change a36 aa36 longtext CHARACTER SET latin1 COLLATE latin1_general_cs;
|
||||||
|
|
||||||
|
drop table foo;
|
31
mysql-test/suite/tokudb.alter_table/t/hcr3.test
Normal file
31
mysql-test/suite/tokudb.alter_table/t/hcr3.test
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
create table foo (a int, b bigint, c char(10), d varchar(10), e text, primary key (a), key(b), clustering key (d))engine=TOkuDB;
|
||||||
|
|
||||||
|
insert into foo values (1,10,"cc","dddd","eeeee");
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo change a aa int;
|
||||||
|
show create table foo;
|
||||||
|
select * from foo;
|
||||||
|
explain select * from foo where aa > 0;
|
||||||
|
select * from foo where aa > 0;
|
||||||
|
|
||||||
|
alter table foo change b bb bigint;
|
||||||
|
show create table foo;
|
||||||
|
explain select bb from foo FORCE INDEX (b) where bb > 5;
|
||||||
|
select bb from foo FORCE INDEX (b) where bb > 5;
|
||||||
|
|
||||||
|
alter table foo change d dd varchar(10);
|
||||||
|
show create table foo;
|
||||||
|
explain select * from foo where dd > "d";
|
||||||
|
select * from foo where dd > "d";
|
||||||
|
|
||||||
|
drop table foo;
|
125
mysql-test/suite/tokudb.alter_table/t/other_alter.test
Normal file
125
mysql-test/suite/tokudb.alter_table/t/other_alter.test
Normal file
|
@ -0,0 +1,125 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
|
||||||
|
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), clustering key (b))engine=TokuDB;
|
||||||
|
create table bar (a int) engine=TokuDB;
|
||||||
|
|
||||||
|
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop primary key;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop primary key, add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop primary key, drop column aa;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table bar add primary key (a);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table bar add primary key (a), add column z int;
|
||||||
|
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop primary key, add primary key (b);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop primary key, add primary key (b), add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo drop primary key, add primary key (b), drop column aa;
|
||||||
|
|
||||||
|
--error ER_TABLE_CANT_HANDLE_FT
|
||||||
|
alter table foo add fulltext key(b);
|
||||||
|
--error ER_TABLE_CANT_HANDLE_SPKEYS
|
||||||
|
alter table foo add spatial key (aa);
|
||||||
|
|
||||||
|
# Supporting these should be trivial
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo alter column cc set default 101010;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo alter column cc set default NULL;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo alter column cc drop default;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo alter column cc set default 101010, add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo alter column cc set default NULL, add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo alter column cc drop default, add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo alter column cc set default 101010, drop column aa;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo alter column cc set default NULL, drop column aa;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo alter column cc drop default, drop column aa;
|
||||||
|
|
||||||
|
# these one day MAY be supported
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aaa int, add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column e epk int, add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aaa int, drop column bb;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column e epk int, drop column bb;
|
||||||
|
show create table foo;
|
||||||
|
|
||||||
|
# the following changes of a column should be slow
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aa int NOT NULL;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aa bigint;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aa varchar(20);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aa int after cc;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo modify column aa int NOT NULL;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo modify column aa bigint;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo modify column aa varchar(20);
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo modify column aa int after cc;
|
||||||
|
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aa int NOT NULL, add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aa bigint, add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aa varchar(20), add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aa int after cc, add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo modify column aa int NOT NULL, add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo modify column aa bigint, add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo modify column aa varchar(20), add column z int;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo modify column aa int after cc, add column z int;
|
||||||
|
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aa int NOT NULL, drop column bb;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aa bigint, drop column bb;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aa varchar(20), drop column bb;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo change column aa aa int after cc, drop column bb;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo modify column aa int NOT NULL, drop column bb;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo modify column aa bigint, drop column bb;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo modify column aa varchar(20), drop column bb;
|
||||||
|
--error ER_UNSUPPORTED_EXTENSION
|
||||||
|
alter table foo modify column aa int after cc, drop column bb;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
|
101
mysql-test/suite/tokudb.alter_table/t/other_alter2.test
Normal file
101
mysql-test/suite/tokudb.alter_table/t/other_alter2.test
Normal file
|
@ -0,0 +1,101 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar, foo_isam, bar_isam;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=OFF;
|
||||||
|
let $diff_tables= test.foo, test.foo_isam;
|
||||||
|
|
||||||
|
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), clustering key (b))engine=TokuDB;
|
||||||
|
create table foo_isam like foo;
|
||||||
|
alter table foo_isam engine=MyISAM;
|
||||||
|
create table bar (a int) engine=TokuDB;
|
||||||
|
create table bar_isam like bar;
|
||||||
|
alter table bar_isam engine=MyISAM;
|
||||||
|
|
||||||
|
insert into foo values (1,10,100,1000,10000,1,"bb",10,100,1000);
|
||||||
|
insert into foo values (2,20,200,2000,20000,2,"bbb",20,200,2000);
|
||||||
|
insert into foo values (3,30,300,3000,30000,3,"bbbb",30,300,3000);
|
||||||
|
insert into foo_isam select * from foo;
|
||||||
|
|
||||||
|
|
||||||
|
alter table foo drop primary key;
|
||||||
|
alter table foo_isam drop primary key;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo add primary key (e);
|
||||||
|
alter table foo_isam add primary key (e);
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo drop primary key, add primary key(a);
|
||||||
|
alter table foo_isam drop primary key, add primary key (a);
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
--error ER_TABLE_CANT_HANDLE_FT
|
||||||
|
alter table foo add fulltext key(b);
|
||||||
|
--error ER_TABLE_CANT_HANDLE_SPKEYS
|
||||||
|
alter table foo add spatial key (aa);
|
||||||
|
|
||||||
|
# Supporting these should be trivial
|
||||||
|
alter table foo alter column cc set default 101010;
|
||||||
|
alter table foo_isam alter column cc set default 101010;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo alter column cc set default NULL;
|
||||||
|
alter table foo_isam alter column cc set default NULL;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo alter column cc drop default;
|
||||||
|
alter table foo_isam alter column cc drop default;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
|
||||||
|
alter table foo change column aa aaa int;
|
||||||
|
alter table foo_isam change column aa aaa int;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo change column aaa aa int;
|
||||||
|
alter table foo_isam change column aaa aa int;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
|
||||||
|
alter table foo change column e epk int;
|
||||||
|
alter table foo_isam change column e epk int;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo change column epk e int;
|
||||||
|
alter table foo_isam change column epk e int;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
show create table foo;
|
||||||
|
show create table foo_isam;
|
||||||
|
|
||||||
|
# the following changes of a column should be slow
|
||||||
|
alter table foo change column aa aa int NOT NULL;
|
||||||
|
alter table foo_isam change column aa aa int NOT NULL;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo change column aa aa bigint;
|
||||||
|
alter table foo_isam change column aa aa bigint;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo change column aa aa varchar(20);
|
||||||
|
alter table foo_isam change column aa aa varchar(20);
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo change column aa aa int after cc;
|
||||||
|
alter table foo_isam change column aa aa int after cc;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
|
||||||
|
alter table foo modify column aa int NOT NULL;
|
||||||
|
alter table foo_isam modify column aa int NOT NULL;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo modify column aa bigint;
|
||||||
|
alter table foo_isam modify column aa bigint;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo modify column aa varchar(20);
|
||||||
|
alter table foo_isam modify column aa varchar(20);
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
alter table foo modify column aa int after cc;
|
||||||
|
alter table foo_isam modify column aa int after cc;
|
||||||
|
source include/diff_tables.inc;
|
||||||
|
|
||||||
|
|
||||||
|
drop table foo;
|
||||||
|
drop table bar;
|
||||||
|
drop table foo_isam;
|
||||||
|
drop table bar_isam;
|
|
@ -0,0 +1,151 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo,bar;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (
|
||||||
|
a1 int,
|
||||||
|
a2 int unsigned,
|
||||||
|
a3 tinyint,
|
||||||
|
a4 tinyint unsigned,
|
||||||
|
a5 bit,
|
||||||
|
a6 smallint,
|
||||||
|
a7 smallint unsigned,
|
||||||
|
a8 mediumint,
|
||||||
|
a9 mediumint unsigned,
|
||||||
|
a10 bigint,
|
||||||
|
a11 bigint unsigned,
|
||||||
|
a12 double,
|
||||||
|
a13 double unsigned,
|
||||||
|
a14 float,
|
||||||
|
a15 float unsigned,
|
||||||
|
a16 decimal,
|
||||||
|
a17 date,
|
||||||
|
a18 datetime,
|
||||||
|
a19 timestamp,
|
||||||
|
a20 time,
|
||||||
|
a21 year,
|
||||||
|
a22 binary(100),
|
||||||
|
a23 varbinary(100),
|
||||||
|
a24 varchar(10),
|
||||||
|
a25 varchar(10) CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a26 char(10),
|
||||||
|
a27 char(10) CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a28 ENUM('a','b','c') CHARACTER SET binary,
|
||||||
|
a29 tinyblob,
|
||||||
|
a30 tinytext CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a31 blob,
|
||||||
|
a32 text CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a33 mediumblob,
|
||||||
|
a34 mediumtext CHARACTER SET latin1 COLLATE latin1_general_cs,
|
||||||
|
a35 longblob,
|
||||||
|
a36 longtext CHARACTER SET latin1 COLLATE latin1_general_cs
|
||||||
|
)engine = TokuDB;
|
||||||
|
|
||||||
|
alter table foo add column b int;
|
||||||
|
drop table foo;
|
||||||
|
|
||||||
|
create table foo (a tinyint NOT NULL)engine=TokuDB;
|
||||||
|
insert into foo values(1),(0),(-1);
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column a5 bit(8) NOT NULL default b'1' first;
|
||||||
|
show create table foo;
|
||||||
|
select a5+0,a from foo;
|
||||||
|
alter table foo drop column a5;
|
||||||
|
select * from foo;
|
||||||
|
|
||||||
|
alter table foo add column b smallint NOT NULL default -1 first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b mediumint NOT NULL default -1 first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b double NOT NULL default -1.0 first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b float NOT NULL default -1.0 first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b date NOT NULL default '1981-11-01' first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b datetime NOT NULL default '1981-11-01 17:17:17' first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b timestamp NOT NULL default '1981-11-01 17:17:17' first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b time NOT NULL default '17:17:17' first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b year NOT NULL default '1981' first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b binary(255) NOT NULL default "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b varbinary(255) NOT NULL default "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b char(255) NOT NULL default "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b varchar(255) NOT NULL default "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b ENUM('a','b','c') CHARACTER SET binary NOT NULL default 'b' first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b blob first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b tinyblob first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b mediumblob first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b longblob first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b text first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b tinytext first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b mediumtext first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
alter table foo add column b longtext first;
|
||||||
|
select * from foo;
|
||||||
|
alter table foo drop column b;
|
||||||
|
|
||||||
|
drop table foo;
|
22
mysql-test/suite/tokudb.alter_table/t/virtual_columns.test
Executable file
22
mysql-test/suite/tokudb.alter_table/t/virtual_columns.test
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#--source include/have_tokudb.inc
|
||||||
|
SET STORAGE_ENGINE='tokudb';
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS foo;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
set session tokudb_disable_slow_alter=ON;
|
||||||
|
|
||||||
|
--error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS
|
||||||
|
create table foo (a int, b int, c int, d int as (a mod 10) virtual, key(a))engine=TokuDB;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
create table foo (a int, b int, c int)engine=TokuDB;
|
||||||
|
--error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS
|
||||||
|
alter table foo add column d int as (a mod 10) virtual;
|
||||||
|
--error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS
|
||||||
|
alter table foo add column d int as (a mod 10) persistent;
|
||||||
|
|
||||||
|
|
||||||
|
drop table foo;
|
Loading…
Add table
Reference in a new issue