1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge olga.mysql.com:/home/igor/mysql-5.0-opt

into  olga.mysql.com:/home/igor/mysql-5.1-opt


BitKeeper/etc/gone:
  auto-union
mysql-test/r/insert_select.result:
  Auto merged
mysql-test/r/join_outer.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/insert_select.test:
  Auto merged
mysql-test/t/join_outer.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
mysys/my_getopt.c:
  Auto merged
sql/field.h:
  Auto merged
sql/field_conv.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
mysql-test/include/mix1.inc:
  Manual merge
mysql-test/r/information_schema.result:
  Manual merge
mysql-test/r/innodb_mysql.result:
  Manual merge
mysql-test/t/information_schema.test:
  Manual merge
mysql-test/t/view.test:
  Manual merge
mysys/my_pthread.c:
  Manual merge
sql/mysql_priv.h:
  Manual merge
sql/opt_range.cc:
  Manual merge
sql/sql_insert.cc:
  Manual merge
sql/sql_update.cc:
  Manual merge
This commit is contained in:
unknown
2007-02-13 01:34:36 -08:00
31 changed files with 658 additions and 86 deletions

View File

@ -5050,13 +5050,15 @@ int make_schema_select(THD *thd, SELECT_LEX *sel,
SYNOPSIS
get_schema_tables_result()
join join which use schema tables
executed_place place where I_S table processed
RETURN
FALSE success
TRUE error
*/
bool get_schema_tables_result(JOIN *join)
bool get_schema_tables_result(JOIN *join,
enum enum_schema_table_state executed_place)
{
JOIN_TAB *tmp_join_tab= join->join_tab+join->tables;
THD *thd= join->thd;
@ -5076,14 +5078,24 @@ bool get_schema_tables_result(JOIN *join)
bool is_subselect= (&lex->unit != lex->current_select->master_unit() &&
lex->current_select->master_unit()->item);
/*
The schema table is already processed and
the statement is not a subselect.
So we don't need to handle this table again.
If schema table is already processed and
the statement is not a subselect then
we don't need to fill this table again.
If schema table is already processed and
schema_table_state != executed_place then
table is already processed and
we should skip second data processing.
*/
if (table_list->is_schema_table_processed && !is_subselect)
if (table_list->schema_table_state &&
(!is_subselect || table_list->schema_table_state != executed_place))
continue;
if (is_subselect) // is subselect
/*
if table is used in a subselect and
table has been processed earlier with the same
'executed_place' value then we should refresh the table.
*/
if (table_list->schema_table_state && is_subselect)
{
table_list->table->file->extra(HA_EXTRA_NO_CACHE);
table_list->table->file->extra(HA_EXTRA_RESET_STATE);
@ -5100,10 +5112,10 @@ bool get_schema_tables_result(JOIN *join)
{
result= 1;
join->error= 1;
table_list->is_schema_table_processed= TRUE;
table_list->schema_table_state= executed_place;
break;
}
table_list->is_schema_table_processed= TRUE;
table_list->schema_table_state= executed_place;
}
}
thd->no_warnings_for_error= 0;