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

JSON_OBJECT('name',zerofill_numeric_column) returns an invalid JSON

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.6, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5(EOL), 10.7(EOL), 10.8(EOL)
    • N/A
    • JSON
    • None
    • Not for Release Notes

    Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a INT ZEROFILL);
      INSERT INTO t1 VALUES (1);
      SELECT JSON_OBJECT('a',a), JSON_VALID(JSON_OBJECT('a',a)) FROM t1;
      

      +--------------------+--------------------------------+
      | JSON_OBJECT('a',a) | JSON_VALID(JSON_OBJECT('a',a)) |
      +--------------------+--------------------------------+
      | {"a": 0000000001}  |                              0 |
      +--------------------+--------------------------------+
      

      Notice, the constructed JSON value is wrong. The 0000000001 literal should probably be quoted.

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.