diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2017-06-26 18:29:30 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2017-06-26 18:29:30 +0300 |
commit | de209ca4a10385a392e3596c80187b88434b6fe5 (patch) | |
tree | 8776f639a549bac2e133579b6ce6a1335aa5a477 /sql/sql_plugin.cc | |
parent | 2a3fe45dd2df047cc0d66e2bcdbadd5005c85a1a (diff) | |
download | mariadb-git-bb-10.3-mdev12179.tar.gz |
MDEV-12179: Per-engine mysql.gtid_slave_pos tablesbb-10.3-mdev12179
Merge to 10.3
- changed a few LEX_STRING to LEX_CSTRING
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r-- | sql/sql_plugin.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 92b9c94e84c..c73229a2ee0 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -941,6 +941,10 @@ SHOW_COMP_OPTION plugin_status(const char *name, size_t len, int type) } +/* + If LEX is passed non-NULL, an automatic unlock of the plugin will happen + in the LEX destructor. +*/ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc) { st_plugin_int *pi= plugin_ref_to_int(rc); @@ -984,6 +988,16 @@ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc) } +/* + Notes on lifetime: + + If THD is passed as non-NULL (and with a non-NULL thd->lex), an entry is made + in the thd->lex which will cause an automatic unlock of the plugin in the LEX + destructor. In this case, no manual unlock must be done. + + Otherwise, when passing a NULL THD, the caller must arrange that plugin + unlock happens later. +*/ plugin_ref plugin_lock(THD *thd, plugin_ref ptr) { LEX *lex= thd ? thd->lex : 0; @@ -1020,6 +1034,16 @@ plugin_ref plugin_lock(THD *thd, plugin_ref ptr) } +/* + Notes on lifetime: + + If THD is passed as non-NULL (and with a non-NULL thd->lex), an entry is made + in the thd->lex which will cause an automatic unlock of the plugin in the LEX + destructor. In this case, no manual unlock must be done. + + Otherwise, when passing a NULL THD, the caller must arrange that plugin + unlock happens later. +*/ plugin_ref plugin_lock_by_name(THD *thd, const LEX_CSTRING *name, int type) { LEX *lex= thd ? thd->lex : 0; @@ -1935,6 +1959,12 @@ void plugin_shutdown(void) if (initialized) { + if (opt_gtid_pos_auto_plugins) + { + free_engine_list(opt_gtid_pos_auto_plugins); + opt_gtid_pos_auto_plugins= NULL; + } + mysql_mutex_lock(&LOCK_plugin); reap_needed= true; |