summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-03-05 17:43:30 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2018-03-12 17:37:23 +0100
commit5511e8ed5941e3b5a7687f87a1fb4fa75815ee7b (patch)
tree5ee9390b847c6c3debe398f4e789b576f39ca909 /sql/sql_lex.h
parent3a93ec53c1efdb511721fdb9e3bef9c3cf3bf675 (diff)
downloadmariadb-git-5511e8ed5941e3b5a7687f87a1fb4fa75815ee7b.tar.gz
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.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 88462477de9..6d281930d1f 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -2902,21 +2902,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();