Bug #87055 Unnecessary cloning of JSON paths
Submitted: 13 Jul 2017 8:15 Modified: 9 Aug 2017 14:06
Reporter: Knut Anders Hatlen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: JSON Severity:S3 (Non-critical)
Version:8.0.3 OS:Any
Assigned to: CPU Architecture:Any

[13 Jul 2017 8:15] Knut Anders Hatlen
Description:
Many of the JSON functions that manipulate JSON values unnecessarily create clones of their JSON path arguments. They create clones so that they can modify the paths without corrupting the cache of paths (they maintain a path cache because the path arguments are usually constant, and they want to avoid the cost of re-parsing the path arguments for each row).

The modification of the path argument is usually popping of the last path leg in order to search for the parent of the value being modified. It would be better if Json_wrapper::seek() took an argument that told it to not use the last path leg, so that the path object did not have to be modified. In that case, it wouldn't be necessary to clone the path object to prevent modifications on the original object.

How to repeat:
N/A
[9 Aug 2017 14:06] Jon Stephens
Fixed in MySQL 8.0.3. Code changes only--no changes to document for end users. Closed.