[MDEV-16814] CREATE TABLE SELECT JSON_QUOTE(multibyte_charset_expr) makes a field of a wrong length Created: 2018-07-24  Updated: 2018-07-24  Resolved: 2018-07-24

Status: Closed
Project: MariaDB Server
Component/s: JSON
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: 10.2.17, 10.3.9, 10.4.0

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed

 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.


Generated at Thu Feb 08 08:31:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.