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

JSON_QUOTE() and MEMBER OF mishandle ZEROFILL numeric columns

    XMLWordPrintable

Details

    • Bug
    • Status: Approved (View Workflow)
    • Major
    • Resolution: Unresolved
    • N/A
    • 13.2
    • JSON
    • None

    Description

      JSON_QUOTE() on a ZEROFILL numeric argument returns the zero-padded display text, 00001. That isn't a valid JSON number. And then MEMBER OF returns incorrect result.

      CREATE TABLE t (id INT(5) ZEROFILL);
      INSERT INTO t VALUES (1);
      SELECT id, JSON_QUOTE(id), id MEMBER OF ('[1]') FROM t;
       
      DROP TABLE t;
      

      SELECT id, JSON_QUOTE(id), id MEMBER OF ('[1]') FROM t;
      id	JSON_QUOTE(id)	id MEMBER OF ('[1]')
      00001	00001	0
      

      Also it makes sense to push dbba2542d432d38 as a bug fix in earlier version
      JarirBob FYI

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              alice Alice Sherepa
              Daniel Black Daniel Black
              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.