mariadb/storage/tokudb/mysql-test/tokudb_bugs/t/leak172.test
2014-03-18 09:02:57 +01:00

152 lines
3.9 KiB
Text

# test case simplified from RQG run that forces a lock not granted error on an update with a
# concurrent load into the same table.
source include/have_tokudb.inc;
source include/have_debug.inc;
set default_storage_engine=tokudb;
disable_warnings;
drop table if exists t1,t2;
enable_warnings;
let $MYSQLD_DATADIR=`select @@datadir`;
copy_file $MTR_SUITE_DIR/std_data/leak172_t1.data $MYSQLD_DATADIR/test/leak172_t1.data;
copy_file $MTR_SUITE_DIR/std_data/leak172_t2.data $MYSQLD_DATADIR/test/leak172_t2.data;
CREATE TABLE `t1` (
`c4` int(11) DEFAULT NULL,
`c5` int(11) DEFAULT NULL,
`c26` text,
`c18` blob,
`c29` text NOT NULL,
`c3` int(10) unsigned DEFAULT NULL,
`c25` text,
`c17` varchar(240) NOT NULL,
`c11` int(10) unsigned NOT NULL,
`c0` int(11) DEFAULT NULL,
`c22` blob NOT NULL,
`c13` varchar(240),
`c19` blob,
`c20` blob,
`c23` blob NOT NULL,
`c27` text,
`c28` text NOT NULL,
`c2` int(10) unsigned DEFAULT NULL,
`c12` varchar(240) DEFAULT NULL,
`c34` date NOT NULL,
`c30` date DEFAULT NULL,
`c31` date DEFAULT NULL,
`c24` date NOT NULL DEFAULT '0000-00-00',
`c33` date DEFAULT NULL,
`c21` blob,
`c1` int(11),
`c15` varchar(240) DEFAULT NULL,
`c16` varchar(240) NOT NULL,
`c9` int(11) NOT NULL,
`c32` date DEFAULT NULL,
`c7` int(10) unsigned DEFAULT NULL,
`c8` int(11) NOT NULL,
`c14` varchar(240) DEFAULT NULL,
`c35` date NOT NULL,
`pk` int(11) NOT NULL AUTO_INCREMENT,
`c10` int(10) unsigned NOT NULL,
`c6` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `c5` (`c5`),
KEY `c29` (`c29`(255)),
KEY `c3` (`c3`),
KEY `c25` (`c25`(255)),
KEY `c17` (`c17`),
KEY `c11` (`c11`),
KEY `c13` (`c13`),
KEY `c19` (`c19`(255)),
KEY `c23` (`c23`(255)),
KEY `c27` (`c27`(255)),
KEY `c31` (`c31`),
KEY `c33` (`c33`),
KEY `c21` (`c21`(255)),
KEY `c1` (`c1`),
KEY `c15` (`c15`),
KEY `c9` (`c9`),
KEY `c7` (`c7`),
KEY `c35` (`c35`)
);
CREATE TABLE `t2` (
`c12` varchar(240) DEFAULT NULL,
`c15` varchar(240) DEFAULT NULL,
`c19` blob,
`c14` varchar(240) DEFAULT NULL,
`c6` int(10) unsigned DEFAULT NULL,
`c11` int(10) unsigned NOT NULL,
`c30` date DEFAULT NULL,
`c29` text NOT NULL,
`c20` blob,
`c18` blob,
`c23` blob NOT NULL,
`c16` varchar(240) NOT NULL,
`c10` int(10) unsigned NOT NULL,
`c25` text,
`c21` blob,
`c7` int(10) unsigned DEFAULT NULL,
`c9` int(11) NOT NULL,
`c5` int(11) DEFAULT NULL,
`c35` date NOT NULL,
`c24` text,
`c17` varchar(240) NOT NULL,
`c28` text NOT NULL,
`c33` date DEFAULT NULL,
`c26` text,
`c0` int(11) DEFAULT NULL,
`c13` varchar(240) DEFAULT NULL,
`c3` int(10) unsigned DEFAULT NULL,
`c1` int(11) DEFAULT NULL,
`pk` int(11) NOT NULL AUTO_INCREMENT,
`c34` date NOT NULL,
`c2` int(10) unsigned DEFAULT NULL,
`c4` int(11) DEFAULT NULL,
`c32` date,
`c27` text,
`c8` int(11) NOT NULL,
`c31` date DEFAULT NULL,
`c22` blob NOT NULL,
PRIMARY KEY (`pk`),
KEY `c15` (`c15`),
KEY `c19` (`c19`(255)),
KEY `c11` (`c11`),
KEY `c29` (`c29`(255)),
KEY `c23` (`c23`(255)),
KEY `c25` (`c25`(255)),
KEY `c21` (`c21`(255)),
KEY `c7` (`c7`),
KEY `c9` (`c9`),
KEY `c5` (`c5`),
KEY `c35` (`c35`),
KEY `c17` (`c17`),
KEY `c33` (`c33`),
KEY `c13` (`c13`),
KEY `c3` (`c3`),
KEY `c1` (`c1`),
KEY `c27` (`c27`(255)),
KEY `c31` (`c31`)
);
LOAD DATA INFILE 'leak172_t1.data' INTO TABLE `t1` fields terminated by ',';
connect(conn1,localhost,root,,);
set session debug_dbug="+d,tokudb_end_bulk_insert_sleep";
send LOAD DATA INFILE 'leak172_t2.data' INTO TABLE `t2` fields terminated by ',';
connection default;
let $wait_condition= select count(*)=1 from information_schema.processlist where info like 'LOAD DATA INFILE%' and state like 'DBUG sleep';
source include/wait_condition.inc;
--error 1205
UPDATE t1, t2 SET t1.`c5` = 4 WHERE t1.`c6` <= 'o';
connection conn1;
reap;
connection default;
disconnect conn1;
drop table t1,t2;