Merge lp:~matthias-brantner/zorba/bug-fixing into lp:zorba

Proposed by Matthias Brantner
Status: Merged
Approved by: Matthias Brantner
Approved revision: no longer in the source branch.
Merged at revision: 10560
Proposed branch: lp:~matthias-brantner/zorba/bug-fixing
Merge into: lp:zorba
Diff against target: 122 lines (+28/-34)
7 files modified
ChangeLog (+1/-0)
doc/cxx/examples/errors.cpp (+4/-4)
src/compiler/translator/translator.cpp (+2/-16)
test/rbkt/Queries/zorba/annotations/annot-unknown-02.spec (+1/-1)
test/rbkt/Queries/zorba/annotations/annot-unknown-02.xq (+10/-6)
test/rbkt/Queries/zorba/annotations/annot-unknown-04.spec (+1/-1)
test/rbkt/Queries/zorba/annotations/annot-unknown-04.xq (+9/-6)
To merge this branch: bzr merge lp:~matthias-brantner/zorba/bug-fixing
Reviewer Review Type Date Requested Status
Nicolae Brinza Approve
William Candillon Approve
Matthias Brantner Approve
Review via email: mp+83686@code.launchpad.net

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

Commit message

Do not raise warnings for unknown annotations in unknown namespaces

Description of the change

- Do not raise warnings for unknown annotations in unknown namespaces
- Improved error message for wrong annotations

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

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
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:~matthias-brantner/zorba/bug-fixing 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 bug-fixing-2011-11-28T20-13-15.46Z is finished. The
  final status was:

  3 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 bug-fixing-2011-11-28T20-49-20.043Z 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. Got: 1 Approve, 1 Pending.

10557. By Markos Zaharioudakis

fixed a performance bug in the implementation of groupby: no node copying for non-groupby vars Approved: Matthias Brantner, Markos Zaharioudakis

Revision history for this message
William Candillon (wcandillon) wrote :

Testing both cases: known and unknown annotations.
It works like a charm.
Good job!

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

I have approved the fix. I would have a small suggestion that in principle should not hinder the commit: maybe the annot-unknown-02.xq and annot-unknown-04.xq tests should be deleted since they serve no purpose now.

review: Approve
10558. By Sorin Marian Nasoi

Fix for bug #897619. Approved: Markos Zaharioudakis, Sorin Marian Nasoi

10559. By Sorin Marian Nasoi

Fix for bug #897616. Approved: Nicolae Brinza, Sorin Marian Nasoi

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-fixing-2011-11-29T22-12-35.046Z is finished. The final status was:

All tests succeeded!

10560. By Matthias Brantner

Do not raise warnings for unknown annotations in unknown namespaces Approved: Nicolae Brinza, William Candillon, Matthias Brantner

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2011-11-23 22:25:05 +0000
3+++ ChangeLog 2011-11-28 20:47:26 +0000
4@@ -38,6 +38,7 @@
5 * Fixed bug #3290122 (ZDST0003 needs collection name)
6 * Fixed bug #3406272 (merging of adjacent text nodes must be done after all
7 updates have been applied).
8+ * Don't raise warnings for unknown annotations.
9 * Fixed bug #3409344 (during detach, if the node being detached is the root of
10 its tree, it should be detached from the tree as well; otherwise memory
11 corruption will occur)
12
13=== modified file 'doc/cxx/examples/errors.cpp'
14--- doc/cxx/examples/errors.cpp 2011-08-11 05:11:12 +0000
15+++ doc/cxx/examples/errors.cpp 2011-11-28 20:47:26 +0000
16@@ -139,12 +139,12 @@
17 // make sure that the warning zwarn::ZWST0002 is turned
18 // into an error
19 StaticContext_t lCtx = aZorba->createStaticContext();
20- lCtx->declareOption(lQName, "ZWST0002");
21+ lCtx->declareOption(lQName, "ZWST0003");
22
23 std::ostringstream s;
24- s << "declare namespace unknown = 'unknown-annotation';" << std::endl
25- << "declare %unknown:test variable $var := 3;" << std::endl
26- << "$var" << std::endl;
27+ s << "declare namespace z = 'http://www.zorba-xquery.com/annotations';" << std::endl
28+ << "declare %z:sequential function local:foo() { 1 };" << std::endl
29+ << "local:foo()" << std::endl;
30 XQuery_t lQuery = aZorba->compileQuery(s.str(), lCtx);
31
32 std::cout << lQuery << std::endl;
33
34=== modified file 'src/compiler/translator/translator.cpp'
35--- src/compiler/translator/translator.cpp 2011-11-24 10:18:51 +0000
36+++ src/compiler/translator/translator.cpp 2011-11-28 20:47:26 +0000
37@@ -3811,24 +3811,10 @@
38 if (AnnotationInternal::lookup(lExpandedQName) == AnnotationInternal::zann_end)
39 {
40 RAISE_ERROR(err::XQST0045, loc,
41- ERROR_PARAMS( "%" + (lExpandedQName->getPrefix().empty() ?
42- "\'" + lExpandedQName->getNamespace() + "\'"
43- : lExpandedQName->getPrefix())
44- + ":" + lExpandedQName->getLocalName()));
45+ ERROR_PARAMS( "%" + ("\"" + lExpandedQName->getNamespace() + "\""
46+ + ":" + lExpandedQName->getLocalName())));
47 }
48 }
49- else
50- {
51- // annotation in unknown namespace -- generate a warning
52- theCCB->theXQueryDiagnostics->add_warning(
53- NEW_XQUERY_WARNING(
54- zwarn::ZWST0002_UNKNOWN_ANNOTATION,
55- WARN_PARAMS( "%" + (lExpandedQName->getPrefix().empty() ?
56- "\'" + lExpandedQName->getNamespace() + "\'"
57- : lExpandedQName->getPrefix())
58- + ":" + lExpandedQName->getLocalName()),
59- WARN_LOC(loc)));
60- }
61
62 std::vector<rchandle<const_expr> > lLiterals;
63
64
65=== modified file 'test/rbkt/Queries/zorba/annotations/annot-unknown-02.spec'
66--- test/rbkt/Queries/zorba/annotations/annot-unknown-02.spec 2011-07-12 23:32:16 +0000
67+++ test/rbkt/Queries/zorba/annotations/annot-unknown-02.spec 2011-11-28 20:47:26 +0000
68@@ -1,1 +1,1 @@
69-Error: http://www.zorba-xquery.com/warnings:ZWST0002
70+Error: http://www.zorba-xquery.com/warnings:ZWST0003
71
72=== modified file 'test/rbkt/Queries/zorba/annotations/annot-unknown-02.xq'
73--- test/rbkt/Queries/zorba/annotations/annot-unknown-02.xq 2011-07-12 23:32:16 +0000
74+++ test/rbkt/Queries/zorba/annotations/annot-unknown-02.xq 2011-11-28 20:47:26 +0000
75@@ -1,7 +1,11 @@
76-declare namespace unknown = "unknown-annotation";
77+declare namespace zann = "http://www.zorba-xquery.com/annotations";
78 declare namespace zwarn = "http://www.zorba-xquery.com/options/warnings";
79-declare option zwarn:error "ZWST0002";
80-
81-declare %unknown:test variable $var := 3;
82-
83-$var
84+declare option zwarn:error "ZWST0003";
85+
86+declare %zann:sequential function local:foo()
87+{
88+ 1
89+};
90+
91+local:foo()
92+
93
94=== modified file 'test/rbkt/Queries/zorba/annotations/annot-unknown-04.spec'
95--- test/rbkt/Queries/zorba/annotations/annot-unknown-04.spec 2011-07-12 23:32:16 +0000
96+++ test/rbkt/Queries/zorba/annotations/annot-unknown-04.spec 2011-11-28 20:47:26 +0000
97@@ -1,2 +1,2 @@
98-Error: http://www.zorba-xquery.com/warnings:ZWST0002
99+Error: http://www.zorba-xquery.com/warnings:ZWST0003
100
101
102=== modified file 'test/rbkt/Queries/zorba/annotations/annot-unknown-04.xq'
103--- test/rbkt/Queries/zorba/annotations/annot-unknown-04.xq 2011-07-12 23:32:16 +0000
104+++ test/rbkt/Queries/zorba/annotations/annot-unknown-04.xq 2011-11-28 20:47:26 +0000
105@@ -1,9 +1,12 @@
106-declare namespace unknown = "unknown-annotation";
107+declare namespace zann = "http://www.zorba-xquery.com/annotations";
108 declare namespace zwarn = "http://www.zorba-xquery.com/options/warnings";
109 declare option zwarn:enable "all";
110-declare option zwarn:error "ZWST0002";
111-
112-declare %unknown:test variable $var := 3;
113-
114-$var
115+declare option zwarn:error "ZWST0003";
116+
117+declare %zann:sequential function local:foo()
118+{
119+ 1
120+};
121+
122+local:foo()
123

Subscribers

People subscribed via source and target branches