mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-new-marvel configure.in: Auto merged mysql-test/mysql-test-run.pl: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/item.h: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/table.cc: Auto merged
This commit is contained in:
@ -2376,7 +2376,6 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
TABLE *table= tables->table;
|
||||
SELECT_LEX *select_lex= &lex->select_lex;
|
||||
SELECT_LEX *old_all_select_lex= lex->all_selects_list;
|
||||
TABLE_LIST **save_query_tables_last= lex->query_tables_last;
|
||||
enum_sql_command save_sql_command= lex->sql_command;
|
||||
SELECT_LEX *lsel= tables->schema_select_lex;
|
||||
ST_SCHEMA_TABLE *schema_table= tables->schema_table;
|
||||
@ -2395,6 +2394,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
enum legacy_db_type not_used;
|
||||
Open_tables_state open_tables_state_backup;
|
||||
bool save_view_prepare_mode= lex->view_prepare_mode;
|
||||
Query_tables_list query_tables_list_backup;
|
||||
lex->view_prepare_mode= TRUE;
|
||||
DBUG_ENTER("get_all_tables");
|
||||
|
||||
@ -2407,6 +2407,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
*/
|
||||
lex->sql_command= SQLCOM_SHOW_FIELDS;
|
||||
|
||||
lex->reset_n_backup_query_tables_list(&query_tables_list_backup);
|
||||
|
||||
/*
|
||||
We should not introduce deadlocks even if we already have some
|
||||
tables open and locked, since we won't lock tables which we will
|
||||
@ -2447,8 +2449,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
show_table_list->db),
|
||||
show_table_list->alias));
|
||||
thd->temporary_tables= 0;
|
||||
close_thread_tables(thd);
|
||||
show_table_list->table= 0;
|
||||
close_tables_for_reopen(thd, &show_table_list);
|
||||
goto err;
|
||||
}
|
||||
|
||||
@ -2559,9 +2560,10 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
in this case.
|
||||
*/
|
||||
res= schema_table->process_table(thd, show_table_list, table,
|
||||
res, base_name,
|
||||
show_table_list->alias);
|
||||
close_thread_tables(thd);
|
||||
res, base_name,
|
||||
show_table_list->alias);
|
||||
close_tables_for_reopen(thd, &show_table_list);
|
||||
DBUG_ASSERT(!lex->query_tables_own_last);
|
||||
if (res)
|
||||
goto err;
|
||||
}
|
||||
@ -2578,11 +2580,10 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
error= 0;
|
||||
err:
|
||||
thd->restore_backup_open_tables_state(&open_tables_state_backup);
|
||||
lex->restore_backup_query_tables_list(&query_tables_list_backup);
|
||||
lex->derived_tables= derived_tables;
|
||||
lex->all_selects_list= old_all_select_lex;
|
||||
lex->query_tables_last= save_query_tables_last;
|
||||
lex->view_prepare_mode= save_view_prepare_mode;
|
||||
*save_query_tables_last= 0;
|
||||
lex->sql_command= save_sql_command;
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user