1 # Test for bug #12400341: INNODB CAN LEAVE ORPHAN IBD FILES AROUND
3 -- source include/have_innodb_plugin.inc
5 if (`select count(*)=0 from information_schema.global_variables where variable_name = 'INNODB_TRX_RSEG_N_SLOTS_DEBUG'`)
7 --skip Test requires InnoDB built with UNIV_DEBUG definition.
10 # Don't test under valgrind, undo slots of the previous test might exist still
11 # and cause unstable result.
12 --source include/not_valgrind.inc
14 call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too");
17 set @old_innodb_trx_rseg_n_slots_debug = @@innodb_trx_rseg_n_slots_debug;
18 set global innodb_trx_rseg_n_slots_debug = 32;
21 show variables like "max_connections";
22 show variables like "innodb_thread_concurrency";
23 show variables like "innodb_file_per_table";
26 drop database if exists mysqltest;
29 create database mysqltest;
30 CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB;
34 # Insert in 1 transaction which needs over 1 page undo record to avoid the insert_undo cached,
35 # because the cached insert_undo can be reused at "CREATE TABLE" statement later.
41 eval INSERT INTO mysqltest.transtable (id) VALUES ($c);
49 # if failed at here, it might be shortage of file descriptors limit.
50 connect (con$c,localhost,root,,);
55 select count(*) from information_schema.processlist;
58 # fill the all undo slots
66 eval UPDATE mysqltest.transtable SET val = 1 WHERE id = 33 - $c;
73 --error ER_CANT_CREATE_TABLE
74 CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB;
76 select count(*) from information_schema.processlist;
89 select count(*) from information_schema.processlist;
101 # If the isolated .ibd file remained, the drop database should fail.
103 drop database mysqltest;
106 set global innodb_trx_rseg_n_slots_debug = @old_innodb_trx_rseg_n_slots_debug;