Bug #115725 After reinstalling the plugin, the plugin variable output is empty or wrong
Submitted: 30 Jul 2024 11:21 Modified: 30 Jul 2024 11:38
Reporter: xilin Chen Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.7.44/8.0.24 OS:Any
Assigned to: CPU Architecture:Any

[30 Jul 2024 11:21] xilin Chen
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);
[30 Jul 2024 11:38] MySQL Verification Team
HI Mr. mysql,

Thank you for your bug report.

However, both 5.7 and 8.0.24 are no longer supported.

Please, try using 8.0.39.

Unsupported.