summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-12-12 16:09:06 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2002-12-12 16:09:06 +0200
commit657b311206e5230e540845fedbb388a683d0e917 (patch)
tree92a456da0a6fe604493cc93e3cfbb89268ca086e /sql/sql_lex.cc
parent62ce900c2e116627b05a611e6ad03698b6b18a3b (diff)
downloadmariadb-git-657b311206e5230e540845fedbb388a683d0e917.tar.gz
derived tables with UNION's ...
Scrum task !!!!! mysql-test/r/analyse.result: reverting a fix mysql-test/r/derived.result: derived tables with UNION's ... mysql-test/t/analyse.test: reverting a fix mysql-test/t/derived.test: derived tables with UNION's ... sql/mysql_priv.h: derived tables with UNION's ... sql/sql_analyse.cc: reverting a fix sql/sql_derived.cc: derived tables with UNION's ... sql/sql_lex.cc: derived tables with UNION's ... sql/sql_select.cc: derived tables with UNION's ... sql/sql_union.cc: derived tables with UNION's ...
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 833f36dbe9f..4df3178c1f8 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -995,7 +995,8 @@ void st_select_lex::init_select()
use_index.empty();
ftfunc_list_alloc.empty();
ftfunc_list= &ftfunc_list_alloc;
- linkage= UNSPECIFIED_TYPE;
+ if (linkage != UNION_TYPE)
+ linkage= UNSPECIFIED_TYPE;
}
/*
@@ -1206,7 +1207,7 @@ bool st_select_lex_unit::create_total_list_n_last_return(THD *thd, st_lex *lex,
net_printf(thd,ER_WRONG_USAGE,"UNION","ORDER BY");
return 1;
}
- if (sl->linkage == DERIVED_TABLE_TYPE)
+ if (sl->linkage == DERIVED_TABLE_TYPE && !sl->next_select())
continue;
for (SELECT_LEX_UNIT *inner= sl->first_inner_unit();
inner;