Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.4(EOL)
-
None
Description
Json_writer code allows one to write multiple members with the same name in a JSON object.
This is likely to prevent proper processing of the created document.
The most striking example is EXPLAIN FORMAT=JSON:
{
|
"query_block": {
|
"select_id": 1,
|
"table": {
|
"table_name": "table",
|
...
|
},
|
"table": {
|
...
|
The solution has two parts:
Part #1: Follow the MDEV-23766 approach and make debug build generate assertion failures.
Part #2: Fix EXPLAIN FORMAT=JSON code to not produce such invalid (or valid but not processable) JSON output.
As for which version to fix this in: The problem with EXPLAIN FORMAT=JSON output is present from the very early versions (10.1). However, the fix will cause a lot of changes in EXPLAIN FORMAT=JSON output (the changes will be dummy but they will be there). This may not be desirable for older versions. Because of that, for now I'm setting fixVersion to 10.8.
A question to be resolved: how to modify EXPLAIN/ANALYZE to make them well-formed JSON? Should we wrap them into an array, like MySQL does or do something else?)
Attachments
Issue Links
- causes
-
MDEV-27204 [ERROR] Json_writer: a member name was expected, Assertion `got_name == named_item_expected()' failed
- Closed
-
MDEV-27206 [ERROR] Duplicated key: cause, Assertion `is_uniq_key' failed with optimizer trace
- Closed
- relates to
-
MDEV-23766 Optimizer tracing code is prone to producing invalid JSON
- Closed