diff options
author | Sinisa@sinisa.nasamreza.org <> | 2002-10-30 16:52:12 +0200 |
---|---|---|
committer | Sinisa@sinisa.nasamreza.org <> | 2002-10-30 16:52:12 +0200 |
commit | 5fbd7b63c5852ceff5558981b56f3b16334223d5 (patch) | |
tree | f019642072be903fd4c5606696e7df32356c28f0 /sql/sql_derived.cc | |
parent | 3c570209df399cc24d1e5e454a8bc152ca284a81 (diff) | |
download | mariadb-git-5fbd7b63c5852ceff5558981b56f3b16334223d5.tar.gz |
changes for mysqladmin debug
and a bug fix for derived tables
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r-- | sql/sql_derived.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 81eade6edb7..9cc83a3835a 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -70,7 +70,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t, if (tables_is_opened || !(res=open_and_lock_tables(thd,tables))) { - if (tables && setup_fields(thd,tables,item_list,0,0,1)) + if (setup_fields(thd,tables,item_list,0,0,1)) { res=-1; goto exit; @@ -113,6 +113,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t, t->table=table; table->derived_select_number= sl->select_number; sl->exclude(); + t->db= (tables && tables->db && tables->db[0]) ? t->db : thd->db; t->derived=(SELECT_LEX *)0; // just in case ... } } |