summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
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.h
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.h')
-rw-r--r--sql/sql_lex.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 4fcd090e1f5..3b47b1d25c9 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -730,7 +730,7 @@ public:
/*
Point to the LEX in which it was created, used in view subquery detection.
- TODO: make also st_select_lex::parent_stmt_lex (see THD::stmt_lex)
+ TODO: make also st_select_lex::parent_stmt_lex (see LEX::stmt_lex)
and use st_select_lex::parent_lex & st_select_lex::parent_stmt_lex
instead of global (from THD) references where it is possible.
*/
@@ -2435,6 +2435,21 @@ struct LEX: public Query_tables_list
// type information
char *length,*dec;
CHARSET_INFO *charset;
+ /*
+ LEX which represents current statement (conventional, SP or PS)
+
+ For example during view parsing THD::lex will point to the views LEX and
+ lex::stmt_lex will point to LEX of the statement where the view will be
+ included
+
+ Currently it is used to have always correct select numbering inside
+ statement (LEX::current_select_number) without storing and restoring a
+ global counter which was THD::select_number.
+
+ TODO: make some unified statement representation (now SP has different)
+ to store such data like LEX::current_select_number.
+ */
+ LEX *stmt_lex;
LEX_STRING name;
char *help_arg;