summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2015-07-28 10:18:55 +0400
committerSergey Vojtovich <svoj@mariadb.org>2015-07-29 13:51:22 +0400
commit4188ba9c1e0ea195adf00d9e6d11b29ef18b2109 (patch)
treede48b73011f97be796ff8369bfaa834fb410a7a1
parentcf30074c3ff6815d85bbd864b28adfe7949d340c (diff)
downloadmariadb-git-4188ba9c1e0ea195adf00d9e6d11b29ef18b2109.tar.gz
MDEV-7652 - More explanatory ERROR and WARNING messages when loading plugins
with plugin-load-add that are already registered at mysql.plugin - issue just one error message, without this extra warning - don't abuse ER_UDF_EXISTS, instead add a proper error message for plugins - report started initialization for each plugin source
-rw-r--r--mysql-test/r/blackhole_plugin.result2
-rw-r--r--mysql-test/r/plugin.result2
-rw-r--r--mysql-test/suite/archive/archive_plugin.result2
-rw-r--r--mysql-test/suite/archive/archive_plugin.test2
-rw-r--r--mysql-test/t/blackhole_plugin.test2
-rw-r--r--mysql-test/t/plugin.test2
-rw-r--r--sql/share/errmsg-utf8.txt3
-rw-r--r--sql/sql_plugin.cc15
8 files changed, 20 insertions, 10 deletions
diff --git a/mysql-test/r/blackhole_plugin.result b/mysql-test/r/blackhole_plugin.result
index 4ef9fa0fa47..dd1b95ab0d9 100644
--- a/mysql-test/r/blackhole_plugin.result
+++ b/mysql-test/r/blackhole_plugin.result
@@ -5,7 +5,7 @@ Warning 1266 Using storage engine MyISAM for table 't1'
DROP TABLE t1;
INSTALL PLUGIN blackhole SONAME 'ha_blackhole.so';
INSTALL PLUGIN BLACKHOLE SONAME 'ha_blackhole.so';
-ERROR HY000: Function 'BLACKHOLE' already exists
+ERROR HY000: Plugin 'BLACKHOLE' already installed
UNINSTALL PLUGIN blackhole;
INSTALL PLUGIN blackhole SONAME 'ha_blackhole.so';
CREATE TABLE t1(a int) ENGINE=BLACKHOLE;
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
index 510c812a30f..ce382e35bd1 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -5,7 +5,7 @@ Warning 1266 Using storage engine MyISAM for table 't1'
DROP TABLE t1;
INSTALL PLUGIN example SONAME 'ha_example';
INSTALL PLUGIN EXAMPLE SONAME 'ha_example';
-ERROR HY000: Function 'EXAMPLE' already exists
+ERROR HY000: Plugin 'EXAMPLE' already installed
UNINSTALL PLUGIN example;
INSTALL SONAME 'ha_example';
select * from information_schema.plugins where plugin_library like 'ha_example%';
diff --git a/mysql-test/suite/archive/archive_plugin.result b/mysql-test/suite/archive/archive_plugin.result
index 90c1f10bf19..feb825f20ee 100644
--- a/mysql-test/suite/archive/archive_plugin.result
+++ b/mysql-test/suite/archive/archive_plugin.result
@@ -5,7 +5,7 @@ Warning 1266 Using storage engine MyISAM for table 't1'
DROP TABLE t1;
INSTALL PLUGIN archive SONAME 'ha_archive.so';
INSTALL PLUGIN ARCHIVE SONAME 'ha_archive.so';
-ERROR HY000: Function 'ARCHIVE' already exists
+ERROR HY000: Plugin 'ARCHIVE' already installed
UNINSTALL PLUGIN archive;
INSTALL PLUGIN archive SONAME 'ha_archive.so';
CREATE TABLE t1(a int) ENGINE=ARCHIVE;
diff --git a/mysql-test/suite/archive/archive_plugin.test b/mysql-test/suite/archive/archive_plugin.test
index ba80652fb02..8ea40114cca 100644
--- a/mysql-test/suite/archive/archive_plugin.test
+++ b/mysql-test/suite/archive/archive_plugin.test
@@ -7,7 +7,7 @@ DROP TABLE t1;
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN archive SONAME '$HA_ARCHIVE_SO';
--replace_regex /\.dll/.so/
---error 1125
+--error ER_PLUGIN_INSTALLED
eval INSTALL PLUGIN ARCHIVE SONAME '$HA_ARCHIVE_SO';
UNINSTALL PLUGIN archive;
diff --git a/mysql-test/t/blackhole_plugin.test b/mysql-test/t/blackhole_plugin.test
index 8af8fcc941c..0cc7ae0817c 100644
--- a/mysql-test/t/blackhole_plugin.test
+++ b/mysql-test/t/blackhole_plugin.test
@@ -7,7 +7,7 @@ DROP TABLE t1;
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN blackhole SONAME '$HA_BLACKHOLE_SO';
--replace_regex /\.dll/.so/
---error 1125
+--error ER_PLUGIN_INSTALLED
eval INSTALL PLUGIN BLACKHOLE SONAME '$HA_BLACKHOLE_SO';
UNINSTALL PLUGIN blackhole;
diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test
index 13e2c71fbc4..ec7117bb832 100644
--- a/mysql-test/t/plugin.test
+++ b/mysql-test/t/plugin.test
@@ -6,7 +6,7 @@ DROP TABLE t1;
INSTALL PLUGIN example SONAME 'ha_example';
--replace_regex /\.dll/.so/
---error 1125
+--error ER_PLUGIN_INSTALLED
INSTALL PLUGIN EXAMPLE SONAME 'ha_example';
UNINSTALL PLUGIN example;
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 6954170e86c..5fed6b10425 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -7111,3 +7111,6 @@ ER_SLAVE_SKIP_NOT_IN_GTID
eng "When using GTID, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID position."
ER_TABLE_DEFINITION_TOO_BIG
eng "The definition for table %`s is too big"
+ER_PLUGIN_INSTALLED
+ eng "Plugin '%-.192s' already installed"
+ rus "Плагин '%-.192s' уже установлен"
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index dc408703da4..dea224398ea 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1049,7 +1049,7 @@ static bool plugin_add(MEM_ROOT *tmp_root,
if (name->str && plugin_find_internal(name, MYSQL_ANY_PLUGIN))
{
- report_error(report, ER_UDF_EXISTS, name->str);
+ report_error(report, ER_PLUGIN_INSTALLED, name->str);
DBUG_RETURN(TRUE);
}
/* Clear the whole struct to catch future extensions. */
@@ -1546,6 +1546,9 @@ int plugin_init(int *argc, char **argv, int flags)
/*
First we register builtin plugins
*/
+ if (global_system_variables.log_warnings >= 9)
+ sql_print_information("Initializing built-in plugins");
+
for (builtins= mysql_mandatory_plugins; *builtins || mandatory; builtins++)
{
if (!*builtins)
@@ -1627,11 +1630,17 @@ int plugin_init(int *argc, char **argv, int flags)
{
I_List_iterator<i_string> iter(opt_plugin_load_list);
i_string *item;
+ if (global_system_variables.log_warnings >= 9)
+ sql_print_information("Initializing plugins specified on the command line");
while (NULL != (item= iter++))
plugin_load_list(&tmp_root, item->ptr);
if (!(flags & PLUGIN_INIT_SKIP_PLUGIN_TABLE))
+ {
+ if (global_system_variables.log_warnings >= 9)
+ sql_print_information("Initializing installed plugins");
plugin_load(&tmp_root);
+ }
}
/*
@@ -1772,9 +1781,7 @@ static void plugin_load(MEM_ROOT *tmp_root)
the mutex here to satisfy the assert
*/
mysql_mutex_lock(&LOCK_plugin);
- if (plugin_add(tmp_root, &name, &dl, REPORT_TO_LOG))
- sql_print_warning("Couldn't load plugin named '%s' with soname '%s'.",
- str_name.c_ptr(), str_dl.c_ptr());
+ plugin_add(tmp_root, &name, &dl, REPORT_TO_LOG);
free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE));
mysql_mutex_unlock(&LOCK_plugin);
}