Commit 6526694d authored by Zardosht Kasheff's avatar Zardosht Kasheff

[t:4472], add test

git-svn-id: file:///svn/mysql/tests/mysql-test@39741 c7de825b-a66e-492c-adef-691d508d4ae1
parent d7855969
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;
# 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
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