Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6.0
-
None
Description
Let's make an intentional mistake and feed JSON_TABLE an invalid JSON:
MariaDB [test]> set @json='
|
'> [
|
'> {"name":"Laptop", "color":"black", price:null},
|
'> {"name":"Jeans", "color":"blue", price:""}
|
'> ]';
|
Query OK, 0 rows affected (0.000 sec)
|
Then let's try reading
MariaDB [test]> select * from json_table(@json, '$[*]'
|
-> columns(
|
-> name varchar(10) path '$.name',
|
-> color varchar(10) path '$.color',
|
-> price varchar(10) path '$.price' error on empty )
|
-> ) as jt;
|
ERROR 4176 (HY000): Field 'price' can't be set for JSON_TABLE 'jt'.
|
The error text doesn't indicate that the passed JSON was invalid.