diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-05-24 09:38:49 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-05-24 09:38:49 +0300 |
commit | 1864a8ea93aa1d1a540c83526a25df2ad0330763 (patch) | |
tree | f6d1ae8e9e696ea8537a395d061f697e5bccd4aa /sql/sql_parse.cc | |
parent | b01a9fd817d9d8e5941008d6981338eaa7369c83 (diff) | |
parent | 5c75ba9cadc7877e91d6b712f157ff5623c09c60 (diff) | |
download | mariadb-git-1864a8ea93aa1d1a540c83526a25df2ad0330763.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b16091dbab4..95c04321b4d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3506,9 +3506,6 @@ mysql_execute_command(THD *thd) thd->get_stmt_da()->opt_clear_warning_info(thd->query_id); } - if (check_dependencies_in_with_clauses(thd->lex->with_clauses_list)) - DBUG_RETURN(1); - #ifdef HAVE_REPLICATION if (unlikely(thd->slave_thread)) { @@ -8060,7 +8057,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, ptr->is_fqtn= TRUE; ptr->db= table->db; } - else if (lex->copy_db_to(&ptr->db)) + else if (!lex->with_cte_resolution && lex->copy_db_to(&ptr->db)) DBUG_RETURN(0); else ptr->is_fqtn= FALSE; @@ -8075,9 +8072,11 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, if (ptr->db.length && ptr->db.str != any_db) ptr->db.length= my_casedn_str(files_charset_info, (char*) ptr->db.str); } - + ptr->table_name= table->table; ptr->lock_type= lock_type; + ptr->mdl_type= mdl_type; + ptr->table_options= table_options; ptr->updating= MY_TEST(table_options & TL_OPTION_UPDATING); /* TODO: remove TL_OPTION_FORCE_INDEX as it looks like it's not used */ ptr->force_index= MY_TEST(table_options & TL_OPTION_FORCE_INDEX); @@ -8765,8 +8764,10 @@ void st_select_lex::set_lock_for_tables(thr_lock_type lock_type, bool for_update { tables->lock_type= lock_type; tables->updating= for_update; - tables->mdl_request.set_type((lock_type >= TL_WRITE_ALLOW_WRITE) ? - MDL_SHARED_WRITE : MDL_SHARED_READ); + + if (tables->db.length) + tables->mdl_request.set_type((lock_type >= TL_WRITE_ALLOW_WRITE) ? + MDL_SHARED_WRITE : MDL_SHARED_READ); } DBUG_VOID_RETURN; } |