Merge lp:~nbrinza/zorba/bugs into lp:zorba

Proposed by Nicolae Brinza
Status: Superseded
Proposed branch: lp:~nbrinza/zorba/bugs
Merge into: lp:zorba
Diff against target: 290 lines (+143/-5)
20 files modified
ChangeLog (+4/-0)
src/types/typeimpl.cpp (+19/-4)
test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-05.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-06.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-07.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-08.xml.res (+1/-0)
test/rbkt/Queries/CMakeLists.txt (+0/-1)
test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.spec (+1/-0)
test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.xq (+10/-0)
test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.spec (+1/-0)
test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.xq (+10/-0)
test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-03.xq (+10/-0)
test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.spec (+1/-0)
test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.xq (+10/-0)
test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-05.xq (+9/-0)
test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-06.xq (+9/-0)
test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-07.xq (+9/-0)
test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-08.xq (+9/-0)
test/rbkt/Queries/zorba/schemas/orderData.xsd (+36/-0)
To merge this branch: bzr merge lp:~nbrinza/zorba/bugs
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Matthias Brantner Pending
Review via email: mp+85862@code.launchpad.net

This proposal supersedes a proposal from 2011-11-07.

This proposal has been superseded by a proposal from 2011-12-18.

Description of the change

Fix for lp: bug #867256 - test Steps-leading-lone-slash-8a is failing.

Indeed, the condition that Markos mentioned was not necessary, so I have removed it. Resubmitting for merge into the trunk.

To post a comment you must log in.
Revision history for this message
Matthias Brantner (matthias-brantner) wrote : Posted in a previous version of this proposal

Nicolae, could you please also update the ChangeLog?

review: Needs Fixing
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

The attempt to merge lp:~nbrinza/zorba/bugs into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:272 (message):
  Validation queue job bugs-2011-11-03T02-45-02.853Z is finished. The final
  status was:

  1 tests did not succeed - changes not commited.

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

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

Validation queue job bugs-2011-11-07T17-26-04.331Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

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

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

Validation queue job bugs-2011-11-07T17-48-33.425Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

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

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

Validation queue starting for merge proposal.
Log at: http://zorbatest.lambda.nu:8080/remotequeue/bugs-2011-11-07T18-09-02.8Z/log.html

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

Validation queue job bugs-2011-11-07T18-09-02.8Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

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

Revision history for this message
Matthias Brantner (matthias-brantner) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Markos Zaharioudakis (markos-za) wrote : Posted in a previous version of this proposal

In computing the value of the is_element_test variable, why do we need the condition:

dynamic_cast<const NodeXQType*>(m_content_type.getp())->m_schema_test == false

? In fact, this seems wrong to me, because if "this" is document-node(SchemaElementTest), then we will return true without really checking the SchemaElementTest.

BTW, the dynamic_cast is not necessary since you have already checked the type kind. A static_cast is better here.

Revision history for this message
Nicolae Brinza (nbrinza) wrote :

Indeed, the condition that Markos mentioned was not necessary, so I have removed it. Resubmitting for merge into the trunk.

Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

Nicolae, I have approved the branch, but it would be nice to also add a test for the document-node(schema-element-test) case. Apparently, the XQTS does not have one!

lp:~nbrinza/zorba/bugs updated
10540. By Nicolae Brinza

Merged with Zorba trunk

10541. By Nicolae Brinza

Added tests for the document-node(schema-element()) node test, used as variable types and in 'instance of' expressions

10542. By Nicolae Brinza

Added test results files for the previous commit (tests for document-node(schema-element()) node test)

10543. By Nicolae Brinza

Added spec files for tests with the document-node(schema-element()) node tests

10544. By Nicolae Brinza

Merged with Zorba trunk

10545. By Nicolae Brinza

Merged with Zorba trunk

10546. By Nicolae Brinza

Merged with Zorba trunk

10547. By Nicolae Brinza

Merged with Zorba trunk

10548. By Nicolae Brinza

Merged with Zorba trunk

10549. By Nicolae Brinza

Fixed the 6 failing doc-node-schema-elem-test- tests

10550. By Nicolae Brinza

Merged with Zorba trunk

Unmerged revisions

10550. By Nicolae Brinza

Merged with Zorba trunk

10549. By Nicolae Brinza

Fixed the 6 failing doc-node-schema-elem-test- tests

10548. By Nicolae Brinza

Merged with Zorba trunk

10547. By Nicolae Brinza

Merged with Zorba trunk

10546. By Nicolae Brinza

Merged with Zorba trunk

10545. By Nicolae Brinza

Merged with Zorba trunk

10544. By Nicolae Brinza

Merged with Zorba trunk

10543. By Nicolae Brinza

Added spec files for tests with the document-node(schema-element()) node tests

10542. By Nicolae Brinza

Added test results files for the previous commit (tests for document-node(schema-element()) node test)

10541. By Nicolae Brinza

Added tests for the document-node(schema-element()) node test, used as variable types and in 'instance of' expressions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2011-12-13 03:38:23 +0000
3+++ ChangeLog 2011-12-17 00:22:28 +0000
4@@ -1,5 +1,9 @@
5 Zorba - The XQuery Processor
6
7+version 2.x
8+
9+ * Fixed bug #867256 (document-node(element(x)) types and tests were not working correctly)
10+
11 version 2.2
12
13 * Caching of results for recursive functions with atomic parameter and return types.
14
15=== modified file 'src/types/typeimpl.cpp'
16--- src/types/typeimpl.cpp 2011-07-01 05:22:12 +0000
17+++ src/types/typeimpl.cpp 2011-12-17 00:22:28 +0000
18@@ -361,7 +361,7 @@
19
20
21 bool NodeXQType::is_subtype(
22- const TypeManager* tm,
23+ const TypeManager* tm,
24 const NodeXQType& supertype,
25 const QueryLoc& loc) const
26 {
27@@ -443,7 +443,7 @@
28
29
30 bool NodeXQType::is_supertype(
31- const TypeManager* tm,
32+ const TypeManager* tm,
33 const store::Item* subitem,
34 const QueryLoc& loc) const
35 {
36@@ -488,14 +488,29 @@
37 }
38 }
39
40- if (m_node_kind != store::StoreConsts::elementNode &&
41- m_node_kind != store::StoreConsts::attributeNode)
42+ // document-node( E ) matches any document node that contains exactly one element
43+ // node, optionally accompanied by one or more comment and processing instruction
44+ // nodes, if E is an ElementTest or SchemaElementTest that matches the element node.
45+ bool is_element_test = (
46+ m_node_kind == store::StoreConsts::documentNode &&
47+ m_content_type != NULL &&
48+ m_content_type->type_kind() == XQType::NODE_TYPE_KIND);
49+
50+ if (m_node_kind != store::StoreConsts::elementNode &&
51+ m_node_kind != store::StoreConsts::attributeNode &&
52+ !is_element_test)
53 return true;
54
55 if (m_content_type == NULL ||
56 m_content_type->type_kind() == XQType::ANY_TYPE_KIND)
57 return true;
58
59+ if (is_element_test)
60+ {
61+ xqtref_t documentNodeType = tm->create_value_type(subitem, loc);
62+ return TypeOps::is_subtype(tm, *documentNodeType, *this);
63+ }
64+
65 xqtref_t subContentType = tm->create_named_type(subitem->getType(),
66 TypeConstants::QUANT_ONE,
67 loc,
68
69=== added file 'test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-03.xml.res'
70--- test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-03.xml.res 1970-01-01 00:00:00 +0000
71+++ test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-03.xml.res 2011-12-17 00:22:28 +0000
72@@ -0,0 +1,1 @@
73+true
74\ No newline at end of file
75
76=== added file 'test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-05.xml.res'
77--- test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-05.xml.res 1970-01-01 00:00:00 +0000
78+++ test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-05.xml.res 2011-12-17 00:22:28 +0000
79@@ -0,0 +1,1 @@
80+false
81\ No newline at end of file
82
83=== added file 'test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-06.xml.res'
84--- test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-06.xml.res 1970-01-01 00:00:00 +0000
85+++ test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-06.xml.res 2011-12-17 00:22:28 +0000
86@@ -0,0 +1,1 @@
87+false
88\ No newline at end of file
89
90=== added file 'test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-07.xml.res'
91--- test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-07.xml.res 1970-01-01 00:00:00 +0000
92+++ test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-07.xml.res 2011-12-17 00:22:28 +0000
93@@ -0,0 +1,1 @@
94+true
95\ No newline at end of file
96
97=== added file 'test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-08.xml.res'
98--- test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-08.xml.res 1970-01-01 00:00:00 +0000
99+++ test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-08.xml.res 2011-12-17 00:22:28 +0000
100@@ -0,0 +1,1 @@
101+false
102\ No newline at end of file
103
104=== modified file 'test/rbkt/Queries/CMakeLists.txt'
105--- test/rbkt/Queries/CMakeLists.txt 2011-12-09 19:37:09 +0000
106+++ test/rbkt/Queries/CMakeLists.txt 2011-12-17 00:22:28 +0000
107@@ -210,7 +210,6 @@
108 ####
109 IF (FOUND_XQTS AND NOT ZORBA_TEST_W3C_TO_SUBMIT_RESULTS)
110
111- EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQuery/PathExpr/Steps/Steps-leading-lone-slash-8a 3408285)
112 EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQuery/Functions/QNameFunc/NamespaceURIForPrefixFunc/K2-NamespaceURIForPrefixFunc-2 872732)
113
114 IF(NOT ZORBA_WITH_BIG_INTEGER)
115
116=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.spec'
117--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.spec 1970-01-01 00:00:00 +0000
118+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.spec 2011-12-17 00:22:28 +0000
119@@ -0,0 +1,1 @@
120+Error: http://www.w3.org/2005/xqt-errors:XPTY0004
121
122=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.xq'
123--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.xq 1970-01-01 00:00:00 +0000
124+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.xq 2011-12-17 00:22:28 +0000
125@@ -0,0 +1,10 @@
126+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy" at "orderData.xsd";
127+
128+declare variable $source := document { (
129+ <!--comment-->,
130+ <Strings><orderData>one string</orderData></Strings>,
131+ <?processing instruction?>
132+ ) };
133+
134+let $document as document-node(schema-element(Strings)) := $source
135+return true()
136
137=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.spec'
138--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.spec 1970-01-01 00:00:00 +0000
139+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.spec 2011-12-17 00:22:28 +0000
140@@ -0,0 +1,1 @@
141+Error: http://www.w3.org/2005/xqt-errors:XPTY0004
142
143=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.xq'
144--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.xq 1970-01-01 00:00:00 +0000
145+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.xq 2011-12-17 00:22:28 +0000
146@@ -0,0 +1,10 @@
147+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy" at "orderData.xsd";
148+
149+declare variable $source := document { (
150+ <!--comment-->,
151+ <Strings><orderData>one string</orderData></Strings>,
152+ <?processing instruction?>
153+ ) };
154+
155+let $document as document-node(schema-element(Strings2)) := $source
156+return true()
157
158=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-03.xq'
159--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-03.xq 1970-01-01 00:00:00 +0000
160+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-03.xq 2011-12-17 00:22:28 +0000
161@@ -0,0 +1,10 @@
162+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy" at "orderData.xsd";
163+
164+declare variable $source := document { (
165+ <!--comment-->,
166+ <Strings><orderData>one string</orderData></Strings>,
167+ <?processing instruction?>
168+ ) };
169+
170+let $document as document-node(schema-element(Strings)) := validate { $source }
171+return true()
172
173=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.spec'
174--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.spec 1970-01-01 00:00:00 +0000
175+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.spec 2011-12-17 00:22:28 +0000
176@@ -0,0 +1,1 @@
177+Error: http://www.w3.org/2005/xqt-errors:XPTY0004
178
179=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.xq'
180--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.xq 1970-01-01 00:00:00 +0000
181+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.xq 2011-12-17 00:22:28 +0000
182@@ -0,0 +1,10 @@
183+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy" at "orderData.xsd";
184+
185+declare variable $source := document { (
186+ <!--comment-->,
187+ <Strings><orderData>one string</orderData></Strings>,
188+ <?processing instruction?>
189+ ) };
190+
191+let $document as document-node(schema-element(Strings2)) := validate { $source }
192+return true()
193
194=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-05.xq'
195--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-05.xq 1970-01-01 00:00:00 +0000
196+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-05.xq 2011-12-17 00:22:28 +0000
197@@ -0,0 +1,9 @@
198+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy" at "orderData.xsd";
199+
200+declare variable $source := document { (
201+ <!--comment-->,
202+ <Strings><orderData>one string</orderData></Strings>,
203+ <?processing instruction?>
204+ ) };
205+
206+$source instance of document-node(schema-element(Strings))
207
208=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-06.xq'
209--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-06.xq 1970-01-01 00:00:00 +0000
210+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-06.xq 2011-12-17 00:22:28 +0000
211@@ -0,0 +1,9 @@
212+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy" at "orderData.xsd";
213+
214+declare variable $source := document { (
215+ <!--comment-->,
216+ <Strings><orderData>one string</orderData></Strings>,
217+ <?processing instruction?>
218+ ) };
219+
220+$source instance of document-node(schema-element(Strings2))
221
222=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-07.xq'
223--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-07.xq 1970-01-01 00:00:00 +0000
224+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-07.xq 2011-12-17 00:22:28 +0000
225@@ -0,0 +1,9 @@
226+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy" at "orderData.xsd";
227+
228+declare variable $source := document { (
229+ <!--comment-->,
230+ <Strings><orderData>one string</orderData></Strings>,
231+ <?processing instruction?>
232+ ) };
233+
234+validate{$source} instance of document-node(schema-element(Strings))
235
236=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-08.xq'
237--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-08.xq 1970-01-01 00:00:00 +0000
238+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-08.xq 2011-12-17 00:22:28 +0000
239@@ -0,0 +1,9 @@
240+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy" at "orderData.xsd";
241+
242+declare variable $source := document { (
243+ <!--comment-->,
244+ <Strings><orderData>one string</orderData></Strings>,
245+ <?processing instruction?>
246+ ) };
247+
248+validate{$source} instance of document-node(schema-element(Strings2))
249
250=== added file 'test/rbkt/Queries/zorba/schemas/orderData.xsd'
251--- test/rbkt/Queries/zorba/schemas/orderData.xsd 1970-01-01 00:00:00 +0000
252+++ test/rbkt/Queries/zorba/schemas/orderData.xsd 2011-12-17 00:22:28 +0000
253@@ -0,0 +1,36 @@
254+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:order="http://www.w3.org/XQueryTestOrderBy" targetNamespace="http://www.w3.org/XQueryTestOrderBy" elementFormDefault="qualified">
255+ <xs:complexType name = "numbers">
256+ <xs:sequence>
257+ <xs:element name="orderData" type="xs:decimal" minOccurs="0" maxOccurs="unbounded"/>
258+ </xs:sequence>
259+ </xs:complexType>
260+ <xs:element name = "Strings">
261+ <xs:complexType>
262+ <xs:sequence>
263+ <xs:element name="orderData" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
264+ </xs:sequence>
265+ </xs:complexType>
266+ </xs:element>
267+ <xs:element name = "Strings2">
268+ <xs:complexType>
269+ <xs:sequence>
270+ <xs:element name="orderData" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
271+ </xs:sequence>
272+ </xs:complexType>
273+ </xs:element>
274+ <xs:element name = "NegativeNumbers" type = "order:numbers"/>
275+ <xs:element name = "PositiveNumbers" type = "order:numbers"/>
276+ <xs:element name = "SmallNegativeNumbers" type = "order:numbers"/>
277+ <xs:element name = "SmallPositiveNumbers" type = "order:numbers"/>
278+ <xs:element name = "DataValues">
279+ <xs:complexType>
280+ <xs:sequence>
281+ <xs:element ref="order:Strings"/>
282+ <xs:element ref="order:NegativeNumbers"/>
283+ <xs:element ref="order:PositiveNumbers"/>
284+ <xs:element ref="order:SmallNegativeNumbers"/>
285+ <xs:element ref="order:SmallPositiveNumbers"/>
286+ </xs:sequence>
287+ </xs:complexType>
288+ </xs:element>
289+</xs:schema>
290\ No newline at end of file

Subscribers

People subscribed via source and target branches