mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
A post-review fix for type-aware metadata locks.
DDL no longer aborts mysql_lock_tables(), and hence we no longer need to support need_reopen flag of this call. Remove the flag, and all the code in the server that was responsible for handling the case when it was set. This allowed to simplify: open_and_lock_tables_derived(), the delayed thread, multi-update. Rename MYSQL_LOCK_IGNORE_FLUSH to MYSQL_OPEN_IGNORE_FLUSH, since we now only support this flag in open_table(). Rename MYSQL_LOCK_PERF_SCHEMA to MYSQL_LOCK_LOG_TABLE, to avoid confusion. Move the wait for the global read lock for cases when we do updates in SELECT f1() or DO (UPDATE) to open_table() from mysql_lock_tables(). When waiting for the read lock, we could raise need_reopen flag, which is no longer present in mysql_lock_tables(). Since the block responsible for waiting for GRL was moved, MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK was renamed to MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK.
This commit is contained in:
@@ -1811,7 +1811,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
|
||||
my_bool drop_temporary)
|
||||
{
|
||||
bool error;
|
||||
Drop_table_error_handler err_handler(thd->get_internal_handler());
|
||||
Drop_table_error_handler err_handler;
|
||||
|
||||
DBUG_ENTER("mysql_rm_table");
|
||||
|
||||
@@ -4426,7 +4426,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list,
|
||||
MY_STAT stat_info;
|
||||
Open_table_context ot_ctx_unused(thd, LONG_TIMEOUT);
|
||||
DBUG_ENTER("prepare_for_repair");
|
||||
uint reopen_for_repair_flags= (MYSQL_LOCK_IGNORE_FLUSH |
|
||||
uint reopen_for_repair_flags= (MYSQL_OPEN_IGNORE_FLUSH |
|
||||
MYSQL_OPEN_HAS_MDL_LOCK);
|
||||
|
||||
if (!(check_opt->sql_flags & TT_USEFRM))
|
||||
@@ -7155,7 +7155,7 @@ view_err:
|
||||
tbl.table_name= tbl.alias= tmp_name;
|
||||
/* Table is in thd->temporary_tables */
|
||||
(void) open_table(thd, &tbl, thd->mem_root, &ot_ctx_unused,
|
||||
MYSQL_LOCK_IGNORE_FLUSH);
|
||||
MYSQL_OPEN_IGNORE_FLUSH);
|
||||
new_table= tbl.table;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user