Merge lp:~paul-lucas/zorba/bug-888242 into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Paul J. Lucas
Approved revision: 10909
Merged at revision: 10920
Proposed branch: lp:~paul-lucas/zorba/bug-888242
Merge into: lp:zorba
Diff against target: 85 lines (+22/-9)
3 files modified
src/compiler/translator/translator.cpp (+12/-3)
src/runtime/full_text/apply.cpp (+1/-2)
src/runtime/full_text/thesaurus.cpp (+9/-4)
To merge this branch: bzr merge lp:~paul-lucas/zorba/bug-888242
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Paul J. Lucas Approve
Review via email: mp+113130@code.launchpad.net

Commit message

Moved URI resolution for the thesaurus into the translator.

Description of the change

Moved URI resolution for the thesaurus into the translator.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
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-888242-2012-07-03T00-03-01.855Z 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.

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 :

The attempt to merge lp:~paul-lucas/zorba/bug-888242 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-888242-2012-07-09T17-18-00.226Z is finished. The
  final status was:

  2 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 :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~paul-lucas/zorba/bug-888242 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-888242-2012-07-09T18-11-57.967Z is finished. The
  final status was:

  2 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 :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-888242-2012-07-09T22-37-31.106Z 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 'src/compiler/translator/translator.cpp'
2--- src/compiler/translator/translator.cpp 2012-06-29 21:53:55 +0000
3+++ src/compiler/translator/translator.cpp 2012-07-02 23:14:21 +0000
4@@ -13795,6 +13795,16 @@
5 void end_visit (const FTThesaurusID& v, void* /*visit_state*/) {
6 TRACE_VISIT_OUT ();
7 #ifndef ZORBA_NO_FULL_TEXT
8+ zstring const &uri = v.get_uri();
9+ zstring error_msg;
10+ std::auto_ptr<internal::Resource> rsrc(
11+ theSctx->resolve_uri( uri, internal::EntityData::THESAURUS, error_msg )
12+ );
13+ if ( !rsrc.get() )
14+ throw XQUERY_EXCEPTION(
15+ err::FTST0018, ERROR_PARAMS( uri ), ERROR_LOC( loc )
16+ );
17+
18 ftrange *levels;
19 if ( v.get_levels() ) {
20 levels = dynamic_cast<ftrange*>( pop_ftstack() );
21@@ -13802,9 +13812,8 @@
22 } else
23 levels = nullptr;
24
25- ftthesaurus_id *const tid = new ftthesaurus_id(
26- loc, v.get_uri(), v.get_relationship(), levels
27- );
28+ ftthesaurus_id *const tid =
29+ new ftthesaurus_id( loc, uri, v.get_relationship(), levels );
30 push_ftstack( tid );
31 #endif /* ZORBA_NO_FULL_TEXT */
32 }
33
34=== modified file 'src/runtime/full_text/apply.cpp'
35--- src/runtime/full_text/apply.cpp 2012-06-28 04:14:03 +0000
36+++ src/runtime/full_text/apply.cpp 2012-07-02 23:14:21 +0000
37@@ -1224,8 +1224,7 @@
38 auto_ptr<internal::Resource> rsrc = static_ctx_.resolve_uri(
39 uri, internal::EntityData::THESAURUS, error_msg
40 );
41- if ( !rsrc.get() )
42- throw XQUERY_EXCEPTION( err::FTST0018, ERROR_PARAMS( uri ) );
43+ ZORBA_ASSERT( rsrc.get() );
44
45 internal::ThesaurusProvider const *const t_provider =
46 dynamic_cast<internal::ThesaurusProvider const*>( rsrc.get() );
47
48=== modified file 'src/runtime/full_text/thesaurus.cpp'
49--- src/runtime/full_text/thesaurus.cpp 2012-06-28 04:14:03 +0000
50+++ src/runtime/full_text/thesaurus.cpp 2012-07-02 23:14:21 +0000
51@@ -104,8 +104,9 @@
52 return nullptr;
53
54 switch ( thesaurus_impl::find( scheme_name ) ) {
55- case thesaurus_impl::xqftts: {
56- //
57+ case thesaurus_impl::xqftts:
58+# ifdef ZORBA_WITH_FILE_ACCESS
59+ {
60 // Currently, we presume that an "xqftts:" URL should be used exactly
61 // like a "file:" URL.
62 //
63@@ -114,9 +115,10 @@
64 zstring const t_path( fs::get_normalized_path( t_uri ) );
65 return new xqftts::provider( t_path );
66 }
67+# endif /* ZORBA_WITH_FILE_ACCESS */
68+ case thesaurus_impl::wordnet:
69 # ifdef ZORBA_WITH_FILE_ACCESS
70- case thesaurus_impl::wordnet: {
71- //
72+ {
73 // Wordnet, on the other hand, needs to find its data file in Zorba's
74 // library path using the mangled form of the original URI. So, mangle
75 // here for convenience.
76@@ -126,6 +128,9 @@
77 return new wordnet::provider( t_path );
78 }
79 # endif /* ZORBA_WITH_FILE_ACCESS */
80+# ifndef ZORBA_WITH_FILE_ACCESS
81+ throw XQUERY_EXCEPTION( zerr::ZXQP0017_FILE_ACCESS_DISABLED );
82+# endif /* ZORBA_WITH_FILE_ACCESS */
83 default:
84 throw XQUERY_EXCEPTION( err::FTST0018, ERROR_PARAMS( url ) );
85 }

Subscribers

People subscribed via source and target branches