[MDEV-27036] Json_writer allows one to create duplicate object members Created: 2021-11-12 Updated: 2021-12-20 Resolved: 2021-11-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.4 |
| Fix Version/s: | 10.8.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Krivonos (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||
| Epic Link: | Tracer JSON consistency | ||||||||||||||||||||
| 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:
The solution has two parts: Part #1: Follow the 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?) |
| Comments |
| Comment by Sergei Krivonos (Inactive) [ 2021-11-12 ] | ||||||||||
|
https://buildbot.mariadb.org/#/grid?branch=bb-10.4-MDEV-27036 | ||||||||||
| Comment by Sergei Petrunia [ 2021-11-14 ] | ||||||||||
|
MySQL 8's EXPLAIN FORMAT=JSON looks like this:
| ||||||||||
| Comment by Sergei Petrunia [ 2021-11-14 ] | ||||||||||
|
sergei.krivonos, the patch looks like a move in the right direction. Some things that don't look right:
| ||||||||||
| Comment by Sergei Petrunia [ 2021-11-16 ] | ||||||||||
|
More review input: https://lists.launchpad.net/maria-developers/msg12988.html | ||||||||||
| Comment by Sergei Krivonos (Inactive) [ 2021-11-18 ] | ||||||||||
|
https://buildbot.mariadb.org/#/grid?branch=bb-10.8-MDEV-27036 | ||||||||||
| Comment by Sergei Krivonos (Inactive) [ 2021-11-19 ] | ||||||||||
|
10.4: | ||||||||||
| Comment by Sergei Krivonos (Inactive) [ 2021-11-22 ] | ||||||||||
|
tests to fix in bb-10.8- | ||||||||||
| Comment by Sergei Krivonos (Inactive) [ 2021-11-23 ] | ||||||||||
|
https://buildbot.mariadb.org/#/grid?branch=bb-10.8-MDEV-27036 | ||||||||||
| Comment by Marko Mäkelä [ 2021-11-24 ] | ||||||||||
|
Is there a 10.5 version of this? The 10.4 version that was already pushed causes a merge conflict in 10.5 for some constructor parameters. | ||||||||||
| Comment by Sergei Krivonos (Inactive) [ 2021-11-24 ] | ||||||||||
|
marko, | ||||||||||
| Comment by Sergei Petrunia [ 2021-11-26 ] | ||||||||||
|
Ok to push the latest contents of bb-10.8- |