mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge lamia.home:/home/timka/mysql/src/5.0-bug-21774-sm
into lamia.home:/home/timka/mysql/src/5.1-dbg mysql-test/r/insert_select.result: Auto merged sql/sql_base.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_parse.cc: Auto merged
This commit is contained in:
@ -5371,7 +5371,20 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
|
||||
uint tablenr= 0;
|
||||
DBUG_ENTER("setup_tables");
|
||||
|
||||
context->table_list= context->first_name_resolution_table= 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;
|
||||
}
|
||||
|
||||
/*
|
||||
this is used for INSERT ... SELECT.
|
||||
|
Reference in New Issue
Block a user