summaryrefslogtreecommitdiff
path: root/mysql-test/r/innodb_mysql.result
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2006-08-15 20:33:14 +0400
committerunknown <sergefp@mysql.com>2006-08-15 20:33:14 +0400
commitfa3f0bc1b19aac867f7f2de7dbd6b5b85c4a8e59 (patch)
treefc2e555039f9cfa7f5c80b261a3d4f08bacd093f /mysql-test/r/innodb_mysql.result
parent02c4142fc5428abf52e925b9b5f7926fe264e2fb (diff)
downloadmariadb-git-fa3f0bc1b19aac867f7f2de7dbd6b5b85c4a8e59.tar.gz
BUG#21077: Possible crash caused by invalid sequence of handler::* calls:
The crash was caused by invalid sequence of handler::** calls: ha_smth->index_init(); ha_smth->index_next_same(); (2) (2) is an invalid call as it was not preceeded by any 'scan setup' call like index_first() or index_read(). The cause was that QUICK_SELECT::reset() didn't "fully reset" the quick select- current QUICK_RANGE wasn't forgotten, and quick select might attempt to continue reading the range, which would result in the above mentioned invalid sequence of handler calls. 5.x versions are not affected by the bug - they already have the missing "range=NULL" clause. mysql-test/r/innodb_mysql.result: Testcase for BUG#21077 mysql-test/t/innodb_mysql.test: Testcase for BUG#21077 sql/opt_range.h: BUG#21077: Possible crash caused by invalid sequence of handler::* calls: - Make QUICK_SELECT::reset() really reset the quick select
Diffstat (limited to 'mysql-test/r/innodb_mysql.result')
-rw-r--r--mysql-test/r/innodb_mysql.result21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 920d7aa42ce..ee4c114087d 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -83,3 +83,24 @@ b a
3 3
3 3
DROP TABLE t1, t2, t3;
+CREATE TABLE `t1` (`id1` INT) ;
+INSERT INTO `t1` (`id1`) VALUES (1),(5),(2);
+CREATE TABLE `t2` (
+`id1` INT,
+`id2` INT NOT NULL,
+`id3` INT,
+`id4` INT NOT NULL,
+UNIQUE (`id2`,`id4`),
+KEY (`id1`)
+) ENGINE=InnoDB;
+INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES
+(1,1,1,0),
+(1,1,2,1),
+(5,1,2,2),
+(6,1,2,3),
+(1,2,2,2),
+(1,2,1,1);
+SELECT `id1` FROM `t1` WHERE `id1` NOT IN (SELECT `id1` FROM `t2` WHERE `id2` = 1 AND `id3` = 2);
+id1
+2
+DROP TABLE t1, t2;