Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Duplicate
-
12.3.3
-
None
-
MariaDB 12.3.3 binary distribution on Linux x86_64
-
Not for Release Notes
Description
Comparing a JSON string converted from cp1251 with utf8mb4 literals fails with ER_OUTOFMEMORY, although JSON_UNQUOTE decodes the same value successfully.
This occurs when a JSON_EXTRACT result from a cp1251 JSON string is compared with utf8mb4 text.
Run the control first:
SET NAMES utf8mb4; |
SELECT JSON_UNQUOTE(CONVERT('"Ф"' USING cp1251)) = 'Ф' AS control_eq; |
It returns:
control_eq
|
1
|
Then run each of these statements separately:
SET NAMES utf8mb4; |
SELECT JSON_EXTRACT(CONVERT('"Ф"' USING cp1251), '$') = 'Ф' AS candidate_eq; |
SET NAMES utf8mb4; |
SELECT JSON_EXTRACT(CONVERT('"Ф"' USING cp1251), '$') <=> 'Ф' AS candidate_null_safe_eq; |
SET NAMES utf8mb4; |
SELECT JSON_EXTRACT(CONVERT('"Ф"' USING cp1251), '$') < 'Х' AS candidate_lt; |
Each comparison produces the same error:
ERROR 1037 (HY001): Out of memory; restart server and try again (needed 1 bytes)
|
The cp1251 JSON character Ф is decoded successfully by the control. The ordinary equality and null-safe equality comparisons should therefore return 1, and the ordering comparison Ф < Х should also return 1, without an allocation error.
Attachments
Issue Links
- duplicates
-
MDEV-39670 SQL OOM triggered by JSON comparision where escaping expands string was: by JSON_EXTRACT
-
- Open
-