summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2008-10-10 15:27:58 +0500
committerGleb Shchepa <gshchepa@mysql.com>2008-10-10 15:27:58 +0500
commit097b60bd06e8c9dd741df30389849a17971d5052 (patch)
tree7307f89414a3d9aeee951ad16f92aff11dd9a890 /sql/opt_range.cc
parent8bfbcbd98172ac936ff13ef97f2662cd6bc9a2c7 (diff)
downloadmariadb-git-097b60bd06e8c9dd741df30389849a17971d5052.tar.gz
Bug #37894: Assertion in init_read_record_seq in handler.h line 1444
Select with a "NULL NOT IN" condition containing complex subselect from the same table as in the outer select failed with an assertion. The failure was caused by a concatenation of circumstances: 1) an inner select was optimized by make_join_statistics to use the QUICK_RANGE_SELECT access method (that implies an index scan of the table); 2) a subselect was independent (constant) from the outer select; 3) a condition was pushed down into inner select. During the evaluation of a constant IN expression an optimizer temporary changed the access method from index scan to table scan, but an engine handler was already initialized for index access by make_join_statistics. That caused an assertion. Unnecessary index initialization has been removed from the QUICK_RANGE_SELECT::init method (QUICK_RANGE_SELECT::reset reinvokes this initialization). mysql-test/r/subselect3.result: Added test case for bug #37894. mysql-test/t/subselect3.test: Added test case for bug #37894. sql/opt_range.cc: Bug #37894: Assertion in init_read_record_seq in handler.h line 1444 Unnecessary index initialization has been removed from the QUICK_RANGE_SELECT::init method (QUICK_RANGE_SELECT::reset reinvokes this initialization).
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 2ae86b876d2..204ebdb6f33 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1015,7 +1015,7 @@ int QUICK_RANGE_SELECT::init()
if (file->inited != handler::NONE)
file->ha_index_or_rnd_end();
- DBUG_RETURN(error= file->ha_index_init(index));
+ DBUG_RETURN(FALSE);
}