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.cc18
1 files changed, 3 insertions, 15 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index ad9cd5985d1..630d135be48 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2975,6 +2975,7 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name,
if (nj_col->view_field)
{
Item *item;
+ LINT_INIT(arena);
if (register_tree_change)
arena= thd->activate_stmt_arena_if_needed(&backup);
/*
@@ -4527,21 +4528,8 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
uint tablenr= 0;
DBUG_ENTER("setup_tables");
- /*
- Due to the various call paths that lead to setup_tables() it may happen
- that context->table_list and context->first_name_resolution_table can be
- NULL (this is typically done when creating TABLE_LISTs internally).
- TODO:
- Investigate all cases when this my happen, initialize the name resolution
- context correctly in all those places, and remove the context reset below.
- */
- if (!context->table_list || !context->first_name_resolution_table)
- {
- /* Test whether the context is in a consistent state. */
- DBUG_ASSERT(!context->first_name_resolution_table && !context->table_list);
- context->table_list= context->first_name_resolution_table= tables;
- }
-
+ DBUG_ASSERT ((select_insert && !tables->next_name_resolution_table) || !tables ||
+ (context->table_list && context->first_name_resolution_table));
/*
this is used for INSERT ... SELECT.
For select we setup tables except first (and its underlying tables)