summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-02-27 15:53:25 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2019-02-28 18:14:53 +0100
commitcb11b3fbe9d4dde776cb8f2c0d6f83a569655efc (patch)
treec2786c9e12fe67065c887e1a9a027cfaf154fb51 /sql/sql_lex.cc
parent0ad598a00b17008b0c0702db40948b14d7eee0d5 (diff)
downloadmariadb-git-cb11b3fbe9d4dde776cb8f2c0d6f83a569655efc.tar.gz
MDEV-17055: Server crashes in find_order_in_list upon 2nd (3rd) execution of SP with UPDATE
1. Always drop merged_for_insert flag on cleanup (there could be errors which prevent TABLE to be assigned) 2. Make more precise cleanup of select parts which was touched
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 3c0d3049ae4..7d694f90aa2 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1904,7 +1904,7 @@ void st_select_lex::init_query()
n_child_sum_items= 0;
subquery_in_having= explicit_limit= 0;
is_item_list_lookup= 0;
- first_execution= 1;
+ changed_elements= 0;
first_natural_join_processing= 1;
first_cond_optimization= 1;
parsing_place= NO_MATTER;
@@ -3367,9 +3367,10 @@ void st_select_lex::fix_prepare_information(THD *thd, Item **conds,
Item **having_conds)
{
DBUG_ENTER("st_select_lex::fix_prepare_information");
- if (!thd->stmt_arena->is_conventional() && first_execution)
+ if (!thd->stmt_arena->is_conventional() &&
+ !(changed_elements & TOUCHED_SEL_COND))
{
- first_execution= 0;
+ changed_elements|= TOUCHED_SEL_COND;
if (group_list.first)
{
if (!group_list_ptrs)