diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2018-03-15 01:32:09 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2018-03-15 01:32:09 +0300 |
commit | 9fed7d43a58e2e2279afb8ac0a321f9db090420a (patch) | |
tree | dfa2a094f40f911d302e08e72467e2f0ff12fcc8 /sql/sql_lex.h | |
parent | 2b7e3ffd31672c908fe8f612f9b261f80235328b (diff) | |
download | mariadb-git-bb-10.2-compatibility-mdev15509-debug.tar.gz |
Apply this commit to bb-10.2-compatibility-mdev15509-debug:bb-10.2-compatibility-mdev15509-debug
commit 5511e8ed5941e3b5a7687f87a1fb4fa75815ee7b
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date: Mon Mar 5 17:43:30 2018 +0100
MDEV-15328: MariaDB 10.2.13 Crashes upon CALL PROCEDURE PARAM LAST_INSERT_ID ()
There is not current SELECT during assigning SP parameters, do not use it if current_select is empty.
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r-- | sql/sql_lex.h | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 373c7843648..1bf39798841 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -3033,21 +3033,24 @@ public: { safe_to_cache_query= 0; - /* - There are no sense to mark select_lex and union fields of LEX, - but we should merk all subselects as uncacheable from current till - most upper - */ - SELECT_LEX *sl; - SELECT_LEX_UNIT *un; - for (sl= current_select, un= sl->master_unit(); - un != &unit; - sl= sl->outer_select(), un= sl->master_unit()) + if (current_select) // initialisation SP variables has no SELECT { - sl->uncacheable|= cause; - un->uncacheable|= cause; + /* + There are no sense to mark select_lex and union fields of LEX, + but we should merk all subselects as uncacheable from current till + most upper + */ + SELECT_LEX *sl; + SELECT_LEX_UNIT *un; + for (sl= current_select, un= sl->master_unit(); + un != &unit; + sl= sl->outer_select(), un= sl->master_unit()) + { + sl->uncacheable|= cause; + un->uncacheable|= cause; + } + select_lex.uncacheable|= cause; } - select_lex.uncacheable|= cause; } void set_trg_event_type_for_tables(); |