Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.0, 13.1
-
None
Description
Plugins have no way to determine the character set of their string system variable values. This affects both MYSQL_SYSVAR_STR and MYSQL_THDVAR_STR, with or without custom check/update callbacks.
For example, assigning a UCS-2 string to server_audit_syslog_info succeeds but stores an empty string instead of ABC:
--source include/not_embedded.inc
|
--source include/have_ucs2.inc
|
|
|
if (!$SERVER_AUDIT_SO) {
|
skip No SERVER_AUDIT plugin;
|
}
|
|
|
install plugin server_audit soname 'server_audit';
|
|
|
set global server_audit_syslog_info='ABC';
|
select hex(@@global.server_audit_syslog_info) as stored_hex,
|
octet_length(@@global.server_audit_syslog_info) as stored_length;
|
|
|
# Convert the expression's charset before storing a plugin string variable.
|
select hex(convert('ABC' using ucs2)) as source_hex;
|
set global server_audit_syslog_info=convert('ABC' using ucs2);
|
select hex(@@global.server_audit_syslog_info) as stored_hex,
|
octet_length(@@global.server_audit_syslog_info) as stored_length;
|
|
|
uninstall plugin server_audit;
|
Result:
install plugin server_audit soname 'server_audit';
|
set global server_audit_syslog_info='ABC';
|
select hex(@@global.server_audit_syslog_info) as stored_hex,
|
octet_length(@@global.server_audit_syslog_info) as stored_length;
|
stored_hex stored_length
|
414243 3
|
select hex(convert('ABC' using ucs2)) as source_hex;
|
source_hex
|
004100420043
|
set global server_audit_syslog_info=convert('ABC' using ucs2);
|
select hex(@@global.server_audit_syslog_info) as stored_hex,
|
octet_length(@@global.server_audit_syslog_info) as stored_length;
|
stored_hex stored_length
|
0
|
uninstall plugin server_audit;
|