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

JSON_UNQUOTE re-encodes each byte of a VARBINARY document as latin1; JSON_VALUE does not

    XMLWordPrintable

Details

    Description

      Reproduced on 10.11.19 (debug build):

      CREATE TABLE t (b VARBINARY(20));
      INSERT INTO t VALUES ('"ö"');            -- the bytes 22 C3 B6 22
       
      SELECT HEX(JSON_UNQUOTE(b)), HEX(JSON_VALUE(b, '$')) FROM t;
      -- C383C2B6   C3B6

      JSON_UNQUOTE turns the single character ö (C3 B6) into ö (C3 83 C2 B6): every byte of the binary document is re-encoded as if it were latin1. JSON_VALUE on the same value returns the correct bytes. Expected: both return C3B6.

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              chunlingqin chunlingqin
              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.