mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-12863 No table can be created after second encryption plugin attempted to load
when deinitializing encryption plugins, disable server-wide encryption only if this plugin is the one that is used for encryption.
This commit is contained in:
@ -98,19 +98,27 @@ int initialize_encryption_plugin(st_plugin_int *plugin)
|
||||
|
||||
int finalize_encryption_plugin(st_plugin_int *plugin)
|
||||
{
|
||||
encryption_handler.encryption_key_get_func=
|
||||
(uint (*)(uint, uint, uchar*, uint*))no_key;
|
||||
encryption_handler.encryption_key_get_latest_version_func= no_key;
|
||||
encryption_handler.encryption_ctx_size_func= zero_size;
|
||||
bool used= plugin_ref_to_int(encryption_manager) == plugin;
|
||||
|
||||
if (used)
|
||||
{
|
||||
encryption_handler.encryption_key_get_func=
|
||||
(uint (*)(uint, uint, uchar*, uint*))no_key;
|
||||
encryption_handler.encryption_key_get_latest_version_func= no_key;
|
||||
encryption_handler.encryption_ctx_size_func= zero_size;
|
||||
}
|
||||
|
||||
if (plugin && plugin->plugin->deinit && plugin->plugin->deinit(NULL))
|
||||
{
|
||||
DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
|
||||
plugin->name.str));
|
||||
}
|
||||
if (encryption_manager)
|
||||
|
||||
if (used)
|
||||
{
|
||||
plugin_unlock(NULL, encryption_manager);
|
||||
encryption_manager= 0;
|
||||
encryption_manager= 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user