summaryrefslogtreecommitdiff
path: root/sql/sql_derived.cc
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-11-09 15:40:46 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2002-11-09 15:40:46 +0200
commitf980950bb3b19df3de3030c531ecff99ecb323e1 (patch)
tree3c10dade9a6185810108c75e43d33d2ac7fd6a99 /sql/sql_derived.cc
parent826aa607ff323a126b62406e75bea154a20c30a8 (diff)
downloadmariadb-git-f980950bb3b19df3de3030c531ecff99ecb323e1.tar.gz
Some code optimisations related to EXPLAIN of derived tables and the
resulting code cleanup in our main loop.
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r--sql/sql_derived.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 1335618b90d..93627409d27 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -28,8 +28,7 @@
static const char *any_db="*any*"; // Special symbol for check_access
-int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t,
- bool tables_is_opened)
+int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t)
{
/*
TODO: make derived tables with union inside (now only 1 SELECT may be
@@ -58,7 +57,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t,
if (cursor->derived)
{
res= mysql_derived(thd, lex, (SELECT_LEX_UNIT *)cursor->derived,
- cursor, 0);
+ cursor);
if (res) DBUG_RETURN(res);
}
}
@@ -68,7 +67,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t,
while ((item= it++))
item_list.push_back(item);
- if (tables_is_opened || !(res=open_and_lock_tables(thd,tables)))
+ if (!(res=open_and_lock_tables(thd,tables)))
{
if (setup_fields(thd,tables,item_list,0,0,1))
{
@@ -112,7 +111,8 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t,
t->real_name=table->real_name;
t->table=table;
table->derived_select_number= sl->select_number;
- sl->exclude();
+ if (!lex->describe)
+ sl->exclude();
t->db= (tables && tables->db && tables->db[0]) ? t->db : thd->db;
t->derived=(SELECT_LEX *)0; // just in case ...
}