summaryrefslogtreecommitdiff
path: root/sql/sql_derived.cc
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-11-26 16:49:55 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2002-11-26 16:49:55 +0200
commitae729f93158e57ef52b57ead0ec4f0c052fdda92 (patch)
tree1889a609e5964b264cf5be84776c0c2aa558a1a2 /sql/sql_derived.cc
parenta14db06bfced19d46d0f85f17cb7567f678f799c (diff)
downloadmariadb-git-ae729f93158e57ef52b57ead0ec4f0c052fdda92.tar.gz
A fix for a bug with derived tables within subselect
within derived tables within ......
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r--sql/sql_derived.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index b3d2b1602d0..6dc001a1932 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -50,15 +50,19 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t)
if (res)
DBUG_RETURN(-1);
- for (TABLE_LIST *cursor= (TABLE_LIST *)tables;
- cursor;
- cursor=cursor->next)
+ for (SELECT_LEX *ssl= sl; ssl; ssl= ssl->next_select_in_list())
{
- if (cursor->derived)
+ TABLE_LIST *t_tables= (TABLE_LIST *)ssl->table_list.first;
+ for (TABLE_LIST *cursor= (TABLE_LIST *)t_tables;
+ cursor;
+ cursor=cursor->next)
{
- res= mysql_derived(thd, lex, (SELECT_LEX_UNIT *)cursor->derived,
- cursor);
- if (res) DBUG_RETURN(res);
+ if (cursor->derived)
+ {
+ res= mysql_derived(thd, lex, (SELECT_LEX_UNIT *)cursor->derived,
+ cursor);
+ if (res) DBUG_RETURN(res);
+ }
}
}
Item *item;