Merge lp:~zorba-coders/zorba/collection-insert-without-copy into lp:zorba

Proposed by Matthias Brantner
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 10829
Merged at revision: 10830
Proposed branch: lp:~zorba-coders/zorba/collection-insert-without-copy
Merge into: lp:zorba
Diff against target: 130 lines (+30/-2)
6 files modified
ChangeLog (+4/-0)
src/compiler/translator/translator.cpp (+1/-1)
src/runtime/base/plan_iterator.h (+2/-0)
src/runtime/collections/collections_base.h (+3/-0)
src/runtime/core/constructors.h (+12/-0)
src/store/naive/node_items.cpp (+8/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/collection-insert-without-copy
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Matthias Brantner Approve
Review via email: mp+105148@code.launchpad.net

This proposal supersedes a proposal from 2012-05-08.

Commit message

no node copying during insertion into collection if the nodes are freshly constructed nodes

Description of the change

no node copying during insertion into collection if the nodes are freshly constructed nodes

To post a comment you must log in.
Revision history for this message
Matthias Brantner (matthias-brantner) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Revision history for this message
Markos Zaharioudakis (markos-za) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

The attempt to merge lp:~zorba-coders/zorba/collection-insert-without-copy into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job
  collection-insert-without-copy-2012-05-08T22-02-17.793Z is finished. The
  final status was:

  546 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job collection-insert-without-copy-2012-05-08T23-35-58.8Z is finished. The final status was:

All tests succeeded!

Revision history for this message
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, 2 Pending.

Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job collection-insert-without-copy-2012-05-09T00-13-03.711Z 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
=== modified file 'ChangeLog'
--- ChangeLog 2012-05-07 23:43:04 +0000
+++ ChangeLog 2012-05-08 23:34:21 +0000
@@ -25,6 +25,10 @@
25 * Added XQJ support.25 * Added XQJ support.
26 * Added CollectionManager and DocumentManager support for XQJ.26 * Added CollectionManager and DocumentManager support for XQJ.
2727
28Optimizations:
29 * optimized insertion into a collection (don't copy it if the node was created by an element constructor
30 and is not used anywhere else in the query
31
28Bug Fixes/Other Changes:32Bug Fixes/Other Changes:
29 * Fixed bugs #931501 and #866987 (improved error messages for fn:format-number(). Additionally, the function now throws the FODF1310 error instead of XTDE1310, as the 3.0 spec requires)33 * Fixed bugs #931501 and #866987 (improved error messages for fn:format-number(). Additionally, the function now throws the FODF1310 error instead of XTDE1310, as the 3.0 spec requires)
30 * Fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest)34 * Fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest)
3135
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp 2012-05-05 02:39:12 +0000
+++ src/compiler/translator/translator.cpp 2012-05-08 23:34:21 +0000
@@ -2195,7 +2195,7 @@
2195{2195{
2196 TRACE_VISIT();2196 TRACE_VISIT();
21972197
2198 if (v.get_encoding().length() != 0 &&2198 if (v.get_encoding() != "utf-8" &&
2199 !utf8::match_whole(v.get_encoding(), "^[A-Za-z]([A-Za-z0-9._]|[-])*$"))2199 !utf8::match_whole(v.get_encoding(), "^[A-Za-z]([A-Za-z0-9._]|[-])*$"))
2200 RAISE_ERROR(err::XQST0087, loc, ERROR_PARAMS(v.get_encoding()));2200 RAISE_ERROR(err::XQST0087, loc, ERROR_PARAMS(v.get_encoding()));
22012201
22022202
=== modified file 'src/runtime/base/plan_iterator.h'
--- src/runtime/base/plan_iterator.h 2012-05-03 12:31:51 +0000
+++ src/runtime/base/plan_iterator.h 2012-05-08 23:34:21 +0000
@@ -346,6 +346,8 @@
346346
347 TypeManager* getTypeManager() const;347 TypeManager* getTypeManager() const;
348348
349 virtual bool isConstructor() const { return false; }
350
349 /**351 /**
350 * Accept method for the PlanIterator-Tree-Visitor352 * Accept method for the PlanIterator-Tree-Visitor
351 *353 *
352354
=== modified file 'src/runtime/collections/collections_base.h'
--- src/runtime/collections/collections_base.h 2012-05-03 12:31:51 +0000
+++ src/runtime/collections/collections_base.h 2012-05-08 23:34:21 +0000
@@ -128,6 +128,9 @@
128128
129 getCopyMode(lCopyMode, this->theSctx);129 getCopyMode(lCopyMode, this->theSctx);
130130
131 lCopyMode.theDoCopy = !
132 this->theChildren[this->theChildren.size()-1]->isConstructor();
133
131 while (this->consumeNext(node, this->theChildren[this->theChildren.size()-1].getp(), planState))134 while (this->consumeNext(node, this->theChildren[this->theChildren.size()-1].getp(), planState))
132 {135 {
133 checkNodeType(this->theSctx, node, collectionDecl, this->loc, theDynamicCollection);136 checkNodeType(this->theSctx, node, collectionDecl, this->loc, theDynamicCollection);
134137
=== modified file 'src/runtime/core/constructors.h'
--- src/runtime/core/constructors.h 2012-05-03 12:31:51 +0000
+++ src/runtime/core/constructors.h 2012-05-08 23:34:21 +0000
@@ -67,6 +67,8 @@
6767
68 bool copyInputNodes() const { return theCopyInputNodes; }68 bool copyInputNodes() const { return theCopyInputNodes; }
6969
70 bool isConstructor() const { return true; }
71
70 void accept(PlanIterVisitor& v) const;72 void accept(PlanIterVisitor& v) const;
7173
72 void openImpl(PlanState& planState, uint32_t& offset);74 void openImpl(PlanState& planState, uint32_t& offset);
@@ -141,6 +143,8 @@
141143
142 bool copyInputNodes() const { return theCopyInputNodes; }144 bool copyInputNodes() const { return theCopyInputNodes; }
143145
146 bool isConstructor() const { return true; }
147
144 uint32_t getStateSizeOfSubtree() const;148 uint32_t getStateSizeOfSubtree() const;
145 149
146 void accept(PlanIterVisitor&) const;150 void accept(PlanIterVisitor&) const;
@@ -193,6 +197,8 @@
193197
194 store::Item* getQName() const { return theQName.getp(); }198 store::Item* getQName() const { return theQName.getp(); }
195199
200 bool isConstructor() const { return true; }
201
196 void accept(PlanIterVisitor& v) const;202 void accept(PlanIterVisitor& v) const;
197203
198 bool nextImpl(store::Item_t& result, PlanState& planState) const;204 bool nextImpl(store::Item_t& result, PlanState& planState) const;
@@ -234,6 +240,8 @@
234 PlanIter_t& aChild,240 PlanIter_t& aChild,
235 bool isRoot);241 bool isRoot);
236242
243 bool isConstructor() const { return true; }
244
237 void accept(PlanIterVisitor& v) const;245 void accept(PlanIterVisitor& v) const;
238246
239 bool nextImpl(store::Item_t& result, PlanState& planState) const;247 bool nextImpl(store::Item_t& result, PlanState& planState) const;
@@ -275,6 +283,8 @@
275 PlanIter_t& aComment,283 PlanIter_t& aComment,
276 bool isRoot);284 bool isRoot);
277285
286 bool isConstructor() const { return true; }
287
278 void accept(PlanIterVisitor& v) const;288 void accept(PlanIterVisitor& v) const;
279289
280 bool nextImpl(store::Item_t& result, PlanState& planState) const;290 bool nextImpl(store::Item_t& result, PlanState& planState) const;
@@ -314,6 +324,8 @@
314 PlanIter_t& aContent,324 PlanIter_t& aContent,
315 bool isRoot);325 bool isRoot);
316326
327 bool isConstructor() const { return true; }
328
317 void accept(PlanIterVisitor& v) const;329 void accept(PlanIterVisitor& v) const;
318330
319 bool nextImpl(store::Item_t& result, PlanState& planState) const;331 bool nextImpl(store::Item_t& result, PlanState& planState) const;
320332
=== modified file 'src/store/naive/node_items.cpp'
--- src/store/naive/node_items.cpp 2012-05-03 12:31:51 +0000
+++ src/store/naive/node_items.cpp 2012-05-08 23:34:21 +0000
@@ -615,7 +615,14 @@
615 }615 }
616 } // have parent616 } // have parent
617617
618 return copyInternal(parent, parent, pos, NULL, copymode);618 if (copymode.theDoCopy)
619 {
620 return copyInternal(parent, parent, pos, NULL, copymode);
621 }
622 else
623 {
624 return const_cast<XmlNode*>(this);
625 }
619}626}
620627
621628

Subscribers

People subscribed via source and target branches