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
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue blocks |
Description |
second this issue, 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 |
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* |
Summary | JSON_VALIDS and any JSON function doesnt work correctly where is a double quote char inside a value ina complex json array | JSON_VALID and any JSON function doesnt work correctly where is a double quote char inside a value ina complex json array |
Summary | JSON_VALID and any JSON function doesnt work correctly where is a double quote char inside a value ina complex json array | JSON_VALID and any JSON function doesnt work correctly where is a double quote char inside a value in a complex json array |
Summary | JSON_VALID and any JSON function doesnt work correctly where is a double quote char inside a value in a complex json array | JSON_VALID and any JSON function doesnt work correctly whe there is a double-quote char (escaped) inside a value in a complex json array (more tha 2 elements) |
Priority | Major [ 3 ] | Trivial [ 5 ] |
Fix Version/s | N/A [ 14700 ] | |
Resolution | Not a Bug [ 6 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Link |
This issue blocks |
Workflow | MariaDB v3 [ 98990 ] | MariaDB v4 [ 156637 ] |
Sorry found there a mistake in my sql senteces. This bug can be closed safely