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

CREATE TABLE .. AS SELECT JSON_OBJECT truncates data

    XMLWordPrintable

Details

    Description

      MariaDB [test]> CREATE TABLE t AS SELECT JSON_OBJECT('id', 87, 'name', 'carrot') AS f;
      Query OK, 1 row affected, 1 warning (0.48 sec)
      Records: 1  Duplicates: 0  Warnings: 1
       
      MariaDB [test]> SHOW WARNINGS;
      +---------+------+----------------------------------------+
      | Level   | Code | Message                                |
      +---------+------+----------------------------------------+
      | Warning | 1265 | Data truncated for column 'f' at row 1 |
      +---------+------+----------------------------------------+
      1 row in set (0.00 sec)
      

      MariaDB [test]> SHOW CREATE TABLE t\G
      *************************** 1. row ***************************
             Table: t
      Create Table: CREATE TABLE `t` (
        `f` varchar(26) CHARACTER SET utf8 NOT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1
      1 row in set (0.00 sec)
       
      MariaDB [test]> SELECT * FROM t;
      +----------------------------+
      | f                          |
      +----------------------------+
      | {"id": 87, "name": "carrot |
      +----------------------------+
      1 row in set (0.00 sec)
      

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.