mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
A pre-requisite patch for the fix for Bug#52044.
This patch also fixes Bug#55452 "SET PASSWORD is replicated twice in RBR mode". The goal of this patch is to remove the release of metadata locks from close_thread_tables(). This is necessary to not mistakenly release the locks in the course of a multi-step operation that involves multiple close_thread_tables() or close_tables_for_reopen(). On the same token, move statement commit outside close_thread_tables(). Other cleanups: Cleanup COM_FIELD_LIST. Don't call close_thread_tables() in COM_SHUTDOWN -- there are no open tables there that can be closed (we leave the locked tables mode in THD destructor, and this close_thread_tables() won't leave it anyway). Make open_and_lock_tables() and open_and_lock_tables_derived() call close_thread_tables() upon failure. Remove the calls to close_thread_tables() that are now unnecessary. Simplify the back off condition in Open_table_context. Streamline metadata lock handling in LOCK TABLES implementation. Add asserts to ensure correct life cycle of statement transaction in a session. Remove a piece of dead code that has also become redundant after the fix for Bug 37521.
This commit is contained in:
@ -21,7 +21,7 @@
|
||||
#include "sql_locale.h"
|
||||
#include "sql_plugin.h"
|
||||
#include "sql_parse.h" // check_table_access
|
||||
#include "sql_base.h" // close_thread_tables
|
||||
#include "sql_base.h" // close_mysql_tables
|
||||
#include "key.h" // key_copy
|
||||
#include "sql_show.h" // remove_status_vars, add_status_vars
|
||||
#include "strfunc.h" // find_set
|
||||
@ -1511,8 +1511,8 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv)
|
||||
sql_print_error(ER(ER_GET_ERRNO), my_errno);
|
||||
end_read_record(&read_record_info);
|
||||
table->m_needs_reopen= TRUE; // Force close to free memory
|
||||
close_mysql_tables(new_thd);
|
||||
end:
|
||||
close_thread_tables(new_thd);
|
||||
/* Remember that we don't have a THD */
|
||||
my_pthread_setspecific_ptr(THR_THD, 0);
|
||||
DBUG_VOID_RETURN;
|
||||
|
Reference in New Issue
Block a user