Commit 642a4fb6 authored by Rich Prohaska's avatar Rich Prohaska

#4621 move tokudb.truncate mysql tests to common mysql test dir refs[t:4621]

git-svn-id: file:///svn/mysql/tests/mysql-test@40915 c7de825b-a66e-492c-adef-691d508d4ae1
parent a176ec2f
drop table if exists t;
create table t (a int, b int, primary key (a)) engine=tokudb;
insert into t values (1,2),(2,4),(3,8);
select * from t;
a b
1 2
2 4
3 8
delete from t;
select * from t;
a b
drop table t;
drop table if exists t;
create table t (a int, b int, primary key (a)) engine=tokudb;
insert into t values (1,2),(2,4),(3,8);
select * from t;
a b
1 2
2 4
3 8
truncate table t;
select * from t;
a b
drop table t;
drop table if exists t;
create table t (a int, b int, primary key (a)) engine=tokudb;
insert into t values (1,2),(2,4),(3,8);
select * from t;
a b
1 2
2 4
3 8
select TABLE_ROWS from information_schema.tables where table_schema='test' and table_name='t';
TABLE_ROWS
3
truncate table t;
select * from t;
a b
select TABLE_ROWS from information_schema.tables where table_schema='test' and table_name='t';
TABLE_ROWS
1
drop table t;
set autocommit=off;
drop table if exists t;
create table t (a int, b int, primary key (a)) engine=tokudb;
start transaction;
insert into t values (1,2),(2,4),(3,8);
commit;
start transaction;
select * from t;
a b
1 2
2 4
3 8
commit;
start transaction;
truncate table t;
commit;
start transaction;
select * from t;
a b
commit;
drop table t;
set autocommit=off;
drop table if exists t;
create table t (a int, b int, primary key (a)) engine=tokudb;
start transaction;
insert into t values (1,2),(2,4),(3,8);
commit;
start transaction;
select * from t;
a b
1 2
2 4
3 8
commit;
start transaction;
truncate table t;
rollback;
start transaction;
select * from t;
a b
commit;
drop table t;
set autocommit=off;
drop table if exists t;
create table t (a int, b int, primary key (a)) engine=innodb;
start transaction;
insert into t values (1,2),(2,4),(3,8);
commit;
start transaction;
select * from t;
a b
1 2
2 4
3 8
commit;
start transaction;
truncate table t;
rollback;
start transaction;
select * from t;
a b
commit;
drop table t;
# verify that delete from table leaves the table empty
--disable_warnings
drop table if exists t;
--enable_warnings
create table t (a int, b int, primary key (a)) engine=tokudb;
insert into t values (1,2),(2,4),(3,8);
select * from t;
delete from t;
select * from t;
drop table t;
\ No newline at end of file
# verify that truncate table leaves the table empty
--disable_warnings
drop table if exists t;
--enable_warnings
create table t (a int, b int, primary key (a)) engine=tokudb;
insert into t values (1,2),(2,4),(3,8);
select * from t;
truncate table t;
select * from t;
drop table t;
# verify that truncate table leaves the table empty and sets the row count
# to zero.
--disable_warnings
drop table if exists t;
--enable_warnings
create table t (a int, b int, primary key (a)) engine=tokudb;
insert into t values (1,2),(2,4),(3,8);
select * from t;
select TABLE_ROWS from information_schema.tables where table_schema='test' and table_name='t';
truncate table t;
select * from t;
select TABLE_ROWS from information_schema.tables where table_schema='test' and table_name='t';
drop table t;
# test truncate commit
set autocommit=off;
--disable_warnings
drop table if exists t;
--enable_warnings
create table t (a int, b int, primary key (a)) engine=tokudb;
start transaction;
insert into t values (1,2),(2,4),(3,8);
commit;
start transaction;
select * from t;
commit;
start transaction;
truncate table t;
commit;
start transaction;
select * from t;
commit;
drop table t;
\ No newline at end of file
# test truncate commit
set autocommit=off;
--disable_warnings
drop table if exists t;
--enable_warnings
create table t (a int, b int, primary key (a)) engine=tokudb;
start transaction;
insert into t values (1,2),(2,4),(3,8);
commit;
start transaction;
select * from t;
commit;
start transaction;
truncate table t;
rollback;
start transaction;
select * from t;
commit;
drop table t;
# test truncate commit
--source include/have_innodb.inc
--source include/have_tokudb.inc
set autocommit=off;
--disable_warnings
drop table if exists t;
--enable_warnings
create table t (a int, b int, primary key (a)) engine=innodb;
start transaction;
insert into t values (1,2),(2,4),(3,8);
commit;
start transaction;
select * from t;
commit;
start transaction;
truncate table t;
rollback;
start transaction;
select * from t;
commit;
drop table t;
\ 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