1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

More merge fixes:

- mdl.cc and mdl.h merged completely
- mysql_system_tables*.sql merged completely
- Fixed wrong merge of lock_tables
- Added some missing functions:
 - bool THD::notify_shared_lock()
 - Dynamic_array::pop, Dynamic_array::del
- Added MDL_context_owner to THD
- Added metadata_locks_hash_instances
This commit is contained in:
Michael Widenius
2013-06-16 21:26:40 +03:00
parent 7c1abe151c
commit 8075b05b7d
12 changed files with 543 additions and 211 deletions

View File

@ -3520,7 +3520,6 @@ Prepared_statement::execute_loop(String *expanded_query,
Reprepare_observer reprepare_observer;
bool error;
int reprepare_attempt= 0;
bool need_set_parameters= true;
/* Check if we got an error when sending long data */
if (state == Query_arena::STMT_ERROR)
@ -3529,20 +3528,19 @@ Prepared_statement::execute_loop(String *expanded_query,
return TRUE;
}
reexecute:
if (need_set_parameters &&
set_parameters(expanded_query, packet, packet_end))
if (set_parameters(expanded_query, packet, packet_end))
return TRUE;
/*
if set_parameters() has generated warnings,
we need to repeat it when reexecuting, to recreate these
warnings.
*/
need_set_parameters= thd->get_stmt_da()->statement_warn_count();
reprepare_observer.reset_reprepare_observer();
#ifdef NOT_YET_FROM_MYSQL_5_6
if (unlikely(thd->security_ctx->password_expired &&
!lex->is_change_password))
{
my_error(ER_MUST_CHANGE_PASSWORD, MYF(0));
return true;
}
#endif
reexecute:
/*
If the free_list is not empty, we'll wrongly free some externally
allocated items when cleaning up after validation of the prepared
@ -3556,18 +3554,20 @@ reexecute:
the observer method will be invoked to push an error into
the error stack.
*/
if (sql_command_flags[lex->sql_command] &
CF_REEXECUTION_FRAGILE)
if (sql_command_flags[lex->sql_command] & CF_REEXECUTION_FRAGILE)
{
reprepare_observer.reset_reprepare_observer();
DBUG_ASSERT(thd->m_reprepare_observer == NULL);
thd->m_reprepare_observer = &reprepare_observer;
thd->m_reprepare_observer= &reprepare_observer;
}
error= execute(expanded_query, open_cursor) || thd->is_error();
thd->m_reprepare_observer= NULL;
if (error && !thd->is_fatal_error && !thd->killed &&
if ((sql_command_flags[lex->sql_command] & CF_REEXECUTION_FRAGILE) &&
error && !thd->is_fatal_error && !thd->killed &&
reprepare_observer.is_invalidated() &&
reprepare_attempt++ < MAX_REPREPARE_ATTEMPTS)
{