diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-02-27 15:53:25 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-02-28 18:14:53 +0100 |
commit | cb11b3fbe9d4dde776cb8f2c0d6f83a569655efc (patch) | |
tree | c2786c9e12fe67065c887e1a9a027cfaf154fb51 /sql/sql_union.cc | |
parent | 0ad598a00b17008b0c0702db40948b14d7eee0d5 (diff) | |
download | mariadb-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_union.cc')
-rw-r--r-- | sql/sql_union.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc index bbb4133417e..e855b64e600 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -215,8 +215,9 @@ st_select_lex_unit::init_prepare_fake_select_lex(THD *thd_arg, called at the first execution of the statement, while first_execution shows whether this is called at the first execution of the union that may form just a subselect. - */ - if (!fake_select_lex->first_execution && first_execution) + */ + if ((fake_select_lex->changed_elements & TOUCHED_SEL_COND) && + first_execution) { for (ORDER *order= global_parameters->order_list.first; order; |