Details
-
Bug
-
Status: Closed (View Workflow)
-
Trivial
-
Resolution: Not a Bug
-
10.3.17, 10.4.7
-
Windows 10 64 bit
Description
Still 10.3.17. any JSON function will return NULL when there is a quoted char in a complex JSON array. Witth a Json single element array there is no problem:
Tests:
Phrase: Venture "Extended" Edition
- SELECT JSON_QUOTE('Venture "Extended" Edition');
Returns: "Venture \"Extended\" Edition" - SELECT CONCAT('[
{"Year":1999,"Make":"Chevy","Model":', JSON_QUOTE('Venture \"Extended\" Edition'),'}
]') INTO @_json;
SELECT JSON_VALID(@_json), JSON_LENGTH(@_json);
Returns 1 and 1 (for a single element there is no problem) - SELECT '[
{"Year":1997,"Make":"Ford","Model":"E350","Description":"ac, abs, moon","Price":3000,"UpForSale":"2017-10-01"}
,
{"Year":1999,"Make":"Chevy","Model":"Venture Extended Edition","Description":null,"Price":4900,"UpForSale":"2017-10-03T12:15"}
]' INTO @_json;
SELECT JSON_VALID(@_json), JSON_LENGTH(@_json);
Returns 1 and 2 - SELECT '[
{"Year":1997,"Make":"Ford","Model":"E350","Description":"ac, abs, moon","Price":3000,"UpForSale":"2017-10-01"}
,
{"Year":1999,"Make":"Chevy","Model":"Venture \"Extended\" Edition","Description":null,"Price":4900,"UpForSale":"2017-10-03T12:15"}
]' INTO @_json;
SELECT JSON_VALID(@_json), JSON_LENGTH(@_json);
Returns 0 and null - SELECT CONCAT('[
{"Year":1997,"Make":"Ford","Model":"E350","Description":"ac, abs, moon","Price":3000,"UpForSale":"2017-10-01"}
,',
{"Year":1999,"Make":"Chevy","Model":', JSON_QUOTE('Venture \"Extended\" Edition'),'"Description":null,"Price":4900,"UpForSale":"2017-10-03T12:15"}
']') INTO @_json;
SELECT JSON_VALID(@_json), JSON_LENGTH(@_json);
Returns 0 and null