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

merge with 5.5

This commit is contained in:
Sergei Golubchik
2012-11-03 12:28:51 +01:00
210 changed files with 5894 additions and 1460 deletions

View File

@ -5059,8 +5059,6 @@ restart:
*/
if (thd->locked_tables_mode <= LTM_LOCK_TABLES)
{
bool need_prelocking= FALSE;
TABLE_LIST **save_query_tables_last= thd->lex->query_tables_last;
/*
Process elements of the prelocking set which are present there
since parsing stage or were added to it by invocations of
@ -5073,10 +5071,19 @@ restart:
for (Sroutine_hash_entry *rt= *sroutine_to_open; rt;
sroutine_to_open= &rt->next, rt= rt->next)
{
bool need_prelocking= false;
TABLE_LIST **save_query_tables_last= thd->lex->query_tables_last;
error= open_and_process_routine(thd, thd->lex, rt, prelocking_strategy,
has_prelocking_list, &ot_ctx,
&need_prelocking);
if (need_prelocking && ! thd->lex->requires_prelocking())
thd->lex->mark_as_requiring_prelocking(save_query_tables_last);
if (need_prelocking && ! *start)
*start= thd->lex->query_tables;
if (error)
{
if (ot_ctx.can_recover_from_failed_open())
@ -5097,12 +5104,6 @@ restart:
goto err;
}
}
if (need_prelocking && ! thd->lex->requires_prelocking())
thd->lex->mark_as_requiring_prelocking(save_query_tables_last);
if (need_prelocking && ! *start)
*start= thd->lex->query_tables;
}
}
@ -5374,6 +5375,12 @@ static bool check_lock_and_start_stmt(THD *thd,
thr_lock_type lock_type;
DBUG_ENTER("check_lock_and_start_stmt");
/*
Prelocking placeholder is not set for TABLE_LIST that
are directly used by TOP level statement.
*/
DBUG_ASSERT(table_list->prelocking_placeholder == false);
/*
TL_WRITE_DEFAULT and TL_READ_DEFAULT are supposed to be parser only
types of locks so they should be converted to appropriate other types