Merge lp:~zorba-coders/zorba/bug905028 into lp:zorba

Proposed by Rodolfo Ochoa
Status: Merged
Approved by: Matthias Brantner
Approved revision: 10814
Merged at revision: 10841
Proposed branch: lp:~zorba-coders/zorba/bug905028
Merge into: lp:zorba
Diff against target: 189 lines (+49/-11)
9 files modified
ChangeLog (+1/-0)
include/zorba/static_context.h (+7/-0)
src/api/staticcontextimpl.cpp (+17/-0)
src/api/staticcontextimpl.h (+5/-0)
src/compiler/rewriter/tools/dataflow_annotations.h (+1/-3)
src/context/static_context.cpp (+14/-5)
src/context/static_context.h (+2/-0)
src/functions/func_sequences_impl.h (+2/-2)
src/runtime/full_text/ft_module_impl.cpp (+0/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug905028
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Chris Hillery Approve
Review via email: mp+104447@code.launchpad.net

Commit message

BaseURI can now be cleared through a method.
When BaseUri is undefined it returns an empty string instead of asserting.
Fixed some compilation warnings to have a cleaner compiling.
Added #define stdafx.h to some files to fix the precompiled headers on Windows.

Description of the change

BaseURI can now be cleared through a method.
When BaseUri is undefined it returns an empty string instead of asserting.

To post a comment you must log in.
Revision history for this message
Chris Hillery (ceejatec) wrote :

1. When adding new virtual methods to a public API class, they must be added at the bottom of the class (after any other virtual methods) to maintain ABI compatibility.

2. Couldn't users just call setBaseURI(""), rather than needing this new method?

3. I don't understand the change to static_context::compute_base_uri(); that seems like it will change behaviour even when nobody calls clearBaseURI(). Can you clarify that logic?

Style issues:

4. dataflow_annotations.h: don't comment out code; just delete the line. Also, is the new #include of rewriter_context.h necessary?

5. I don't love the fact that the Windows compilation fixes are part of this merge proposal, since they're unrelated and that won't show up in the log. However, I admit it's a pain to run a separate proposal for them. Could you just add a note to the commit message saying they're there?

review: Needs Fixing
Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

>>1. When adding new virtual methods to a public API class, they must be added at the bottom of the class (after any other virtual methods) to maintain ABI compatibility.
- Done

>>2. Couldn't users just call setBaseURI(""), rather than needing this new method?
- This functionality is implemented to set relative paths, so, for current base URI: http://www.foo.com/bar the method will set the base URI to http://www.foo.com

>>3. I don't understand the change to static_context::compute_base_uri(); that seems like it will change behaviour even when nobody calls clearBaseURI(). Can you clarify that logic?
- Seems that the method was created to make verifications on the base_uri, from this method I just removed the default http://www.zorba-xquery.com

Style issues:

>>4. dataflow_annotations.h: don't comment out code; just delete the line. Also, is the new #include of rewriter_context.h necessary?
line deleted, this is to avoid a warning where the compiler detect the a struct and the find this class re-definition, the right thing to do is to add the definition header.

>>5. I don't love the fact that the Windows compilation fixes are part of this merge proposal, since they're unrelated and that won't show up in the log. However, I admit it's a pain to run a separate proposal for them. Could you just add a note to the commit message saying they're there?
- Done

Revision history for this message
Chris Hillery (ceejatec) wrote :

Ok, thanks for thpe fixes and answers. It looks good to me.

My only other question is whether this should be merged yet, or wait until after 2.5. But since Matthias is also reviewing this, I'll let him make that call.

review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug905028 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 bug905028-2012-05-07T21-23-03.272Z 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
Chris Hillery (ceejatec) wrote :

Looks like cosmic rays again - that test runs fine when run manually. In this case it even said "testdriver: success" so I'm completely confused. I think we need new hardware. Anyway, I'm re-starting the queue.

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 bug905028-2012-05-07T23-48-59.044Z 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: 1 Approve, 1 Pending.

Revision history for this message
Matthias Brantner (matthias-brantner) :
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 src/runtime/full_text/ft_module_impl.cpp

lp:~zorba-coders/zorba/bug905028 updated
10813. By Matthias Brantner

merge

10814. By Matthias Brantner

merge

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 bug905028-2012-05-15T21-16-08.381Z 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-05-09 01:25:37 +0000
3+++ ChangeLog 2012-05-15 21:16:18 +0000
4@@ -31,6 +31,7 @@
5 and is not used anywhere else in the query
6
7 Bug Fixes/Other Changes:
8+ * Fixed bugs #905028 (Allow to set base URI to undefined)
9 * Fixed bugs #931501 and #866987 (improved error messages for fn:format-number(). Additionally, the function now throws the FODF1310 error instead of XTDE1310, as the 3.0 spec requires)
10 * Fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest)
11 * Fixed memory leak in case of index truncation
12
13=== modified file 'include/zorba/static_context.h'
14--- include/zorba/static_context.h 2012-05-05 02:39:12 +0000
15+++ include/zorba/static_context.h 2012-05-15 21:16:18 +0000
16@@ -719,8 +719,15 @@
17 *
18 * @return the fetched resource
19 */
20+
21 virtual Item
22 fetch(const String& aURI, const String& aEntityKind) const = 0;
23+ /** \brief Clears the base URI and sets it to undefined state.
24+ * (see http://www.w3.org/TR/xquery/#static_context)
25+ */
26+ virtual void
27+ clearBaseURI() = 0;
28+
29 };
30
31 } /* namespace zorba */
32
33=== modified file 'src/api/staticcontextimpl.cpp'
34--- src/api/staticcontextimpl.cpp 2012-05-07 23:43:04 +0000
35+++ src/api/staticcontextimpl.cpp 2012-05-15 21:16:18 +0000
36@@ -1592,5 +1592,22 @@
37 return 0;
38 }
39
40+void
41+StaticContextImpl::clearBaseURI()
42+{
43+ try
44+ {
45+ theCtx->clear_base_uri();
46+ }
47+ catch (ZorbaException const& e)
48+ {
49+ ZorbaImpl::notifyError(theDiagnosticHandler, e);
50+ }
51+ catch (std::exception const& e)
52+ {
53+ ZorbaImpl::notifyError(theDiagnosticHandler, e.what());
54+ }
55+}
56+
57 } /* namespace zorba */
58 /* vim:set et sw=2 ts=2: */
59
60=== modified file 'src/api/staticcontextimpl.h'
61--- src/api/staticcontextimpl.h 2012-05-07 23:43:04 +0000
62+++ src/api/staticcontextimpl.h 2012-05-15 21:16:18 +0000
63@@ -310,6 +310,11 @@
64
65 Function_t
66 checkInvokable(const Item& aQName, size_t aNumArgs) const;
67+
68+public:
69+ virtual void
70+ clearBaseURI();
71+
72 };
73
74 } // namespace zorba
75
76=== modified file 'src/compiler/rewriter/tools/dataflow_annotations.h'
77--- src/compiler/rewriter/tools/dataflow_annotations.h 2012-05-03 12:31:51 +0000
78+++ src/compiler/rewriter/tools/dataflow_annotations.h 2012-05-15 21:16:18 +0000
79@@ -18,13 +18,11 @@
80 #define ZORBA_COMPILER_DATAFLOW_ANNOTATIONS_H
81
82 #include "compiler/expression/expr_classes.h"
83+#include "compiler/rewriter/framework/rewriter_context.h"
84
85 namespace zorba
86 {
87
88-class UDFCallChain;
89-
90-
91 /*******************************************************************************
92
93 ********************************************************************************/
94
95=== modified file 'src/context/static_context.cpp'
96--- src/context/static_context.cpp 2012-05-09 20:40:03 +0000
97+++ src/context/static_context.cpp 2012-05-15 21:16:18 +0000
98@@ -1262,8 +1262,7 @@
99
100 sctx = sctx->theParent;
101 }
102-
103- ZORBA_ASSERT(false);
104+ return ""; //undefined
105 }
106
107
108@@ -1295,7 +1294,6 @@
109 compute_base_uri();
110 }
111
112-
113 /***************************************************************************//**
114 Base Uri Computation
115
116@@ -1416,8 +1414,8 @@
117 return;
118 }
119
120- theBaseUriInfo->theBaseUri = get_implementation_baseuri();
121- theBaseUriInfo->theHaveBaseUri = true;
122+ theBaseUriInfo->theBaseUri = "";
123+ theBaseUriInfo->theHaveBaseUri = false;
124 return;
125 }
126
127@@ -4145,5 +4143,16 @@
128 }
129 }
130
131+/***************************************************************************//**
132+
133+********************************************************************************/
134+void static_context::clear_base_uri()
135+{
136+ if (theBaseUriInfo)
137+ delete theBaseUriInfo;
138+
139+ theBaseUriInfo = new BaseUriInfo;
140+}
141+
142 } // namespace zorba
143 /* vim:set et sw=2 ts=2: */
144
145=== modified file 'src/context/static_context.h'
146--- src/context/static_context.h 2012-05-05 02:39:12 +0000
147+++ src/context/static_context.h 2012-05-15 21:16:18 +0000
148@@ -651,6 +651,8 @@
149
150 zstring get_base_uri() const;
151
152+ void clear_base_uri();
153+
154 void set_base_uri(const zstring& uri, bool from_prolog = true);
155
156 void compute_base_uri();
157
158=== modified file 'src/functions/func_sequences_impl.h'
159--- src/functions/func_sequences_impl.h 2012-05-03 12:31:51 +0000
160+++ src/functions/func_sequences_impl.h 2012-05-15 21:16:18 +0000
161@@ -224,7 +224,7 @@
162
163 bool propagatesInputNodes(expr* fo, csize input) const
164 {
165- return ANNOTATION_TRUE_FIXED;
166+ return ANNOTATION_TRUE_FIXED!=0;
167 }
168
169 bool mustCopyInputNodes(expr* fo, csize input) const
170@@ -276,7 +276,7 @@
171
172 bool propagatesInputNodes(expr* fo, csize input) const
173 {
174- return ANNOTATION_TRUE_FIXED;
175+ return ANNOTATION_TRUE_FIXED!=0;
176 }
177
178 bool mustCopyInputNodes(expr* fo, csize input) const
179
180=== modified file 'src/runtime/full_text/ft_module_impl.cpp'
181--- src/runtime/full_text/ft_module_impl.cpp 2012-05-15 21:04:28 +0000
182+++ src/runtime/full_text/ft_module_impl.cpp 2012-05-15 21:16:18 +0000
183@@ -13,7 +13,6 @@
184 * See the License for the specific language governing permissions and
185 * limitations under the License.
186 */
187-
188 #include "stdafx.h"
189 #include <zorba/config.h>
190

Subscribers

People subscribed via source and target branches