mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
[t:3518], add tests
git-svn-id: file:///svn/mysql/tests/mysql-test@34461 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
baed785c6a
commit
6a1c857b6a
2 changed files with 176 additions and 0 deletions
108
mysql-test/suite/tokudb.bugs/r/dict_leak_3518.result
Normal file
108
mysql-test/suite/tokudb.bugs/r/dict_leak_3518.result
Normal file
|
@ -0,0 +1,108 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
DROP TABLE IF EXISTS fooff, foo, bar;
|
||||
create table bar (a int);
|
||||
insert into bar values(1),(2),(3);
|
||||
create table foo (a int, primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
Table Create Table
|
||||
foo CREATE TABLE `foo` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
insert into foo values(1);
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
drop table foo;
|
||||
create table foo (a int, primary key (a)) engine=TokuDB select * from bar;
|
||||
show create table foo;
|
||||
Table Create Table
|
||||
foo CREATE TABLE `foo` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
flush tables;
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
drop table foo;
|
||||
begin;
|
||||
select * from bar;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
create table foo (a int, primary key (a)) engine=TokuDB select * from bar;
|
||||
show create table foo;
|
||||
Table Create Table
|
||||
foo CREATE TABLE `foo` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
insert into foo values(1010101);
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
1010101
|
||||
drop table foo;
|
||||
commit;
|
||||
insert into bar values (2);
|
||||
create table foo (a int, primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
Table Create Table
|
||||
foo CREATE TABLE `foo` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
insert into foo values(1);
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
flush tables;
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
drop table foo;
|
||||
create table fooff (a int, primary key (a)) engine=TokuDB select * from bar;
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
create table fooff (a int)engine=TokuDB;
|
||||
show create table fooff;
|
||||
Table Create Table
|
||||
fooff CREATE TABLE `fooff` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
drop table fooff;
|
||||
begin;
|
||||
select * from bar;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
2
|
||||
create table foo (a int, primary key (a)) engine=TokuDB select * from bar;
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
create table foo (abra int)engine=TokuDB;
|
||||
show create table foo;
|
||||
Table Create Table
|
||||
foo CREATE TABLE `foo` (
|
||||
`abra` int(11) DEFAULT NULL
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
select * from foo;
|
||||
abra
|
||||
drop table foo;
|
||||
commit;
|
||||
DROP TABLE bar;
|
68
mysql-test/suite/tokudb.bugs/t/dict_leak_3518.test
Normal file
68
mysql-test/suite/tokudb.bugs/t/dict_leak_3518.test
Normal file
|
@ -0,0 +1,68 @@
|
|||
--source include/have_tokudb.inc
|
||||
#
|
||||
# Record inconsistency.
|
||||
#
|
||||
#
|
||||
SET STORAGE_ENGINE = 'tokudb';
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS fooff, foo, bar;
|
||||
--enable_warnings
|
||||
|
||||
create table bar (a int);
|
||||
insert into bar values(1),(2),(3);
|
||||
|
||||
create table foo (a int, primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
insert into foo values(1);
|
||||
select * from foo;
|
||||
drop table foo;
|
||||
|
||||
create table foo (a int, primary key (a)) engine=TokuDB select * from bar;
|
||||
show create table foo;
|
||||
select * from foo;
|
||||
flush tables;
|
||||
select * from foo;
|
||||
drop table foo;
|
||||
|
||||
begin;
|
||||
select * from bar;
|
||||
create table foo (a int, primary key (a)) engine=TokuDB select * from bar;
|
||||
show create table foo;
|
||||
select * from foo;
|
||||
insert into foo values(1010101);
|
||||
select * from foo;
|
||||
drop table foo;
|
||||
commit;
|
||||
|
||||
insert into bar values (2);
|
||||
create table foo (a int, primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
insert into foo values(1);
|
||||
select * from foo;
|
||||
flush tables;
|
||||
select * from foo;
|
||||
drop table foo;
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
create table fooff (a int, primary key (a)) engine=TokuDB select * from bar;
|
||||
create table fooff (a int)engine=TokuDB;
|
||||
show create table fooff;
|
||||
drop table fooff;
|
||||
|
||||
|
||||
begin;
|
||||
select * from bar;
|
||||
--error ER_DUP_ENTRY
|
||||
create table foo (a int, primary key (a)) engine=TokuDB select * from bar;
|
||||
create table foo (abra int)engine=TokuDB;
|
||||
show create table foo;
|
||||
select * from foo;
|
||||
drop table foo;
|
||||
commit;
|
||||
|
||||
|
||||
|
||||
# Final cleanup.
|
||||
DROP TABLE bar;
|
||||
|
Loading…
Reference in a new issue