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

JSON_TABLE: Values for regular columns are truncated for no reason

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: N/A
    • Fix Version/s: N/A
    • Component/s: JSON
    • Labels:
      None

      Description

      The column is of sufficient length, there should be no truncation.

      bb-10.5-hf 6dfb3fab2

      +------+
      | a    |
      +------+
      | fo   |
      +------+
      1 row in set (0.002 sec)
      

      MySQL 8.0.19

      MySQL [test]> select * from json_table('{"a":"foo"}',"$" columns(a varchar(8) path '$.a')) x;
      +------+
      | a    |
      +------+
      | foo  |
      +------+
      1 row in set (0.001 sec)
      

      It works in MariaDB, too, with slightly longer column:

      MariaDB [test]> select * from json_table('{"a":"foo"}',"$" columns(a varchar(12) path '$.a')) x;
      +------+
      | a    |
      +------+
      | foo  |
      +------+
      1 row in set (0.002 sec)
      

      set names doesn't seem to change the outcome, tried latin1, utf8, utf8mb4.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              holyfoot Alexey Botchkov
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: