Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-41226

Plugin string system variables do not convert assigned values or expose their character set

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11, 11.4, 11.8, 12.3, 13.0, 13.1
    • 11.4, 11.8, 12.3
    • Plugins
    • 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;
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            svoj Sergey Vojtovich
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.