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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.2(EOL), 10.3(EOL), 10.4(EOL)
    • 10.2.17, 10.3.9, 10.4.0
    • JSON
    • 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

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.