mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 10.3 into 10.4
This commit is contained in:
@ -1517,6 +1517,7 @@ void THD::cleanup(void)
|
||||
auto_inc_intervals_in_cur_stmt_for_binlog.empty();
|
||||
|
||||
mysql_ull_cleanup(this);
|
||||
stmt_map.reset();
|
||||
/* All metadata locks must have been released by now. */
|
||||
DBUG_ASSERT(!mdl_context.has_locks());
|
||||
|
||||
@ -3994,11 +3995,13 @@ void Statement_map::erase(Statement *statement)
|
||||
void Statement_map::reset()
|
||||
{
|
||||
/* Must be first, hash_free will reset st_hash.records */
|
||||
mysql_mutex_lock(&LOCK_prepared_stmt_count);
|
||||
DBUG_ASSERT(prepared_stmt_count >= st_hash.records);
|
||||
prepared_stmt_count-= st_hash.records;
|
||||
mysql_mutex_unlock(&LOCK_prepared_stmt_count);
|
||||
|
||||
if (st_hash.records)
|
||||
{
|
||||
mysql_mutex_lock(&LOCK_prepared_stmt_count);
|
||||
DBUG_ASSERT(prepared_stmt_count >= st_hash.records);
|
||||
prepared_stmt_count-= st_hash.records;
|
||||
mysql_mutex_unlock(&LOCK_prepared_stmt_count);
|
||||
}
|
||||
my_hash_reset(&names_hash);
|
||||
my_hash_reset(&st_hash);
|
||||
last_found_statement= 0;
|
||||
@ -4007,12 +4010,8 @@ void Statement_map::reset()
|
||||
|
||||
Statement_map::~Statement_map()
|
||||
{
|
||||
/* Must go first, hash_free will reset st_hash.records */
|
||||
mysql_mutex_lock(&LOCK_prepared_stmt_count);
|
||||
DBUG_ASSERT(prepared_stmt_count >= st_hash.records);
|
||||
prepared_stmt_count-= st_hash.records;
|
||||
mysql_mutex_unlock(&LOCK_prepared_stmt_count);
|
||||
|
||||
/* Statement_map::reset() should be called prior to destructor. */
|
||||
DBUG_ASSERT(!st_hash.records);
|
||||
my_hash_free(&names_hash);
|
||||
my_hash_free(&st_hash);
|
||||
}
|
||||
|
Reference in New Issue
Block a user