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

CREATE TABLE SELECT JSON_QUOTE(multibyte_charset_expr) makes a field of a wrong length

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.2, 10.3, 10.4
    • Fix Version/s: 10.2.17, 10.3.9, 10.4.0
    • Component/s: JSON
    • Labels:
      None

      Description

      CREATE OR REPLACE TABLE t1 AS SELECT
        JSON_QUOTE(_latin1'foo') AS c1,
        JSON_QUOTE(_utf8'foo') AS c2;
      SHOW CREATE TABLE t1;
      

      +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                                                                                                                    |
      +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `c1` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
        `c2` varchar(28) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      

      Notice, lengths for c1 and c2 are different. This is wrong.

        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: