summaryrefslogtreecommitdiff
path: root/sql/item_subselect.h
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2019-04-19 16:17:51 -0700
committerIgor Babaev <igor@askmonty.org>2019-04-19 16:18:48 -0700
commita65d3b2c1633cbb21a9ab4b61d1bcd865e3c3219 (patch)
treed93fa4c238d87ca88949b6f7c690a82d8b0afa8f /sql/item_subselect.h
parent38f390f54970042b3fcad61b2aba25e274667176 (diff)
downloadmariadb-git-a65d3b2c1633cbb21a9ab4b61d1bcd865e3c3219.tar.gz
MDEV-19255 Server crash in st_join_table::save_explain_data or assertion
`sel->quick' failure in JOIN::make_range_rowid_filters upon query with rowid_filter=ON Index ranges can be defined using conditions with inexpensive subqueries. Such a subquery is evaluated when some representation of a possible range sequence is built. After the evaluation the JOIN structure of the subsquery is distroyed. Any attempt to build the above representation may fail because the function that checks whether a subquery is inexpensive in some cases uses the join structure of the subquery. When a range rowid filter is built by a range sequence constructed out of a range condition that uses an inexpensive subquery the representation of the the sequence is built twice. Building the second representation fails due to the described problem with the execution of Item_subselect::is_expensive(). The function was corrected to return the result of the last its invocation if the Item_subselect object has been already evaluated.
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r--sql/item_subselect.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 0e771bae42e..bbc24d336f0 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -73,6 +73,8 @@ protected:
to substitute 'this' with a constant item.
*/
bool forced_const;
+ /* Set to the result of the last call of is_expensive() */
+ bool expensive_fl;
#ifndef DBUG_OFF
/* Count the number of times this subquery predicate has been executed. */
uint exec_counter;