1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

EXPLAIN on UNION"s

mysql-test/r/union.result:
  New result for EXPLAIN UNION's
mysql-test/t/union.test:
  No error when EXPLAIN is done on UNION's
This commit is contained in:
unknown
2001-08-24 13:18:06 +03:00
parent 55e17c84b4
commit 5b95ffc52f
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;