mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
MDEV-28956 Locking is broken if CREATE OR REPLACE fails under LOCK TABLES
add_back_last_deleted_lock() was called when the lock was never removed. Lock is removed in finalize_atomic_replace() in close_all_tables_for_name(). finalize_atomic_replace() is done only for successful operation. In non-atomic codepath it drops the table first, if anything fails later we don't need to return back the lock since there is no table now. So the fix is required as well.
This commit is contained in:
@@ -2382,7 +2382,7 @@ struct HA_CREATE_INFO: public Table_scope_and_contents_source_st,
|
||||
}
|
||||
bool finalize_atomic_replace(THD *thd, TABLE_LIST *orig_table);
|
||||
void finalize_ddl(THD *thd, bool roll_back);
|
||||
bool finalize_locked_tables(THD *thd);
|
||||
bool finalize_locked_tables(THD *thd, bool operation_failed);
|
||||
bool make_tmp_table_list(THD *thd, TABLE_LIST **create_table,
|
||||
int *create_table_mode);
|
||||
};
|
||||
|
Reference in New Issue
Block a user