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

Proposed by Matthias Brantner
Status: Merged
Approved by: Matthias Brantner
Approved revision: 10754
Merged at revision: 10762
Proposed branch: lp:~zorba-coders/zorba/bug-867253
Merge into: lp:zorba
Diff against target: 182 lines (+49/-27)
7 files modified
ChangeLog (+1/-0)
include/zorba/pregenerated/diagnostic_list.h (+6/-4)
modules/com/zorba-xquery/www/modules/pregenerated/errors.xq (+12/-8)
src/diagnostics/diagnostic_en.xml (+11/-8)
src/diagnostics/pregenerated/diagnostic_list.cpp (+9/-6)
src/diagnostics/pregenerated/dict_en.cpp (+1/-0)
src/runtime/collections/collections_impl.cpp (+9/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-867253
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
David Graf (community) Approve
Review via email: mp+101693@code.launchpad.net

Commit message

fix for bug #867253 (cdml:delete-nodes should only remove root nodes)

Description of the change

fix for bug #867253 (cdml:delete-nodes should only remove root nodes)

To post a comment you must log in.
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 bug-867253-2012-04-12T07-56-58.111Z 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: 2 Pending.

Revision history for this message
David Graf (davidagraf) wrote :

Reviewed the code and tests an example. Looks good!

review: Approve
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 bug-867253-2012-04-14T05-36-59.424Z 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 'ChangeLog'
2--- ChangeLog 2012-04-10 15:41:57 +0000
3+++ ChangeLog 2012-04-12 07:56:20 +0000
4@@ -13,6 +13,7 @@
5 * Fixed bug #967864 (var substitution did not update theFreeVars property)
6 * Fixed bug in window iterator (binding the end vars in the output tuple stream)
7 * Fixed bug #866547 (protect index-join rule from general flwor)
8+ * Fixed bug #867253 (cdml:delete-nodes should only remove root nodes)
9 * Fixed bug #967428 (do not hoist index creation outside a try-catch)
10 * Fixed performance problem with the findNodeSources function of the no-copy rule
11 * Fixed bug #872234 (prevent a rewritting to take place in case of sequential expr)
12
13=== modified file 'include/zorba/pregenerated/diagnostic_list.h'
14--- include/zorba/pregenerated/diagnostic_list.h 2012-03-28 05:19:57 +0000
15+++ include/zorba/pregenerated/diagnostic_list.h 2012-04-12 07:56:20 +0000
16@@ -606,16 +606,18 @@
17
18 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0030_INDEX_RANGE_GENERAL_PROBE_NOT_ALLOWED;
19
20-extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0034_INDEX_RANGE_VALUE_PROBE_BAD_KEY_TYPES;
21-
22-extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0035_INDEX_GENERAL_INSERT;
23-
24 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0031_IC_NOT_DECLARED;
25
26 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0032_IC_NOT_ACTIVATED;
27
28 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0033_IC_NOT_MET;
29
30+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0034_INDEX_RANGE_VALUE_PROBE_BAD_KEY_TYPES;
31+
32+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0035_INDEX_GENERAL_INSERT;
33+
34+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0036_NON_ROOT_NODE_DELETION;
35+
36 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDST0001_COLLECTION_ALREADY_DECLARED;
37
38 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDST0002_COLLECTION_ALREADY_IMPORTED;
39
40=== modified file 'modules/com/zorba-xquery/www/modules/pregenerated/errors.xq'
41--- modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2012-03-28 05:19:57 +0000
42+++ modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2012-04-12 07:56:20 +0000
43@@ -513,14 +513,6 @@
44
45 (:~
46 :)
47-declare variable $zerr:ZDDY0034 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0034");
48-
49-(:~
50-:)
51-declare variable $zerr:ZDDY0035 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0035");
52-
53-(:~
54-:)
55 declare variable $zerr:ZDDY0031 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0031");
56
57 (:~
58@@ -533,6 +525,18 @@
59
60 (:~
61 :)
62+declare variable $zerr:ZDDY0034 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0034");
63+
64+(:~
65+:)
66+declare variable $zerr:ZDDY0035 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0035");
67+
68+(:~
69+:)
70+declare variable $zerr:ZDDY0036 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0036");
71+
72+(:~
73+:)
74 declare variable $zerr:ZDST0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZDST0001");
75
76 (:~
77
78=== modified file 'src/diagnostics/diagnostic_en.xml'
79--- src/diagnostics/diagnostic_en.xml 2012-03-28 05:19:57 +0000
80+++ src/diagnostics/diagnostic_en.xml 2012-04-12 07:56:20 +0000
81@@ -2069,14 +2069,6 @@
82 <value>"$1": index range-general probe not allowed</value>
83 </diagnostic>
84
85- <diagnostic code="ZDDY0034" name="INDEX_RANGE_VALUE_PROBE_BAD_KEY_TYPES">
86- <value>"$1": index range-value probe has search keys with incompatible types</value>
87- </diagnostic>
88-
89- <diagnostic code="ZDDY0035" name="INDEX_GENERAL_INSERT">
90- <value>"$1": index inserting more than one key not allowed for general index</value>
91- </diagnostic>
92-
93 <diagnostic code="ZDDY0031" name="IC_NOT_DECLARED">
94 <value>"$1": integrity constraint is not declared</value>
95 </diagnostic>
96@@ -2089,6 +2081,17 @@
97 <value>"$1": integrity constraint not met for collection "$2"</value>
98 </diagnostic>
99
100+ <diagnostic code="ZDDY0034" name="INDEX_RANGE_VALUE_PROBE_BAD_KEY_TYPES">
101+ <value>"$1": index range-value probe has search keys with incompatible types</value>
102+ </diagnostic>
103+
104+ <diagnostic code="ZDDY0035" name="INDEX_GENERAL_INSERT">
105+ <value>"$1": index inserting more than one key not allowed for general index</value>
106+ </diagnostic>
107+
108+ <diagnostic code="ZDDY0036" name="NON_ROOT_NODE_DELETION">
109+ <value>attempt to delete non-root node from collection "$1"</value>
110+ </diagnostic>
111
112 <diagnostic code="ZDST0001" name="COLLECTION_ALREADY_DECLARED">
113 <value>"$1": collection already declared</value>
114
115=== modified file 'src/diagnostics/pregenerated/diagnostic_list.cpp'
116--- src/diagnostics/pregenerated/diagnostic_list.cpp 2012-03-28 05:19:57 +0000
117+++ src/diagnostics/pregenerated/diagnostic_list.cpp 2012-04-12 07:56:20 +0000
118@@ -888,12 +888,6 @@
119 ZorbaErrorCode ZDDY0030_INDEX_RANGE_GENERAL_PROBE_NOT_ALLOWED( "ZDDY0030" );
120
121
122-ZorbaErrorCode ZDDY0034_INDEX_RANGE_VALUE_PROBE_BAD_KEY_TYPES( "ZDDY0034" );
123-
124-
125-ZorbaErrorCode ZDDY0035_INDEX_GENERAL_INSERT( "ZDDY0035" );
126-
127-
128 ZorbaErrorCode ZDDY0031_IC_NOT_DECLARED( "ZDDY0031" );
129
130
131@@ -903,6 +897,15 @@
132 ZorbaErrorCode ZDDY0033_IC_NOT_MET( "ZDDY0033" );
133
134
135+ZorbaErrorCode ZDDY0034_INDEX_RANGE_VALUE_PROBE_BAD_KEY_TYPES( "ZDDY0034" );
136+
137+
138+ZorbaErrorCode ZDDY0035_INDEX_GENERAL_INSERT( "ZDDY0035" );
139+
140+
141+ZorbaErrorCode ZDDY0036_NON_ROOT_NODE_DELETION( "ZDDY0036" );
142+
143+
144 ZorbaErrorCode ZDST0001_COLLECTION_ALREADY_DECLARED( "ZDST0001" );
145
146
147
148=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
149--- src/diagnostics/pregenerated/dict_en.cpp 2012-03-28 05:19:57 +0000
150+++ src/diagnostics/pregenerated/dict_en.cpp 2012-04-12 07:56:20 +0000
151@@ -301,6 +301,7 @@
152 { "ZDDY0033", "\"$1\": integrity constraint not met for collection \"$2\"" },
153 { "ZDDY0034", "\"$1\": index range-value probe has search keys with incompatible types" },
154 { "ZDDY0035", "\"$1\": index inserting more than one key not allowed for general index" },
155+ { "ZDDY0036", "attempt to delete non-root node from collection \"$1\"" },
156 { "ZDST0001", "\"$1\": collection already declared" },
157 { "ZDST0002", "\"$1\": collection already imported into module \"$2\"" },
158 { "ZDST0003", "\"$1\": collection declaration not allowed in main module" },
159
160=== modified file 'src/runtime/collections/collections_impl.cpp'
161--- src/runtime/collections/collections_impl.cpp 2012-04-08 21:39:25 +0000
162+++ src/runtime/collections/collections_impl.cpp 2012-04-12 07:56:20 +0000
163@@ -1520,10 +1520,18 @@
164
165 while (consumeNext(node, theChildren[theChildren.size()-1].getp(), planState))
166 {
167- if (! node->getCollection())
168+ if (! node->getCollection())
169 {
170 throw XQUERY_EXCEPTION( zerr::ZDDY0017_NODE_IS_ORPHAN, ERROR_LOC( loc ) );
171 }
172+ if (node->getParent())
173+ {
174+ throw XQUERY_EXCEPTION(
175+ zerr::ZDDY0036_NON_ROOT_NODE_DELETION,
176+ ERROR_PARAMS(node->getCollection()->getName()->getStringValue()),
177+ ERROR_LOC( loc )
178+ );
179+ }
180 if (collection && collection != node->getCollection())
181 {
182 throw XQUERY_EXCEPTION(

Subscribers

People subscribed via source and target branches