1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

BUG#9998 MySQL client hangs on "USE database"

Use open_normal_and_derived_tables instead of open_and_lock_tables when reading metadata for a table.
 Add two test cases, one for "USE database" and one for "SHOW COLUMNS FROM table"
This commit is contained in:
msvensson@neptunus.(none)
2005-06-03 15:29:05 +02:00
parent 329d974df7
commit 8c0f0c7b2b
5 changed files with 39 additions and 6 deletions

View File

@ -348,7 +348,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
table_list->table_name));
/* Only one table for now, but VIEW can involve several tables */
if (open_and_lock_tables(thd, table_list))
if (open_normal_and_derived_tables(thd, table_list))
{
DBUG_RETURN(TRUE);
}
@ -539,8 +539,7 @@ mysqld_list_fields(THD *thd, TABLE_LIST *table_list, const char *wild)
DBUG_ENTER("mysqld_list_fields");
DBUG_PRINT("enter",("table: %s",table_list->table_name));
table_list->lock_type= TL_UNLOCK;
if (open_and_lock_tables(thd, table_list))
if (open_normal_and_derived_tables(thd, table_list))
DBUG_VOID_RETURN;
table= table_list->table;
@ -1938,7 +1937,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
bool res;
lex->all_selects_list= lsel;
res= open_and_lock_tables(thd, show_table_list);
res= open_normal_and_derived_tables(thd, show_table_list);
if (schema_table->process_table(thd, show_table_list,
table, res, show_table_list->db,
show_table_list->alias))
@ -2043,7 +2042,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
show_table_list->lock_type= lock_type;
lex->all_selects_list= &sel;
lex->derived_tables= 0;
res= open_and_lock_tables(thd, show_table_list);
res= open_normal_and_derived_tables(thd, show_table_list);
if (schema_table->process_table(thd, show_table_list, table,
res, base_name,
show_table_list->alias))