summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <gluh@gluh.mysql.r18.ru>2005-02-22 16:39:39 +0300
committerunknown <gluh@gluh.mysql.r18.ru>2005-02-22 16:39:39 +0300
commit06cdc64b2c181cd20320083b25c46bd092cce1b3 (patch)
tree7c94bf68abf648fce56676281022cb913c5ce0c6 /sql
parent6965e72bd07874efee8ff6f94ab664533fc422e0 (diff)
parentb8adcb3bef7490a8ce95df8fe1b84335a1832369 (diff)
downloadmariadb-git-06cdc64b2c181cd20320083b25c46bd092cce1b3.tar.gz
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0
into gluh.mysql.r18.ru:/home/gluh/MySQL/mysql-5.0
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_show.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index e46ad024f70..e95b20c29c9 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1778,6 +1778,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
LEX *lex= thd->lex;
TABLE *table= tables->table;
SELECT_LEX *select_lex= &lex->select_lex;
+ SELECT_LEX *old_all_select_lex= lex->all_selects_list;
SELECT_LEX *lsel= tables->schema_select_lex;
ST_SCHEMA_TABLE *schema_table= tables->schema_table;
SELECT_LEX sel;
@@ -1790,6 +1791,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
List<char> bases;
List_iterator_fast<char> it(bases);
COND *partial_cond;
+ uint derived_tables= lex->derived_tables;
int error= 1;
DBUG_ENTER("get_all_tables");
@@ -1814,7 +1816,6 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
goto err;
}
- lex->all_selects_list= &sel;
schema_table_idx= get_schema_table_idx(schema_table);
lock_type= TL_UNLOCK;
@@ -1911,6 +1912,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
goto err;
TABLE_LIST *show_table_list= (TABLE_LIST*) sel.table_list.first;
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);
if (schema_table->process_table(thd, show_table_list, table,
res, base_name,
@@ -1930,7 +1933,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
error= 0;
err:
- lex->all_selects_list= select_lex;
+ lex->derived_tables= derived_tables;
+ lex->all_selects_list= old_all_select_lex;
DBUG_RETURN(error);
}