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

JSON_OBJECT() treats hybrid functions with boolean arguments as numbers

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3(EOL), 10.4(EOL)
    • 10.4.0
    • Data types, JSON
    • None

    Description

      SELECT
        JSON_OBJECT("cond", true) AS j1,
        JSON_OBJECT("cond", COALESCE(true, false)) j2;
      

      +----------------+-------------+
      | j1             | j2          |
      +----------------+-------------+
      | {"cond": true} | {"cond": 1} |
      +----------------+-------------+
      

      j2 looks wrong. It should print the value as true, similar to how j1 does.

      Attachments

        Issue Links

          Activity

            People

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