summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
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 87d7f65fed5..0509b200842 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4437,6 +4437,7 @@ restart:
wsrep_thd_is_local(thd) &&
!is_stat_table(&(*start)->db, &(*start)->alias) &&
thd->get_command() != COM_STMT_PREPARE &&
+ !thd->stmt_arena->is_stmt_prepare() &&
((thd->lex->sql_command == SQLCOM_INSERT ||
thd->lex->sql_command == SQLCOM_INSERT_SELECT ||
thd->lex->sql_command == SQLCOM_REPLACE ||
@@ -6365,8 +6366,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
}
@@ -6830,7 +6832,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;