From 6526694dba2e06fb80496d724419b16ef138a380 Mon Sep 17 00:00:00 2001 From: Zardosht Kasheff Date: Wed, 8 Feb 2012 20:36:55 +0000 Subject: [PATCH] [t:4472], add test git-svn-id: file:///svn/mysql/tests/mysql-test@39741 c7de825b-a66e-492c-adef-691d508d4ae1 --- mysql-test/suite/tokudb.bugs/r/4472.result | 38 +++++++++++++++ mysql-test/suite/tokudb.bugs/t/4472.test | 57 ++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 mysql-test/suite/tokudb.bugs/r/4472.result create mode 100755 mysql-test/suite/tokudb.bugs/t/4472.test diff --git a/mysql-test/suite/tokudb.bugs/r/4472.result b/mysql-test/suite/tokudb.bugs/r/4472.result new file mode 100644 index 00000000000..1163a4c2ec8 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/r/4472.result @@ -0,0 +1,38 @@ +SET STORAGE_ENGINE = 'tokudb'; +set session transaction isolation level repeatable read; +# Establish connection conn1 (user = root) +DROP TABLE IF EXISTS foo; +set session transaction isolation level repeatable read; +create table foo (a int) engine=TokuDB; +insert into foo values (1); +begin; +select * from foo; +a +1 +alter table foo add column b int; +alter table foo change b b bigint; +truncate table foo; +rename table foo to bar; +drop table bar; +select * From foo; +ERROR 42S02: Table 'test.foo' doesn't exist +set session transaction isolation level serializable; +create table foo (a int) engine=TokuDB; +insert into foo values (1); +begin; +insert into foo values(2); +alter table foo add column b int; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +alter table foo change a a bigint; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +truncate table foo; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +rename table foo to bar; +ERROR HY000: Error on rename of './test/foo' to './test/bar' (errno: -30994) +drop table foo; +ERROR 42S02: Unknown table 'foo' +select * From foo; +a +1 +2 +drop table foo; diff --git a/mysql-test/suite/tokudb.bugs/t/4472.test b/mysql-test/suite/tokudb.bugs/t/4472.test new file mode 100755 index 00000000000..3439bdd36bb --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/4472.test @@ -0,0 +1,57 @@ +# 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; + +--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) engine=TokuDB; +insert into foo values (1); +begin; +select * from foo; + +connection default; +alter table foo add column b int; +alter table foo change b b bigint; +truncate table foo; +rename table foo to bar; +drop table bar; + +connection conn1; +--error ER_NO_SUCH_TABLE +select * From foo; + +connection conn1; +set session transaction isolation level serializable; +create table foo (a int) engine=TokuDB; +insert into foo values (1); +begin; +insert into foo values(2); + +connection default; +--error ER_LOCK_WAIT_TIMEOUT +alter table foo add column b int; +--error ER_LOCK_WAIT_TIMEOUT +alter table foo change a a bigint; +--error ER_LOCK_WAIT_TIMEOUT +truncate table foo; +--error ER_ERROR_ON_RENAME +rename table foo to bar; +--error ER_BAD_TABLE_ERROR +drop table foo; + +connection conn1; +select * From foo; + +connection default; +disconnect conn1; + +drop table foo; \ No newline at end of file