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

Proposed by Federico Cavalieri
Status: Superseded
Proposed branch: lp:~zorba-coders/zorba/bug-912579
Merge into: lp:zorba
Diff against target: 168 lines (+64/-0)
11 files modified
ChangeLog (+1/-0)
include/zorba/pregenerated/diagnostic_list.h (+2/-0)
modules/com/zorba-xquery/www/modules/pregenerated/errors.xq (+4/-0)
src/diagnostics/diagnostic_en.xml (+4/-0)
src/diagnostics/pregenerated/diagnostic_list.cpp (+3/-0)
src/diagnostics/pregenerated/dict_en.cpp (+1/-0)
src/runtime/schema/schema_impl.cpp (+6/-0)
src/store/naive/simple_pul.cpp (+1/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err2.spec (+1/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err2.xq (+23/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err2.xsd (+18/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-912579
Reviewer Review Type Date Requested Status
Cezar Andrei Approve
Markos Zaharioudakis Approve
Review via email: mp+87750@code.launchpad.net

This proposal has been superseded by a proposal from 2012-02-29.

Commit message

Fixed bug #912579 (validate-in-place on non-root elements)
Fixed merge of updput primitives

Description of the change

Fixed bug #912579 (validate-in-place on non-root elements)
Fixed merge of updput primitives

To post a comment you must log in.
Revision history for this message
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.

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

Attempt to merge into lp:zorba failed due to conflicts:

text conflict in ChangeLog

lp:~zorba-coders/zorba/bug-912579 updated
10491. By Cezar Andrei

Merge from trunk.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2012-02-29 17:15:09 +0000
3+++ ChangeLog 2012-02-29 20:58:19 +0000
4@@ -56,6 +56,7 @@
5 * Fixed bug #918157 (Add XQFTTS to validation queue)
6 * Fixed bug with unversioned modules with C++ external functions
7 * Fixed bug #878508 (JSON Module not escaping escape characters)
8+ * Fixed bug #912579 (validate-in-place on non-root elements)
9
10 version 2.1
11
12
13=== modified file 'include/zorba/pregenerated/diagnostic_list.h'
14--- include/zorba/pregenerated/diagnostic_list.h 2012-02-16 14:11:02 +0000
15+++ include/zorba/pregenerated/diagnostic_list.h 2012-02-29 20:58:19 +0000
16@@ -510,6 +510,8 @@
17
18 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0080_CANNOT_RETRIEVE_NODE_REFERENCE;
19
20+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0090_CANNOT_VALIDATE_NON_ROOT;
21+
22 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZCSE0001_NONEXISTENT_INPUT_FIELD;
23
24 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZCSE0002_INCOMPATIBLE_INPUT_FIELD;
25
26=== modified file 'modules/com/zorba-xquery/www/modules/pregenerated/errors.xq'
27--- modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2012-02-16 14:11:02 +0000
28+++ modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2012-02-29 20:58:19 +0000
29@@ -321,6 +321,10 @@
30
31 (:~
32 :)
33+declare variable $zerr:ZAPI0090 as xs:QName := fn:QName($zerr:NS, "zerr:ZAPI0090");
34+
35+(:~
36+:)
37 declare variable $zerr:ZCSE0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZCSE0001");
38
39 (:~
40
41=== modified file 'src/diagnostics/diagnostic_en.xml'
42--- src/diagnostics/diagnostic_en.xml 2012-02-28 20:45:43 +0000
43+++ src/diagnostics/diagnostic_en.xml 2012-02-29 20:58:19 +0000
44@@ -1832,6 +1832,10 @@
45 <diagnostic code="ZAPI0080" name="CANNOT_RETRIEVE_NODE_REFERENCE">
46 <value>can not retrieve node-reference for a node that is not in a collection.</value>
47 </diagnostic>
48+
49+ <diagnostic code="ZAPI0090" name="CANNOT_VALIDATE_NON_ROOT">
50+ <value>a non root element cannot be validated in place.</value>
51+ </diagnostic>
52
53 <!--////////// Zorba Class Serialization Errors ////////////////////////-->
54
55
56=== modified file 'src/diagnostics/pregenerated/diagnostic_list.cpp'
57--- src/diagnostics/pregenerated/diagnostic_list.cpp 2012-02-16 14:11:02 +0000
58+++ src/diagnostics/pregenerated/diagnostic_list.cpp 2012-02-29 20:58:19 +0000
59@@ -744,6 +744,9 @@
60 ZorbaErrorCode ZAPI0080_CANNOT_RETRIEVE_NODE_REFERENCE( "ZAPI0080" );
61
62
63+ZorbaErrorCode ZAPI0090_CANNOT_VALIDATE_NON_ROOT( "ZAPI0090" );
64+
65+
66 ZorbaErrorCode ZCSE0001_NONEXISTENT_INPUT_FIELD( "ZCSE0001" );
67
68
69
70=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
71--- src/diagnostics/pregenerated/dict_en.cpp 2012-02-28 20:45:43 +0000
72+++ src/diagnostics/pregenerated/dict_en.cpp 2012-02-29 20:58:19 +0000
73@@ -248,6 +248,7 @@
74 { "ZAPI0042", "iterator is closed" },
75 { "ZAPI0070", "\"$1\": invalid serialization method for SAX" },
76 { "ZAPI0080", "can not retrieve node-reference for a node that is not in a collection." },
77+ { "ZAPI0090", "a non root element cannot be validated in place." },
78 { "ZCSE0001", "\"$1\": nonexistent input field" },
79 { "ZCSE0002", "\"$1\": incompatible input field${: type=2}${, class=3}" },
80 { "ZCSE0003", "\"$1\": unrecognized class field" },
81
82=== modified file 'src/runtime/schema/schema_impl.cpp'
83--- src/runtime/schema/schema_impl.cpp 2011-10-13 19:44:33 +0000
84+++ src/runtime/schema/schema_impl.cpp 2012-02-29 20:58:19 +0000
85@@ -93,6 +93,12 @@
86
87 if (consumeNext(node, theChild.getp(), planState))
88 {
89+ // verify that if the element being revalidated is an element it is the root
90+ if (node->getNodeKind()==store::StoreConsts::elementNode &&
91+ node->getParent() &&
92+ node->getParent()->getNodeKind()!=store::StoreConsts::documentNode)
93+ throw XQUERY_EXCEPTION( zerr::ZAPI0090_CANNOT_VALIDATE_NON_ROOT, ERROR_LOC( loc ) );
94+
95 pul = GENV_ITEMFACTORY->createPendingUpdateList();
96
97 pul->addRevalidate(&loc,node);
98
99=== modified file 'src/store/naive/simple_pul.cpp'
100--- src/store/naive/simple_pul.cpp 2012-02-22 16:45:50 +0000
101+++ src/store/naive/simple_pul.cpp 2012-02-29 20:58:19 +0000
102@@ -1205,6 +1205,7 @@
103 }
104
105 thePutList.push_back(otherUpd);
106+ otherUpd->thePul = this;
107 otherp->thePutList[i] = NULL;
108 }
109
110
111=== added file 'test/rbkt/Queries/zorba/schemas/val-inplace-err2.spec'
112--- test/rbkt/Queries/zorba/schemas/val-inplace-err2.spec 1970-01-01 00:00:00 +0000
113+++ test/rbkt/Queries/zorba/schemas/val-inplace-err2.spec 2012-02-29 20:58:19 +0000
114@@ -0,0 +1,1 @@
115+Error: http://www.zorba-xquery.com/errors:ZAPI0090
116
117=== added file 'test/rbkt/Queries/zorba/schemas/val-inplace-err2.xq'
118--- test/rbkt/Queries/zorba/schemas/val-inplace-err2.xq 1970-01-01 00:00:00 +0000
119+++ test/rbkt/Queries/zorba/schemas/val-inplace-err2.xq 2012-02-29 20:58:19 +0000
120@@ -0,0 +1,23 @@
121+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
122+import module namespace doc = "http://www.zorba-xquery.com/modules/store/dynamic/documents";
123+import schema namespace d="http://www.zorba-xquery.org/schema" at "val-inplace-err2.xsd";
124+
125+declare revalidation lax;
126+declare construction strip;
127+
128+declare variable $doc2:=<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
129+ xmlns="http://www.zorba-xquery.org/schema">
130+ <root>
131+ <a/>
132+ <b/>
133+ <c/>
134+ </root>
135+ <a/>
136+ <b/>
137+ <c/>
138+</root>;
139+
140+schema:validate-in-place($doc2/d:root);
141+
142+
143+(schema:schema-type($doc2), schema:schema-type($doc2/d:root))
144\ No newline at end of file
145
146=== added file 'test/rbkt/Queries/zorba/schemas/val-inplace-err2.xsd'
147--- test/rbkt/Queries/zorba/schemas/val-inplace-err2.xsd 1970-01-01 00:00:00 +0000
148+++ test/rbkt/Queries/zorba/schemas/val-inplace-err2.xsd 2012-02-29 20:58:19 +0000
149@@ -0,0 +1,18 @@
150+<?xml version="1.0" encoding="UTF-8"?>
151+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
152+ targetNamespace="http://www.zorba-xquery.org/schema" xmlns="http://www.zorba-xquery.org/schema"
153+ elementFormDefault="qualified">
154+
155+ <xs:element name="root" type="rootType"/>
156+
157+ <xs:complexType name="rootType">
158+ <xs:sequence>
159+ <xs:element name="root" type="rootType" minOccurs="0"/>
160+ <xs:element name="a" type="xs:string"/>
161+ <xs:element name="b" type="xs:string"/>
162+ <xs:element name="c" type="xs:string"/>
163+ </xs:sequence>
164+ <xs:attribute name="attr" type="xs:string"/>
165+ </xs:complexType>
166+
167+</xs:schema>
168\ No newline at end of file

Subscribers

People subscribed via source and target branches