summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-05-07 17:42:55 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2018-05-15 10:21:50 +0200
commit0bd2b802546c09361fe7823624e09bde16c976ac (patch)
tree10fe4b8b5e528a19b02b2251a5eecb7bf5067464 /sql/sql_lex.cc
parent3b99a274a845edddeb2234108d0978d57f447c3d (diff)
downloadmariadb-git-0bd2b802546c09361fe7823624e09bde16c976ac.tar.gz
MDEV-15347: Valgrind or ASAN errors in mysql_make_view on query from information_schema
Make each lex pointing to statement lex instead of global pointer in THD (no need store and restore the global pointer and put it on SP stack).
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 3fa5ec71aeb..085ad1a4b3b 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -657,10 +657,11 @@ void lex_start(THD *thd)
{
LEX *lex= thd->lex;
DBUG_ENTER("lex_start");
- DBUG_PRINT("info", ("Lex %p stmt_lex: %p", thd->lex, thd->stmt_lex));
+ DBUG_PRINT("info", ("Lex %p", thd->lex));
lex->thd= lex->unit.thd= thd;
-
+
+ lex->stmt_lex= lex; // default, should be rewritten for VIEWs And CTEs
DBUG_ASSERT(!lex->explain);
lex->context_stack.empty();