Description:
After reinstalling the keyring_file plugin, execute show global variables like 'keyring_file_data'; the variable output is empty or has incorrect content.
How to repeat:
Before starting, add two configuration items to the configuration file:
early_plugin_load=keyring_file.so
keyring_file_data=/data/keyring_file.frm
Start MySQL and load the keyring_file plugin by default
Then execute show global variables like 'keyring_file_data';
At this time, the keyring_file_data variable output is correct.
Then reinstall the plugin:
uninstall plugin keyring_file;
install plugin keyring_file soname 'keyring_file.so';
show global variables like 'keyring_file_data';
It can be found that the keyring_file_data variable output is empty or has incorrect content
The reason for this problem is that during the installation of the plugin, the configuration items will be read into temporary memory through my_load_defaults, and the plugin string variable pointer will point to the temporary memory. The memory will be released later, causing an error
/* sql_plugin.cc */
if (my_load_defaults(MYSQL_CONFIG_NAME, load_default_groups,
&argc, &argv, NULL)) { mysql_mutex_unlock(&LOCK_plugin); mysql_rwlock_unlock(&LOCK_system_variables_hash); report_error(REPORT_TO_USER, ER_PLUGIN_IS_NOT_LOADED, name->str); goto err; } error= plugin_add(thd->mem_root, name, dl, &argc, argv, REPORT_TO_USER); if (argv) free_defaults(argv);