diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2018-05-07 17:42:55 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2018-05-15 10:21:50 +0200 |
commit | 0bd2b802546c09361fe7823624e09bde16c976ac (patch) | |
tree | 10fe4b8b5e528a19b02b2251a5eecb7bf5067464 /sql/sql_trigger.cc | |
parent | 3b99a274a845edddeb2234108d0978d57f447c3d (diff) | |
download | mariadb-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_trigger.cc')
-rw-r--r-- | sql/sql_trigger.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index e14d19c7369..293a4c17156 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -1374,13 +1374,13 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, List_iterator_fast<LEX_STRING> it_client_cs_name(triggers->client_cs_names); List_iterator_fast<LEX_STRING> it_connection_cl_name(triggers->connection_cl_names); List_iterator_fast<LEX_STRING> it_db_cl_name(triggers->db_cl_names); - LEX *old_lex= thd->lex, *old_stmt_lex= thd->stmt_lex; + LEX *old_lex= thd->lex; LEX lex; sp_rcontext *save_spcont= thd->spcont; ulonglong save_sql_mode= thd->variables.sql_mode; LEX_STRING *on_table_name; - thd->lex= thd->stmt_lex= &lex; + thd->lex= &lex; save_db.str= thd->db; save_db.length= thd->db_length; @@ -1579,7 +1579,6 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, } thd->reset_db(save_db.str, save_db.length); thd->lex= old_lex; - thd->stmt_lex= old_stmt_lex; thd->spcont= save_spcont; thd->variables.sql_mode= save_sql_mode; @@ -1592,7 +1591,6 @@ err_with_lex_cleanup: // QQ: anything else ? lex_end(&lex); thd->lex= old_lex; - thd->stmt_lex= old_stmt_lex; thd->spcont= save_spcont; thd->variables.sql_mode= save_sql_mode; thd->reset_db(save_db.str, save_db.length); |