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: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
    • 10.4, 10.5, 10.6
    • JSON
    • 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

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