diff options
author | unknown <sergefp@mysql.com> | 2006-08-15 20:33:14 +0400 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2006-08-15 20:33:14 +0400 |
commit | 9907e970aea28ce186e110084c3a4f2d6ac0c602 (patch) | |
tree | fc2e555039f9cfa7f5c80b261a3d4f08bacd093f /sql | |
parent | 84ece59cefafc7a223c65aa7c763f5e72afaa1fc (diff) | |
download | mariadb-git-9907e970aea28ce186e110084c3a4f2d6ac0c602.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 'sql')
-rw-r--r-- | sql/opt_range.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h index 15f0bf02b34..d2f4452a762 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -86,7 +86,7 @@ public: QUICK_SELECT(THD *thd, TABLE *table,uint index_arg,bool no_alloc=0); virtual ~QUICK_SELECT(); - void reset(void) { next=0; it.rewind(); } + void reset(void) { next=0; it.rewind(); range= NULL;} int init() { key_part_info= head->key_info[index].key_part; |