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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
    • Fix Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
    • Component/s: JSON
    • Labels:
      None

      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

          Activity

            People

            Assignee:
            bar Alexander Barkov
            Reporter:
            bar Alexander Barkov
            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.