Implement circular JSON object renaming

Bug #1210093 reported by Ghislain Fourny
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
Medium
Markos Zaharioudakis

Bug Description

Because of snapshot semantics, in JSONiq it is perfectly fine to do things like:

variable $object := { "foo" : 1, "bar" : 2 };
(rename $object.foo as "bar", rename $object.bar as "foo");

However, Zorba does not support chained renames.

Even though updates are unordered, Zorba (like some other implementations) applies the update primitives in a special, precise order that guarantees that the result cannot be distinguished from the application of all updates at the same time against the same snapshot.

This works for most updates, but chained renames are an exception and need to be handled separately.

Possible strategy:
- Change the internal API of JSONObject::rename() to accept a vector of (old name, new name) pairs instead of just a single pair. This function then looks for the chains in the vector and applies one rename chain after the other. A temporary, unused name might be needed to roll-over through the entire chain in case the chain is a cycle.

Changed in zorba:
importance: Undecided → Medium
description: updated
description: updated
Changed in zorba:
assignee: nobody → Markos Zaharioudakis (markos-za)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.