summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-04-18 17:20:55 +0000
committerSergei Golubchik <serg@mariadb.org>2017-04-27 19:12:39 +0200
commitf06ab0fc99daa9049f8b9f8992d403047efd41e1 (patch)
tree61c02ce50341326130178cf0e2fba9d3671a848f /sql
parentec68f764f6f9dc4028a0af93b78449e76e972b9a (diff)
downloadmariadb-git-f06ab0fc99daa9049f8b9f8992d403047efd41e1.tar.gz
MDEV-9566 Server code changes in preparation for mariabackup
- Backup will load encryption plugins outside of mysqld. Thus, do not force loading MyISAM plugin in plugin_load. - init_signals() will be used in backup, make it global, not static.
Diffstat (limited to 'sql')
-rw-r--r--sql/mysqld.cc4
-rw-r--r--sql/sql_plugin.cc30
2 files changed, 20 insertions, 14 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 83829841b39..0bf57d9543b 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3100,7 +3100,7 @@ LONG WINAPI my_unhandler_exception_filter(EXCEPTION_POINTERS *ex_pointers)
}
-static void init_signals(void)
+void init_signals(void)
{
if(opt_console)
SetConsoleCtrlHandler(console_event_handler,TRUE);
@@ -3231,7 +3231,7 @@ static size_t my_setstacksize(pthread_attr_t *attr, size_t stacksize)
#ifndef EMBEDDED_LIBRARY
-static void init_signals(void)
+void init_signals(void)
{
sigset_t set;
struct sigaction sa;
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index eacf39098b4..469e96c5fee 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1606,22 +1606,28 @@ int plugin_init(int *argc, char **argv, int flags)
}
}
- /* First, we initialize only MyISAM - that should always succeed */
+ /*
+ First, we initialize only MyISAM - that should almost always succeed
+ (almost always, because plugins can be loaded outside of the server, too).
+ */
plugin_ptr= plugin_find_internal(&MyISAM, MYSQL_STORAGE_ENGINE_PLUGIN);
- DBUG_ASSERT(plugin_ptr);
- DBUG_ASSERT(plugin_ptr->load_option == PLUGIN_FORCE);
+ DBUG_ASSERT(plugin_ptr || !mysql_mandatory_plugins[0]);
+ if (plugin_ptr)
+ {
+ DBUG_ASSERT(plugin_ptr->load_option == PLUGIN_FORCE);
- if (plugin_initialize(&tmp_root, plugin_ptr, argc, argv, false))
- goto err_unlock;
+ if (plugin_initialize(&tmp_root, plugin_ptr, argc, argv, false))
+ goto err_unlock;
- /*
- set the global default storage engine variable so that it will
- not be null in any child thread.
- */
- global_system_variables.table_plugin=
- intern_plugin_lock(NULL, plugin_int_to_ref(plugin_ptr));
- DBUG_ASSERT(plugin_ptr->ref_count == 1);
+ /*
+ set the global default storage engine variable so that it will
+ not be null in any child thread.
+ */
+ global_system_variables.table_plugin =
+ intern_plugin_lock(NULL, plugin_int_to_ref(plugin_ptr));
+ DBUG_ASSERT(plugin_ptr->ref_count == 1);
+ }
mysql_mutex_unlock(&LOCK_plugin);
/* Register (not initialize!) all dynamic plugins */