mariadb/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test
Sergey Petrunya 96e092dc73 Backport into MariaDB-5.2 the following:
WL#2474 "Multi Range Read: Change the default MRR implementation to implement new MRR interface"
WL#2475 "Batched range read functions for MyISAM/InnoDb"
        "Index condition pushdown for MyISAM/InnoDB"
Igor's fix from sp1r-igor@olga.mysql.com-20080330055902-07614:
  There could be observed the following problems:
  1. EXPLAIN did not mention pushdown conditions from on expressions in the 
  'extra' column.  As a result if a query had no where conditions pushed 
  down to a table, but had on conditions pushed to this table the 'extra' 
  column in the EXPLAIN for the table missed 'using where'.
  2. Conditions for ref access were not eliminated from on expressions 
  though such conditions were eliminated from the where condition.
2009-12-15 10:16:46 +03:00

58 lines
1 KiB
Text

--echo #
--echo # Bug#43448 - Server crashes on multi table delete with Innodb
--echo #
--source include/have_debug.inc
--source include/have_innodb.inc
# crash requires ICP support in InnoDB
set session debug="+d,optimizer_innodb_icp";
CREATE TABLE t1 (
id1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
t CHAR(12)
) ENGINE=InnoDB;
CREATE TABLE t2 (
id2 INT NOT NULL,
t CHAR(12)
) ENGINE=InnoDB;
CREATE TABLE t3(
id3 INT NOT NULL,
t CHAR(12),
INDEX(id3)
) ENGINE=InnoDB;
disable_query_log;
let $1 = 100;
while ($1)
{
let $2 = 5;
eval INSERT INTO t1(t) VALUES ('$1');
while ($2)
{
eval INSERT INTO t2(id2,t) VALUES ($1,'$2');
let $3 = 10;
while ($3)
{
eval INSERT INTO t3(id3,t) VALUES ($1,'$2');
dec $3;
}
dec $2;
}
dec $1;
}
enable_query_log;
SELECT COUNT(*) FROM t1 WHERE id1 > 90;
SELECT COUNT(*) FROM t2 WHERE id2 > 90;
SELECT COUNT(*) FROM t3 WHERE id3 > 90;
DELETE t1, t2, t3
FROM t1, t2, t3
WHERE t1.id1 = t2.id2 AND t2.id2 = t3.id3 AND t1.id1 > 5;
DROP TABLE t1, t2, t3;