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

Incorrect result of JSON_TABLE with BIT

    XMLWordPrintable

Details

    • Unexpected results
    • Fixed JSON_TABLE so JSON numbers loaded into BIT columns keep their correct values.

    Description

      Hi,

      I found that JSON_TABLE can return incorrect results with the BIT type. This is an example:

      SELECT ord, i, b+0, HEX(b) 
      FROM JSON_TABLE(
             '[0,1]',
             '$[*]' COLUMNS (
               ord FOR ORDINALITY,
               i INT PATH '$',
               b BIT(1) PATH '$'
             )
           ) AS jt
      ORDER BY ord;
      -- 1	  0	1    1
      -- 2	  1	1    1
      

      For the first row of the results, I expect it should be 1 0 0 0, as the first row of the table is 0.

      Attachments

        Activity

          People

            raghunandan.bhat Raghunandan Bhat
            ChiZhang Chi Zhang
            Raghunandan Bhat Raghunandan Bhat
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0d
                0d
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 4h 10m
                4h 10m

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.