1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

fixed subselect explain bug

This commit is contained in:
bell@sanja.is.com.ua
2002-10-16 00:42:59 +03:00
parent 1ddf863391
commit 21dd4a4dd5
6 changed files with 116 additions and 45 deletions

View File

@ -1484,24 +1484,7 @@ mysql_execute_command(THD *thd)
else
thd->send_explain_fields(explain_result);
fix_tables_pointers(select_lex);
for ( SELECT_LEX *sl= select_lex;
sl && res == 0;
sl= sl->next_select_in_list())
{
SELECT_LEX *first= sl->master_unit()->first_select();
res= mysql_explain_select(thd, sl,
((select_lex==sl)?
((sl->next_select_in_list())?"PRIMARY":
"SIMPLE"):
((sl == first)?
((sl->depended)?"DEPENDENT SUBSELECT":
"SUBSELECT"):
((sl->depended)?"DEPENDENT UNION":
"UNION"))),
explain_result);
}
if (res > 0)
res= -res; // mysql_explain_select do not report error
res= mysql_explain_union(thd, &thd->lex.unit, explain_result);
MYSQL_LOCK *save_lock= thd->lock;
thd->lock= (MYSQL_LOCK *)0;
explain_result->send_eof();