Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
13.1
-
None
-
Not for Release Notes
Description
Hi,
In the following test case, the second row of the table t_arr has two json: '[1,2]' and '[2]', which should has intersection, however, JSON_ARRAY_INTERSECT returns NULL on this row.
CREATE TABLE t_arr ( |
id INT PRIMARY KEY, |
a LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin CHECK (JSON_VALID(a)), |
b LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin CHECK (JSON_VALID(b)) |
);
|
|
|
INSERT INTO t_arr VALUES |
(1, '[1,2]', '[9]'), |
(2, '[1,2]', '[2]'); |
|
|
SELECT id, JSON_ARRAY_INTERSECT(a, b) AS actual FROM t_arr ORDER BY id; |
-- 1 NULL
|
-- 2 NULL
|
|
|
SELECT JSON_ARRAY_INTERSECT('[1,2]', '[9]') AS expected_row1; -- NULL |
SELECT JSON_ARRAY_INTERSECT('[1,2]', '[2]') AS expected_row2; -- [2] |
Attachments
Issue Links
- duplicates
-
MDEV-36808 json_array_intersect incorrect results after returning NULL in table scan
-
- Closed
-