Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
13.1
-
None
-
Not for Release Notes
Description
Hi,
I found that there will be redundant NULL checks in the column when creating a table with SELECT from JSON_QUOTE or JSON_DEPTH. There is an example:
CREATE TABLE src_quote (fld VARCHAR(16) NOT NULL); |
CREATE TABLE dst_quote AS SELECT JSON_QUOTE(1) AS q FROM src_quote; |
SHOW CREATE TABLE dst_quote; |
-- dst_quote CREATE TABLE `dst_quote` (
|
-- `q` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
|
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
|
 |
CREATE TABLE src_depth (fld VARCHAR(16) NOT NULL); |
CREATE TABLE dst_depth AS |
SELECT JSON_DEPTH(fld) AS d |
FROM src_depth; |
SHOW CREATE TABLE dst_depth; |
-- dst_depth CREATE TABLE `dst_depth` (
|
-- `d` int(10) NOT NULL
|
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |