1
0
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:
unknown
2006-09-13 15:22:50 +03:00
5 changed files with 51 additions and 3 deletions

View File

@ -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.