1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

EXPLAIN on UNION"s

This commit is contained in:
Sinisa@sinisa.nasamreza.org
2001-08-24 13:18:06 +03:00
parent 66b4a894dd
commit 3b6546b875
4 changed files with 42 additions and 24 deletions

View File

@ -38,12 +38,6 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
uint elements;
DBUG_ENTER("mysql_union");
if (lex->select_lex.options & SELECT_DESCRIBE)
{
my_error(ER_WRONG_USAGE,MYF(0),"DESCRIBE","UNION");
return -1;
}
/* Fix tables--to-be-unioned-from list to point at opened tables */
for (sl=&lex->select_lex; sl; sl=sl->next)
{
@ -66,6 +60,25 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
}
}
if (lex->select_lex.options & SELECT_DESCRIBE)
{
for (sl= &lex->select_lex; sl; sl=sl->next)
{
lex->select=sl;
res=mysql_select(thd, (TABLE_LIST*) sl->table_list.first,
sl->item_list,
sl->where,
sl->ftfunc_list,
(ORDER*) 0,
(ORDER*) sl->group_list.first,
sl->having,
(ORDER*) NULL,
sl->options | thd->options | SELECT_NO_UNLOCK | SELECT_DESCRIBE,
result);
}
return 0;
}
order = (ORDER *) last_sl->order_list.first;
{
Item *item;