summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2022-02-03 17:01:31 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2022-02-03 17:01:31 +0100
commitf5c5f8e41ecd4d407022d3772ac43075c16824a5 (patch)
tree8a46fbd9dfd51352800ea606ae52a53ceb239501 /sql/sql_base.cc
parent8d742fe4acb91652fcbeb36506d20ead4ff19e83 (diff)
parentcf63eecef44f189ce2d221612dee9dfc1885ba4e (diff)
downloadmariadb-git-f5c5f8e41ecd4d407022d3772ac43075c16824a5.tar.gz
Merge branch '10.5' into 10.6
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 8d213ce103b..18f89eabfe3 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4476,6 +4476,7 @@ restart:
{
enum_sql_command sql_command= thd->lex->sql_command;
bool is_dml_stmt= thd->get_command() != COM_STMT_PREPARE &&
+ !thd->stmt_arena->is_stmt_prepare() &&
(sql_command == SQLCOM_INSERT ||
sql_command == SQLCOM_INSERT_SELECT ||
sql_command == SQLCOM_REPLACE ||
@@ -6425,8 +6426,9 @@ find_field_in_tables(THD *thd, Item_ident *item,
TRUE, &(item->cached_field_index));
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/* Check if there are sufficient access rights to the found field. */
- if (found && check_privileges &&
- check_column_grant_in_table_ref(thd, table_ref, name, length, found))
+ if (found && check_privileges && !is_temporary_table(table_ref) &&
+ check_column_grant_in_table_ref(thd, table_ref, name, length,
+ found))
found= WRONG_GRANT;
#endif
}
@@ -6896,7 +6898,6 @@ set_new_item_local_context(THD *thd, Item_ident *item, TABLE_LIST *table_ref)
if (!(context= new (thd->mem_root) Name_resolution_context))
return TRUE;
context->init();
- context->select_lex= table_ref->select_lex;
context->first_name_resolution_table=
context->last_name_resolution_table= table_ref;
item->context= context;