free Sql_path in the destructor, perform cleanup in cleanup()

This commit is contained in:
Sergei Golubchik 2025-11-21 22:46:04 +01:00
commit 85b713b2a3
7 changed files with 8 additions and 9 deletions

View file

@ -114,9 +114,6 @@ void sys_var_end()
for (sys_var *var=all_sys_vars.first; var; var= var->next)
var->cleanup();
global_system_variables.path.free();
max_system_variables.path.free();
DBUG_VOID_RETURN;
}

View file

@ -776,8 +776,6 @@ Sp_handler::db_find_routine(THD *thd, const Database_qualified_name *name,
ret= db_load_routine(thd, name, sphp, sql_mode, sql_path, params, returns,
body, chistics, definer, created, modified, NULL,
creation_ctx);
sql_path.free();
done:
/*
Restore the time zone flag as the timezone usage in proc table

View file

@ -910,7 +910,6 @@ sp_head::~sp_head()
delete_dynamic(&m_instr);
delete m_pcont;
free_items();
m_sql_path.free();
/*
If we have non-empty LEX stack then we just came out of parser with

View file

@ -1909,7 +1909,6 @@ THD::~THD()
#if defined(ENABLED_DEBUG_SYNC)
debug_sync_end_thread(this);
#endif
variables.path.free();
/* Ensure everything is freed */
status_var.local_memory_used-= sizeof(THD);

View file

@ -34,6 +34,8 @@ public:
set(std::move(rhs));
}
~Sql_path() { free(); }
bool resolve(THD *thd, sp_head *caller, sp_name *name,
const Sp_handler **sph, Database_qualified_name *pkgname) const;
/*

View file

@ -3398,8 +3398,6 @@ void plugin_thdvar_cleanup(THD *thd)
thd->variables.default_master_connection.str= 0;
thd->variables.default_master_connection.length= 0;
thd->variables.path.free();
mysql_mutex_lock(&LOCK_plugin);
unlock_variables(thd, &thd->variables);

View file

@ -3186,4 +3186,10 @@ private:
{
return make_value_ptr(thd, global_system_variables.path);
}
void cleanup() override
{
global_system_variables.path.free();
max_system_variables.path.free();
}
};