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

Query text written in the client charset produces non-UTF-8 records in audit log

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      Query text written in the client charset produces non-UTF-8 JSON records
      Test case

      INSTALL PLUGIN server_audit SONAME 'server_audit2';
      SET GLOBAL server_audit_file_path= 'nu.log';
      SET GLOBAL server_audit_output_type= file;
      SET GLOBAL server_audit_logging= ON;
      --let $D= `SELECT @@datadir`
      --enable_query_log
       
      # (a) latin1 client: 0xE9 (e-acute) in the query text
      --exec printf "SET NAMES latin1; SELECT 'caf\351' AS NUQMARK;\n" | $MYSQL --binary-mode test > /dev/null 2>&1
      # (b) _binary literal with raw bytes 0xFF 0xFE
      --exec printf "SELECT _binary'\377\376' AS NUQMARK;\n" | $MYSQL --binary-mode test > /dev/null 2>&1
      

      20261016 08:27:07,ramesh-01.c.mariadb-engineering-qa.internal,root,localhost,4,25,QUERY,test,'SET GLOBAL server_audit_logging= ON',0
      20261016 08:27:07,ramesh-01.c.mariadb-engineering-qa.internal,root,localhost,4,26,QUERY,test,'SELECT @@datadir',0
      20261016 08:27:07,ramesh-01.c.mariadb-engineering-qa.internal,root,localhost,5,0,CONNECT,test,,0
      20261016 08:27:07,ramesh-01.c.mariadb-engineering-qa.internal,root,localhost,5,27,QUERY,test,'SET NAMES latin1',0
      20261016 08:27:07,ramesh-01.c.mariadb-engineering-qa.internal,root,localhost,5,28,QUERY,test,'SELECT \'caf�\' AS NUQMARK',0
      20261016 08:27:07,ramesh-01.c.mariadb-engineering-qa.internal,root,localhost,5,0,DISCONNECT,test,,0
      20261016 08:27:07,ramesh-01.c.mariadb-engineering-qa.internal,root,localhost,6,0,CONNECT,test,,0
      20261016 08:27:07,ramesh-01.c.mariadb-engineering-qa.internal,root,localhost,6,30,QUERY,test,'SELECT _binary\'��\' AS NUQMARK',0
      

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 0.5h
                0.5h

                Git Integration

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