Commit ad974e3b authored by Rik Prohaska's avatar Rik Prohaska

DB-811 test case for lock tables + add column schema mismatch bug

parent 7a340808
drop table if exists t2,t3,t4;
CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB;
CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb;
CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 13;
LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE;
INSERT INTO t2(a)VALUES (REPEAT(0,1));
ALTER TABLE t2 ADD COLUMN(c INT);
alter table t4 add column c int;
UPDATE t2 SET a=1;
select * from t2;
a b c
1 NULL NULL
unlock tables;
drop table t2,t3,t4;
drop table if exists t2,t3,t4;
CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB;
CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb;
CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 1;
LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE;
INSERT INTO t2(a)VALUES (REPEAT(0,1));
ALTER TABLE t2 ADD COLUMN(c INT);
alter table t4 add column c int;
UPDATE t2 SET a=1;
select * from t2;
a b c
1 NULL NULL
unlock tables;
drop table t2,t3,t4;
# DB-811 test that alter table t2 updates both the schema (FRM) and the data (tokudb files)
source include/have_tokudb.inc;
source include/have_innodb.inc;
disable_warnings;
drop table if exists t2,t3,t4;
enable_warnings;
CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB;
CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb;
CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 13;
LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE;
INSERT INTO t2(a)VALUES (REPEAT(0,1));
ALTER TABLE t2 ADD COLUMN(c INT);
alter table t4 add column c int;
UPDATE t2 SET a=1;
select * from t2;
unlock tables;
drop table t2,t3,t4;
# DB-811 test that alter table t2 updates both the schema (FRM) and the data (tokudb files)
source include/have_tokudb.inc;
source include/have_innodb.inc;
disable_warnings;
drop table if exists t2,t3,t4;
enable_warnings;
CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB;
CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb;
CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 1;
LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE;
INSERT INTO t2(a)VALUES (REPEAT(0,1));
ALTER TABLE t2 ADD COLUMN(c INT);
alter table t4 add column c int;
UPDATE t2 SET a=1;
select * from t2;
unlock tables;
drop table t2,t3,t4;
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