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

Proposed by Matthias Brantner
Status: Merged
Approved by: Matthias Brantner
Approved revision: 10727
Merged at revision: 10752
Proposed branch: lp:~zorba-coders/zorba/bug-955135
Merge into: lp:zorba
Diff against target: 197 lines (+60/-26)
8 files modified
ChangeLog (+9/-5)
src/compiler/translator/translator.cpp (+17/-8)
src/runtime/core/constructors.cpp (+28/-13)
src/runtime/core/constructors.h (+2/-0)
test/rbkt/ExpQueryResults/zorba/trycatch/trycatch12.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/trycatch/trycatch13.xml.res (+1/-0)
test/rbkt/Queries/zorba/trycatch/trycatch12.xq (+1/-0)
test/rbkt/Queries/zorba/trycatch/trycatch13.xq (+1/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-955135
Reviewer Review Type Date Requested Status
Till Westmann Approve
Ghislain Fourny Approve
Matthias Brantner Approve
Review via email: mp+99354@code.launchpad.net

This proposal supersedes a proposal from 2012-03-14.

Commit message

fixed bug 955135 (err:XQDY0044 not caught by try-catch expressions)
fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest)

Description of the change

fixed bug 955135 (err:XQDY0044 not caught by try-catch expressions)
fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest)

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
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

The attempt to merge lp:~zorba-coders/zorba/bug-955135 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 bug-955135-2012-03-14T18-00-12.523Z is finished. The
  final status was:

  455 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

The attempt to merge lp:~zorba-coders/zorba/bug-955135 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 bug-955135-2012-03-14T18-58-04.285Z is finished. The
  final status was:

  447 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 bug-955135-2012-03-14T20-36-07.983Z 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, Needs Fixing < 1, Pending < 1. Got: 1 Approve, 1 Pending.

Revision history for this message
Ghislain Fourny (gislenius) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Ghislain Fourny (gislenius) :
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-955135-2012-04-10T16-09-12.965Z 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 Approve, 1 Pending.

Revision history for this message
Till Westmann (tillw) :
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-955135-2012-04-11T06-30-00.884Z 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-04 15:59:01 +0000
3+++ ChangeLog 2012-04-10 15:46:22 +0000
4@@ -5,7 +5,11 @@
5 New Features:
6 * Extended API for Python, Java, PHP and Ruby.
7
8+Optimization:
9+
10 Bug Fixes/Other Changes:
11+ * Fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest)
12+ * Fixed bug 955135 (err:XQDY0044 not caught by try-catch expressions)
13 * Fixed bug #967864 (var substitution did not update theFreeVars property)
14 * Fixed bug in window iterator (binding the end vars in the output tuple stream)
15 * Fixed bug #866547 (protect index-join rule from general flwor)
16@@ -57,11 +61,11 @@
17 of the annotations map in expressions.
18
19 Bug Fixes/Other Changes:
20- * Fixed bug #923015 (clone() not implemented for full-text expressions)
21- * Fixed bug #917923 (bug in copying outer var values into the eval dynamic context)
22- * Fixed bug #867509 (Can not handle largest xs:unsignedLong values)
23- * Fixed bug #924063 (sentence is incorrectly incremented when token characters end without sentence terminator)
24- * Fixed bug #909126 (bug in cloning of var_expr)
25+ * Fixed bug 923015 (clone() not implemented for full-text expressions)
26+ * Fixed bug 917923 (bug in copying outer var values into the eval dynamic context)
27+ * Fixed bug 867509 (Can not handle largest xs:unsignedLong values)
28+ * Fixed bug 924063 (sentence is incorrectly incremented when token characters end without sentence terminator)
29+ * Fixed bug 909126 (bug in cloning of var_expr)
30 * Fixed bug in destruction of exit_catcher_expr
31 * Fixed bug #867024 (error messages)
32 * Fixed bug #957580 (stream read failure in StringToCodepointsIteartor)
33
34=== modified file 'src/compiler/translator/translator.cpp'
35--- src/compiler/translator/translator.cpp 2012-03-28 05:19:57 +0000
36+++ src/compiler/translator/translator.cpp 2012-04-10 15:46:22 +0000
37@@ -9044,16 +9044,25 @@
38 case ParseConstants::wild_all:
39 cc->add_nametest_h(new NodeNameTest(zstring(), zstring()));
40 break;
41- case ParseConstants::wild_elem: {
42+ case ParseConstants::wild_elem:
43+ {
44 // bugfix #3138633; expand the qname and use the namespace instead of the prefix
45 zstring localname(":wildcard");
46- store::Item_t qnItem;
47- theSctx->expand_qname(qnItem,
48- theSctx->default_elem_type_ns(),
49- wildcard->getNsOrPrefix(),
50- localname,
51- wildcard->get_location());
52- cc->add_nametest_h(new NodeNameTest(qnItem->getNamespace(), zstring()));
53+
54+ if (wildcard->isEQnameMatch())
55+ {
56+ cc->add_nametest_h(new NodeNameTest(wildcard->getNsOrPrefix(), zstring()));
57+ }
58+ else
59+ {
60+ store::Item_t qnItem;
61+ theSctx->expand_qname(qnItem,
62+ theSctx->default_elem_type_ns(),
63+ wildcard->getNsOrPrefix(),
64+ localname,
65+ wildcard->get_location());
66+ cc->add_nametest_h(new NodeNameTest(qnItem->getNamespace(), zstring()));
67+ }
68 break;
69 }
70 case ParseConstants::wild_prefix:
71
72=== modified file 'src/runtime/core/constructors.cpp'
73--- src/runtime/core/constructors.cpp 2012-04-08 21:39:25 +0000
74+++ src/runtime/core/constructors.cpp 2012-04-10 15:46:22 +0000
75@@ -535,22 +535,22 @@
76 BinaryBaseIterator<AttributeIterator, PlanIteratorState>(sctx, loc, qnameIte, valueIte),
77 theQName(qname),
78 theIsId(false),
79- theIsRoot(isRoot)
80+ theIsRoot(isRoot),
81+ theRaiseXQDY0074(false),
82+ theRaiseXQDY0044(false)
83 {
84- if (theQName != NULL)
85+ if (theQName)
86 {
87 if (theQName->getLocalName().empty())
88 {
89- RAISE_ERROR(err::XQDY0074, loc,
90- ERROR_PARAMS("", ZED(NoEmptyLocalname)));
91+ theRaiseXQDY0074 = true;
92 }
93
94 if (ZSTREQ(theQName->getNamespace(), "http://www.w3.org/2000/xmlns/") ||
95 (theQName->getNamespace().empty() &&
96 ZSTREQ(theQName->getLocalName(), "xmlns")))
97 {
98- RAISE_ERROR(err::XQDY0044, loc,
99- ERROR_PARAMS(theQName->getStringValue()));
100+ theRaiseXQDY0044 = true;
101 }
102
103 if ((ZSTREQ(theQName->getNamespace(), "http://www.w3.org/XML/1998/namespace") &&
104@@ -559,8 +559,7 @@
105 (ZSTREQ(theQName->getPrefix(), "xml") &&
106 !ZSTREQ(theQName->getNamespace(), "http://www.w3.org/XML/1998/namespace")))
107 {
108- RAISE_ERROR(err::XQDY0044, loc,
109- ERROR_PARAMS(theQName->getStringValue()));
110+ theRaiseXQDY0044 = true;
111 }
112
113 if ((ZSTREQ(theQName->getNamespace(), "http://www.w3.org/2000/xmlns/") &&
114@@ -569,11 +568,7 @@
115 (ZSTREQ(theQName->getPrefix(), "xmlns") &&
116 !ZSTREQ(theQName->getNamespace(), "http://www.w3.org/2000/xmlns/")))
117 {
118- throw XQUERY_EXCEPTION(
119- err::XQDY0044,
120- ERROR_PARAMS( theQName->getStringValue() ),
121- ERROR_LOC( loc )
122- );
123+ theRaiseXQDY0044 = true;
124 }
125
126 if (ZSTREQ(theQName->getPrefix(), "xml") &&
127@@ -591,6 +586,8 @@
128 ar & theQName;
129 ar & theIsId;
130 ar & theIsRoot;
131+ ar & theRaiseXQDY0074;
132+ ar & theRaiseXQDY0044;
133 }
134
135
136@@ -608,6 +605,24 @@
137 PlanIteratorState* state;
138 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
139
140+ if (theQName != NULL)
141+ {
142+ // need to raise those errors here and not in the constructor
143+ // because they are dynamic errors and might be caught by try-catch
144+ // (bug 955135)
145+ if (theRaiseXQDY0074)
146+ {
147+ RAISE_ERROR(err::XQDY0074, loc,
148+ ERROR_PARAMS("", ZED(NoEmptyLocalname)));
149+ }
150+
151+ if (theRaiseXQDY0044)
152+ {
153+ RAISE_ERROR(err::XQDY0044, loc,
154+ ERROR_PARAMS(theQName->getStringValue()));
155+ }
156+ }
157+
158 if (theChild0 != NULL)
159 {
160 // Compute the attribute name. Note: we don't have to check that itemQName
161
162=== modified file 'src/runtime/core/constructors.h'
163--- src/runtime/core/constructors.h 2012-03-28 05:19:57 +0000
164+++ src/runtime/core/constructors.h 2012-04-10 15:46:22 +0000
165@@ -170,6 +170,8 @@
166 store::Item_t theQName;
167 bool theIsId;
168 bool theIsRoot;
169+ bool theRaiseXQDY0074;
170+ bool theRaiseXQDY0044;
171
172 public:
173 SERIALIZABLE_CLASS(AttributeIterator);
174
175=== added file 'test/rbkt/ExpQueryResults/zorba/trycatch/trycatch12.xml.res'
176--- test/rbkt/ExpQueryResults/zorba/trycatch/trycatch12.xml.res 1970-01-01 00:00:00 +0000
177+++ test/rbkt/ExpQueryResults/zorba/trycatch/trycatch12.xml.res 2012-04-10 15:46:22 +0000
178@@ -0,0 +1,1 @@
179+Invalid attribute.
180
181=== added file 'test/rbkt/ExpQueryResults/zorba/trycatch/trycatch13.xml.res'
182--- test/rbkt/ExpQueryResults/zorba/trycatch/trycatch13.xml.res 1970-01-01 00:00:00 +0000
183+++ test/rbkt/ExpQueryResults/zorba/trycatch/trycatch13.xml.res 2012-04-10 15:46:22 +0000
184@@ -0,0 +1,1 @@
185+Message
186
187=== added file 'test/rbkt/Queries/zorba/trycatch/trycatch12.xq'
188--- test/rbkt/Queries/zorba/trycatch/trycatch12.xq 1970-01-01 00:00:00 +0000
189+++ test/rbkt/Queries/zorba/trycatch/trycatch12.xq 2012-04-10 15:46:22 +0000
190@@ -0,0 +1,1 @@
191+try { attribute xmlns {} } catch *:XQDY0044 { "Invalid attribute." }
192
193=== added file 'test/rbkt/Queries/zorba/trycatch/trycatch13.xq'
194--- test/rbkt/Queries/zorba/trycatch/trycatch13.xq 1970-01-01 00:00:00 +0000
195+++ test/rbkt/Queries/zorba/trycatch/trycatch13.xq 2012-04-10 15:46:22 +0000
196@@ -0,0 +1,1 @@
197+try { 1 div 0 } catch "http://www.w3.org/2005/xqt-errors":* { "Message"}

Subscribers

People subscribed via source and target branches