diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-08-26 00:34:43 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-08-26 00:34:43 +0200 |
commit | bb8e99fdc367a470c6195a2ae4c33f273fe55a25 (patch) | |
tree | 3b3bcacec8faab66bf6756f20dff1e45462fdc1c /sql/encryption.cc | |
parent | add44e684cb9f1b46d1d5facdf6255360fa7b656 (diff) | |
parent | c02d61bc11ee06b6043e6db9a15d00b9f40bce1f (diff) | |
download | mariadb-git-bb8e99fdc367a470c6195a2ae4c33f273fe55a25.tar.gz |
Merge branch 'bb-10.2-ext' into 10.3
Diffstat (limited to 'sql/encryption.cc')
-rw-r--r-- | sql/encryption.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sql/encryption.cc b/sql/encryption.cc index 84a9904c393..3174968f9b3 100644 --- a/sql/encryption.cc +++ b/sql/encryption.cc @@ -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; } |