summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-05-05 11:36:53 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2017-05-05 11:36:53 +0200
commita903be5d964fcda2c7f6eb649885dbd98901fb72 (patch)
treec4714d265a82b3c7aef7188853b439d8d54b8bf5 /sql/sql_plugin.cc
parent1f63feb91a027cdccbf3c14d513d11acf8aa7431 (diff)
parent6935d66053b2c9723314d89d5169dcf34ed56c08 (diff)
downloadmariadb-git-10.2-wlad-merge.tar.gz
Merge commit '6935d66053b2c9723314d89d5169dcf34ed56c08' into bb-10.2-marko10.2-wlad-merge
# Conflicts: # debian/control # debian/mariadb-server-10.2.install # include/my_sys.h # mysql-test/collections/buildbot_suites.bat # plugin/auth_dialog/CMakeLists.txt # sql/CMakeLists.txt # sql/sql_class.cc # storage/innobase/CMakeLists.txt # storage/innobase/log/log0crypt.cc # win/packaging/CPackWixConfig.cmake
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc30
1 files changed, 18 insertions, 12 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 101ea3fd3c7..d352d715aa5 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1617,22 +1617,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 */