1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00
This commit is contained in:
bell@sanja.is.com.ua
2004-02-09 15:49:11 +02:00
32 changed files with 790 additions and 394 deletions

View File

@ -173,7 +173,6 @@ int handle_select(THD *thd, LEX *lex, select_result *result)
register SELECT_LEX *select_lex = &lex->select_lex;
DBUG_ENTER("handle_select");
fix_tables_pointers(lex->all_selects_list);
if (select_lex->next_select())
res=mysql_union(thd, lex, result, &lex->unit);
else
@ -328,8 +327,7 @@ JOIN::prepare(Item ***rref_pointer_array,
// Is it subselect
{
Item_subselect *subselect;
if ((subselect= select_lex->master_unit()->item) &&
select_lex->linkage != GLOBAL_OPTIONS_TYPE)
if ((subselect= select_lex->master_unit()->item))
{
Item_subselect::trans_res res;
if ((res= subselect->select_transformer(this)) !=
@ -1525,10 +1523,10 @@ JOIN::cleanup()
lock=0; // It's faster to unlock later
join_free(1);
if (exec_tmp_table1)
free_tmp_table(thd, exec_tmp_table1);
if (exec_tmp_table2)
free_tmp_table(thd, exec_tmp_table2);
if (exec_tmp_table1)
free_tmp_table(thd, exec_tmp_table1);
if (exec_tmp_table2)
free_tmp_table(thd, exec_tmp_table2);
delete select;
delete_dynamic(&keyuse);
delete procedure;
@ -1580,8 +1578,8 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
goto err;
}
}
free_join= 0;
}
free_join= 0;
join->select_options= select_options;
}
else
@ -3794,11 +3792,6 @@ JOIN::join_free(bool full)
{
if (tab->table)
{
if (tab->table->key_read)
{
tab->table->key_read= 0;
tab->table->file->extra(HA_EXTRA_NO_KEYREAD);
}
/* Don't free index if we are using read_record */
if (!tab->read_record.table)
tab->table->file->index_end();
@ -9149,6 +9142,9 @@ int mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
sl;
sl= sl->next_select())
{
// drop UNCACHEABLE_EXPLAIN, because it is for internal usage only
uint8 uncacheable= (sl->uncacheable & ~UNCACHEABLE_EXPLAIN);
res= mysql_explain_select(thd, sl,
(((&thd->lex->select_lex)==sl)?
((thd->lex->all_selects_list != sl) ?
@ -9156,13 +9152,13 @@ int mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
((sl == first)?
((sl->linkage == DERIVED_TABLE_TYPE) ?
"DERIVED":
((sl->uncacheable & UNCACHEABLE_DEPENDENT) ?
((uncacheable & UNCACHEABLE_DEPENDENT) ?
"DEPENDENT SUBQUERY":
(sl->uncacheable?"UNCACHEABLE SUBQUERY":
(uncacheable?"UNCACHEABLE SUBQUERY":
"SUBQUERY"))):
((sl->uncacheable & UNCACHEABLE_DEPENDENT) ?
((uncacheable & UNCACHEABLE_DEPENDENT) ?
"DEPENDENT UNION":
sl->uncacheable?"UNCACHEABLE UNION":
uncacheable?"UNCACHEABLE UNION":
"UNION"))),
result);
if (res)