1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

After merge fixes

Some bigger code changes was necessary becasue of the multi-table-update and the new HANDLER code
This commit is contained in:
monty@mysql.com
2004-10-07 10:50:13 +03:00
parent 62f3cd6a31
commit 6239edc1d1
31 changed files with 193 additions and 124 deletions

View File

@ -1695,10 +1695,18 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
uint counter;
if (open_tables(thd, tables, &counter) || lock_tables(thd, tables, counter))
DBUG_RETURN(-1); /* purecov: inspected */
/*
Let us propagate pointers to open tables from global table list
to table lists in particular selects if needed.
*/
relink_tables_for_derived(thd);
DBUG_RETURN(mysql_handle_derived(thd->lex));
}
/*
Let us propagate pointers to open tables from global table list
to table lists in particular selects if needed.
*/
void relink_tables_for_derived(THD *thd)
{
if (thd->lex->all_selects_list->next_select_in_list() ||
thd->lex->time_zone_tables_used)
{
@ -1711,7 +1719,6 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
if (cursor->table_list)
cursor->table= cursor->table_list->table;
}
DBUG_RETURN(mysql_handle_derived(thd->lex));
}
@ -1751,7 +1758,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count)
if (!table->derived)
*(ptr++)= table->table;
}
if (!(thd->lock=mysql_lock_tables(thd,start,count)))
if (!(thd->lock=mysql_lock_tables(thd,start, (uint) (ptr - start))))
return -1; /* purecov: inspected */
}
else