MCPcopy Create free account
hub / github.com/MariaDB/server / plugin_thdvar_cleanup

Function plugin_thdvar_cleanup

sql/sql_plugin.cc:3399–3433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3397
3398
3399void plugin_thdvar_cleanup(THD *thd)
3400{
3401 size_t idx;
3402 plugin_ref *list;
3403 DBUG_ENTER("plugin_thdvar_cleanup");
3404
3405#ifndef EMBEDDED_LIBRARY
3406 thd->session_tracker.sysvars.deinit(thd);
3407 my_free(thd->variables.redirect_url);
3408 thd->variables.redirect_url= 0;
3409#endif
3410 my_free((char*) thd->variables.default_master_connection.str);
3411 thd->variables.default_master_connection.str= 0;
3412 thd->variables.default_master_connection.length= 0;
3413
3414 mysql_mutex_lock(&LOCK_plugin);
3415
3416 unlock_variables(thd, &thd->variables);
3417 cleanup_variables(&thd->variables);
3418
3419 if ((idx= thd->lex->plugins.elements))
3420 {
3421 list= ((plugin_ref*) thd->lex->plugins.buffer) + idx - 1;
3422 DBUG_PRINT("info",("unlocking %zu plugins", idx));
3423 while ((uchar*) list >= thd->lex->plugins.buffer)
3424 intern_plugin_unlock(NULL, *list--);
3425 }
3426
3427 reap_plugins();
3428 mysql_mutex_unlock(&LOCK_plugin);
3429
3430 reset_dynamic(&thd->lex->plugins);
3431
3432 DBUG_VOID_RETURN;
3433}
3434
3435
3436/**

Callers 1

free_connectionMethod · 0.85

Calls 6

my_freeFunction · 0.85
unlock_variablesFunction · 0.85
cleanup_variablesFunction · 0.85
intern_plugin_unlockFunction · 0.85
reap_pluginsFunction · 0.85
deinitMethod · 0.45

Tested by

no test coverage detected