Merge lp:~zorba-coders/zorba/bug-1092842 into lp:zorba

Proposed by Ghislain Fourny on 2012-12-21
Status: Merged
Approved by: Matthias Brantner on 2012-12-21
Approved revision: 11152
Merged at revision: 11156
Proposed branch: lp:~zorba-coders/zorba/bug-1092842
Merge into: lp:zorba
Diff against target: 80 lines (+32/-0)
6 files modified
src/store/naive/json_items.cpp (+4/-0)
test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_018.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_019.xml.res (+1/-0)
test/rbkt/Queries/zorba/collections/collection_001.xqdata (+2/-0)
test/rbkt/Queries/zorba/collections/edit/edit_collection_018.xq (+12/-0)
test/rbkt/Queries/zorba/collections/edit/edit_collection_019.xq (+12/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1092842
Reviewer Review Type Date Requested Status
Matthias Brantner 2012-12-21 Approve on 2012-12-21
Chris Hillery 2012-12-21 Approve on 2012-12-21
Review via email: mp+141049@code.launchpad.net

Commit message

"Fixing bug 1092842 (tree pointers of nested items in an object or array do not get swapped correctly upon dml:edit.)"

Description of the change

"Fixing bug 1092842 (tree pointers of nested items in an object or array do not get swapped correctly upon dml:edit.)"

To post a comment you must log in.
Zorba Build Bot (zorba-buildbot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Chris Hillery (ceejatec) wrote :

I'm not the right person to review this, but I'll vote Approve so I don't hold up the merge proposal. I trust Matthias' review of the actual change.

review: Approve
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-1092842-2012-12-21T10-12-59.724Z is finished. The final status was:

All tests succeeded!

Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 1 Approve, 1 Pending.

review: Approve
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-1092842-2012-12-21T17-30-50.469Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/store/naive/json_items.cpp'
2--- src/store/naive/json_items.cpp 2012-12-14 13:11:51 +0000
3+++ src/store/naive/json_items.cpp 2012-12-21 10:11:20 +0000
4@@ -503,6 +503,8 @@
5 assert(lOther);
6 std::swap(theKeys, lOther->theKeys);
7 std::swap(thePairs, lOther->thePairs);
8+ setTree(getTree());
9+ lOther->setTree(lOther->getTree());
10 }
11
12 /******************************************************************************
13@@ -934,6 +936,8 @@
14 SimpleJSONArray* lOther = dynamic_cast<SimpleJSONArray*>(anotherItem);
15 assert(lOther);
16 std::swap(theContent, lOther->theContent);
17+ setTree(getTree());
18+ lOther->setTree(lOther->getTree());
19 }
20
21 /******************************************************************************
22
23=== added file 'test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_018.xml.res'
24--- test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_018.xml.res 1970-01-01 00:00:00 +0000
25+++ test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_018.xml.res 2012-12-21 10:11:20 +0000
26@@ -0,0 +1,1 @@
27+{ "bar" : "foo", "foo" : [ { "foo" : "bar" } ] }
28
29=== added file 'test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_019.xml.res'
30--- test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_019.xml.res 1970-01-01 00:00:00 +0000
31+++ test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_019.xml.res 2012-12-21 10:11:20 +0000
32@@ -0,0 +1,1 @@
33+[ 1, 2, 3, [ { "foo" : "bar" } ] ]
34
35=== modified file 'test/rbkt/Queries/zorba/collections/collection_001.xqdata'
36--- test/rbkt/Queries/zorba/collections/collection_001.xqdata 2012-12-11 14:47:49 +0000
37+++ test/rbkt/Queries/zorba/collections/collection_001.xqdata 2012-12-21 10:11:20 +0000
38@@ -8,6 +8,8 @@
39
40 declare collection ns:collection-objects as object()*;
41
42+declare collection ns:collection-arrays as array()*;
43+
44 declare %ann:ordered collection ns:collection2;
45
46 declare %ann:const collection ns:collection_const as node()*;
47
48=== added file 'test/rbkt/Queries/zorba/collections/edit/edit_collection_018.xq'
49--- test/rbkt/Queries/zorba/collections/edit/edit_collection_018.xq 1970-01-01 00:00:00 +0000
50+++ test/rbkt/Queries/zorba/collections/edit/edit_collection_018.xq 2012-12-21 10:11:20 +0000
51@@ -0,0 +1,12 @@
52+import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl";
53+import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml";
54+
55+import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata";
56+
57+ddl:create(xs:QName("ns:collection-objects"));
58+
59+dml:insert(xs:QName("ns:collection-objects"), { "foo" : "bar", "bar" : [ 1, 2, 3, { "foo" : "bar" } ] });
60+
61+dml:edit(dml:collection(xs:QName("ns:collection-objects")), { "bar" : "foo", "foo" : [ { "foo" : "bar" } ] });
62+
63+dml:collection(xs:QName("ns:collection-objects"))
64
65=== added file 'test/rbkt/Queries/zorba/collections/edit/edit_collection_019.xq'
66--- test/rbkt/Queries/zorba/collections/edit/edit_collection_019.xq 1970-01-01 00:00:00 +0000
67+++ test/rbkt/Queries/zorba/collections/edit/edit_collection_019.xq 2012-12-21 10:11:20 +0000
68@@ -0,0 +1,12 @@
69+import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl";
70+import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml";
71+
72+import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata";
73+
74+ddl:create(xs:QName("ns:collection-arrays"));
75+
76+dml:insert(xs:QName("ns:collection-arrays"), [ { "foo" : "bar" }, 1, 2, 3 ]);
77+
78+dml:edit(dml:collection(xs:QName("ns:collection-arrays")), [ 1, 2, 3, [ { "foo" : "bar" } ] ]);
79+
80+dml:collection(xs:QName("ns:collection-arrays"))

Subscribers

People subscribed via source and target branches