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

JSON_OBJECTAGG doesn't escape double quote in key

Details

    Description

      MariaDB [(none)]> SELECT JSON_OBJECT('"', 1), JSON_OBJECTAGG('"', 1);
      +---------------------+------------------------+
      | JSON_OBJECT('"', 1) | JSON_OBJECTAGG('"', 1) |
      +---------------------+------------------------+
      | {"\"": 1}           | {""":1}                |
      +---------------------+------------------------+
      1 row in set (0.000 sec)
      
      

      works correctly in MySQL 5.6

      Attachments

        Issue Links

          Activity

            Weijun Huang Weijun Huang added a comment - - edited

            This bug also happens in MasOS.

            MariaDB Version 10.5.16-MariaDB-debug
             - SSL connections supported
             - binaries are debug compiled
             - binaries built with wsrep patch
            Collecting tests...
            Installing system database...
             
            ==============================================================================
             
            TEST                                      RESULT   TIME (ms) or COMMENT
            --------------------------------------------------------------------------
             
            worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
            SELECT JSON_OBJECT('"', 1), JSON_OBJECTAGG('"', 1);
            JSON_OBJECT('"', 1)     JSON_OBJECTAGG('"', 1)
            {"\"": 1}       {""":1}
            main.json_test                           [ pass ]       
            --------------------------------------------------------------------------
            The servers were restarted 0 times
            Spent 0.000 of 7 seconds executing testcases
             
            Completed: All 1 tests were successful.
            

            Weijun Huang Weijun Huang added a comment - - edited This bug also happens in MasOS. MariaDB Version 10.5 . 16 -MariaDB-debug - SSL connections supported - binaries are debug compiled - binaries built with wsrep patch Collecting tests... Installing system database...   ==============================================================================   TEST RESULT TIME (ms) or COMMENT --------------------------------------------------------------------------   worker[ 1 ] Using MTR_BUILD_THREAD 300 , with reserved ports 16000 .. 16019 SELECT JSON_OBJECT( '"' , 1 ), JSON_OBJECTAGG( '"' , 1 ); JSON_OBJECT( '"' , 1 ) JSON_OBJECTAGG( '"' , 1 ) { "\"" : 1 } { "" ": 1 } main.json_test [ pass ] -------------------------------------------------------------------------- The servers were restarted 0 times Spent 0.000 of 7 seconds executing testcases   Completed: All 1 tests were successful.
            danblack Daniel Black added a comment -

            Thanks to Weijun / Alex Huang

            danblack Daniel Black added a comment - Thanks to Weijun / Alex Huang

            People

              danblack Daniel Black
              libertyit Rogers
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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