Commit b6074f6c authored by Zardosht Kasheff's avatar Zardosht Kasheff

[t:4853], add test

git-svn-id: file:///svn/mysql/tests/mysql-test@44921 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1097e5a3
SET STORAGE_ENGINE='tokudb';
DROP TABLE IF EXISTS foo;
set session tokudb_disable_slow_alter=ON;
create table foo(a int auto_increment, b int, primary key (a))engine=TokuDB;
insert into foo (b) values (11),(21),(32);
select * from foo;
a b
1 11
2 21
3 32
alter table foo auto_increment=1000;
show create table foo;
Table Create Table
foo CREATE TABLE `foo` (
`a` int(11) NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=TokuDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
insert into foo (b) values (11),(21),(32);
select * from foo;
a b
1 11
2 21
3 32
1000 11
1001 21
1002 32
show create table foo;
Table Create Table
foo CREATE TABLE `foo` (
`a` int(11) NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=TokuDB AUTO_INCREMENT=1003 DEFAULT CHARSET=latin1
alter table foo auto_increment=10;
insert into foo (b) values (11),(21),(32);
select * from foo;
a b
1 11
2 21
3 32
1000 11
1001 21
1002 32
1003 11
1004 21
1005 32
show create table foo;
Table Create Table
foo CREATE TABLE `foo` (
`a` int(11) NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=TokuDB AUTO_INCREMENT=1006 DEFAULT CHARSET=latin1
alter table foo auto_increment=100000, add column c int;
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
alter table foo auto_increment=100000, drop column b;
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
alter table foo auto_increment=100000, add key b(b);
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
alter table foo auto_increment=100000, change b b bigint;
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
alter table foo auto_increment=100000, change b c int;
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
alter table foo auto_increment=100000, ROW_FORMAT=TOKUDB_LZMA;
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
alter table foo auto_increment=100000, change b b int DEFAULT 111;
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MySQL version
DROP TABLE foo;
#--source include/have_tokudb.inc
#
# Attempt to change row format with and without
# other ALTER TABLE statements.
#
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 auto_increment, b int, primary key (a))engine=TokuDB;
insert into foo (b) values (11),(21),(32);
select * from foo;
alter table foo auto_increment=1000;
show create table foo;
insert into foo (b) values (11),(21),(32);
select * from foo;
show create table foo;
alter table foo auto_increment=10;
insert into foo (b) values (11),(21),(32);
select * from foo;
show create table foo;
--error ER_UNSUPPORTED_EXTENSION
alter table foo auto_increment=100000, add column c int;
--error ER_UNSUPPORTED_EXTENSION
alter table foo auto_increment=100000, drop column b;
--error ER_UNSUPPORTED_EXTENSION
alter table foo auto_increment=100000, add key b(b);
--error ER_UNSUPPORTED_EXTENSION
alter table foo auto_increment=100000, change b b bigint;
--error ER_UNSUPPORTED_EXTENSION
alter table foo auto_increment=100000, change b c int;
--error ER_UNSUPPORTED_EXTENSION
alter table foo auto_increment=100000, ROW_FORMAT=TOKUDB_LZMA;
--error ER_UNSUPPORTED_EXTENSION
alter table foo auto_increment=100000, change b b int DEFAULT 111;
DROP TABLE foo;
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment