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

JSON_OBJECT() treats hybrid functions with boolean arguments as numbers

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.3, 10.4
    • Fix Version/s: 10.4.0
    • Component/s: Data types, JSON
    • Labels:
      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

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: