summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-02-17 11:10:22 +0100
committerSergei Golubchik <sergii@pisem.net>2014-02-17 11:10:22 +0100
commit713128246417ee3300e01d0a92f540da79bebb7e (patch)
tree2e36a1af3a98a22754b4a71f34c12dcc310013fd /sql/sql_plugin.cc
parent3febb3ce1dbf9b5025c29d50f14b7821a648fa66 (diff)
downloadmariadb-git-713128246417ee3300e01d0a92f540da79bebb7e.tar.gz
At --log-warnings=9 or more, log at what address a dynamic plugin was loaded.
It helps to interpret valgrind/safemalloc memory-related warnings that are printed when a plugin is unloaded (and thus cannot resolve addresses automatically)
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 726d1944052..c127b82b3b6 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1357,6 +1357,16 @@ static int plugin_initialize(MEM_ROOT *tmp_root, struct st_plugin_int *plugin,
goto err;
}
+ if (plugin->plugin_dl && global_system_variables.log_warnings >= 9)
+ {
+ void *sym= dlsym(plugin->plugin_dl->handle,
+ plugin->plugin_dl->mariaversion ?
+ maria_plugin_declarations_sym : plugin_declarations_sym);
+ DBUG_ASSERT(sym);
+ sql_print_information("Plugin %s loaded at %p",
+ plugin->name.str, sym);
+ }
+
if (plugin_type_initialize[plugin->plugin->type])
{
if ((*plugin_type_initialize[plugin->plugin->type])(plugin))