Re: [Zorba-coders] [Merge] lp:~nbrinza/zorba/bugs into lp:zorba

2011-11-17 Thread Markos Zaharioudakis
In computing the value of the is_element_test variable, why do we need the 
condition:

dynamic_castconst 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.
-- 
https://code.launchpad.net/~nbrinza/zorba/bugs/+merge/81480
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Bug 891650] [NEW] Use of last()

2011-11-17 Thread Christian Gruen
Public bug reported:

The following query..

  x//last()

..raises XPDY0002 instead of returning the integer 1.

** Affects: zorba
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/891650

Title:
  Use of last()

Status in Zorba - The XQuery Processor:
  New

Bug description:
  The following query..

x//last()

  ..raises XPDY0002 instead of returning the integer 1.

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/891650/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~danielturcanu/zorba/plan-serializer into lp:zorba

2011-11-17 Thread Matthias Brantner
The proposal to merge lp:~danielturcanu/zorba/plan-serializer into lp:zorba has 
been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~danielturcanu/zorba/plan-serializer/+merge/79528
-- 
https://code.launchpad.net/~danielturcanu/zorba/plan-serializer/+merge/79528
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~matthias-brantner/zorba/bug-fixing into lp:zorba

2011-11-17 Thread Matthias Brantner
1. is done

2. because fn:trace was constant folded and the print happened at compile time
-- 
https://code.launchpad.net/~matthias-brantner/zorba/bug-fixing/+merge/82561
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~matthias-brantner/zorba/bug-fixing into lp:zorba

2011-11-17 Thread Matthias Brantner
Review: Approve


-- 
https://code.launchpad.net/~matthias-brantner/zorba/bug-fixing/+merge/82561
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~matthias-brantner/zorba/bug-fixing into lp:zorba

2011-11-17 Thread Matthias Brantner
The proposal to merge lp:~matthias-brantner/zorba/bug-fixing into lp:zorba has 
been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~matthias-brantner/zorba/bug-fixing/+merge/82561
-- 
https://code.launchpad.net/~matthias-brantner/zorba/bug-fixing/+merge/82561
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~matthias-brantner/zorba/caching into lp:zorba

2011-11-17 Thread Matthias Brantner
Matthias Brantner has proposed merging lp:~matthias-brantner/zorba/caching into 
lp:zorba.

Requested reviews:
  Matthias Brantner (matthias-brantner)
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~matthias-brantner/zorba/caching/+merge/82563

- automatic caching of recursive, non-sequential, and deterministic functions 
with atomic parameter and return types
- %ann:cache and %ann:no-cache for controlling function result caching
-- 
https://code.launchpad.net/~matthias-brantner/zorba/caching/+merge/82563
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2011-11-16 04:00:29 +
+++ ChangeLog	2011-11-17 16:58:28 +
@@ -54,6 +54,8 @@
 xs:anyAtomicType or xs:untypedAtomic.
   * Added undo for node revalidation
   * Optimization for count(collection()) expressions
+  * Caching of results for recursive functions with atomic parameter and return types.
+  * Added %ann:cache and %ann:no-cache to enable or disable caching of results of functions with atomic parameter and return types.
   * Fixed bug #867133 (SWIG PHP build failure on Mac OSX)
   * Fixed bug #872796  (validate-in-place can interfere with other update primitives)
   * Fixed bug #872799 (validate-in-place can set incorrect types)

=== modified file 'doc/zorba/options.dox'
--- doc/zorba/options.dox	2011-09-14 06:15:19 +
+++ doc/zorba/options.dox	2011-11-17 16:58:28 +
@@ -278,6 +278,27 @@
 In order to be able to use the value twice, the ttstring:materialize/tt function must be used to materialize the entire contents of the file ttmyfile.txt/tt in memory.
 Otherwise, the error zerr:ZSTR0055 is raised.
 
+\paragraph caching_annotation Caching Results of Functions
+Caching of function results might improve the performance if computational expensive functions are invoked multiple times with the same arguments.
+
+Zorba automatically caches results of recursive, deterministic, and non-sequential functions whose parameter and return types are subtypes of xs:anyAtomicType if at least optimization level O1 is used.
+Specifically, if such a function is called twice with the same arguments, the result of the second call will return the same value without re-evaluating the function.
+
+For example, in the following recursive function computing a fibonacci number, each result is automatically cached and, hence, dramatically improves the performance.
+
+\include zorba/udf/udf-fib-rec.xq
+
+Specifically, this optimization reduces the complexity of the function from O(1.6^n) to O(n).
+
+In order to explicitly disable function caching, the user can specify the tt%ann:no-cache/tt annotation.
+
+In addition, the user can use the tt%ann:cache/tt annotation to cache the results of functions other than the ones that are automatically cached.
+However, this will only work if the function is not updating and its parameter and return types are subtypes of xs:anyAtomicType.
+Zorba will raise a warning if caching is explicitly enabled but the function does not meet this criteria (zwarn:ZWST0005).
+
+Please note, that explicitly enforcing caching for sequential or nondeterministic functions might not give the intended result.
+In such cases, Zorba will raise a warning (zwarn:ZWST0006).
+
 \paragraph collection_index_annotations Annotations on Collections and Indexes
 
 The \ref xqddf uses annotations to assign properties to collections and indexes.

=== modified file 'include/zorba/pregenerated/diagnostic_list.h'
--- include/zorba/pregenerated/diagnostic_list.h	2011-11-15 08:23:20 +
+++ include/zorba/pregenerated/diagnostic_list.h	2011-11-17 16:58:28 +
@@ -600,6 +600,8 @@
 
 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0034_INDEX_RANGE_VALUE_PROBE_BAD_KEY_TYPES;
 
+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0035_INDEX_GENERAL_INSERT;
+
 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0031_IC_NOT_DECLARED;
 
 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0032_IC_NOT_ACTIVATED;
@@ -752,6 +754,10 @@
 
 extern ZORBA_DLL_PUBLIC ZorbaWarningCode ZWST0004_AMBIGUOUS_SEQUENTIAL_FLWOR;
 
+extern ZORBA_DLL_PUBLIC ZorbaWarningCode ZWST0005_CACHING_NOT_POSSIBLE;
+
+extern ZORBA_DLL_PUBLIC ZorbaWarningCode ZWST0006_CACHING_MIGHT_NOT_BE_INTENDED;
+
 } // namespace zwarn
 } // namespace zorba
 #endif /* ZORBA_DIAGNOSTIC_LIST_API_H */

=== modified file 'modules/com/zorba-xquery/www/modules/pregenerated/errors.xq'
--- modules/com/zorba-xquery/www/modules/pregenerated/errors.xq	2011-11-15 08:23:20 +
+++ modules/com/zorba-xquery/www/modules/pregenerated/errors.xq	2011-11-17 16:58:28 +
@@ -501,6 +501,10 @@
 
 (:~
 :)
+declare variable $zerr:ZDDY0035 as xs:QName := fn:QName($zerr:NS, zerr:ZDDY0035);
+
+(:~
+:)
 declare variable $zerr:ZDDY0031 as xs:QName := fn:QName($zerr:NS, zerr:ZDDY0031);
 
 (:~

=== modified file 'modules/com/zorba-xquery/www/modules/pregenerated/warnings.xq'
--- modules/com/zorba-xquery/www/modules/pregenerated/warnings.xq	2011-11-15 08:10:49 +
+++ 

[Zorba-coders] [Merge] lp:~matthias-brantner/zorba/caching into lp:zorba

2011-11-17 Thread Matthias Brantner
The proposal to merge lp:~matthias-brantner/zorba/caching into lp:zorba has 
been updated.

Commit Message changed to:

- automatic caching of recursive, non-sequential, and deterministic functions 
with atomic parameter and return types
- %ann:cache and %ann:no-cache for controlling function result caching

For more details, see:
https://code.launchpad.net/~matthias-brantner/zorba/caching/+merge/82563
-- 
https://code.launchpad.net/~matthias-brantner/zorba/caching/+merge/82563
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~matthias-brantner/zorba/caching into lp:zorba

2011-11-17 Thread Matthias Brantner
The proposal to merge lp:~matthias-brantner/zorba/caching into lp:zorba has 
been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~matthias-brantner/zorba/caching/+merge/82563
-- 
https://code.launchpad.net/~matthias-brantner/zorba/caching/+merge/82563
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Bug 891650] Re: Use of last()

2011-11-17 Thread Matthias Brantner
** Changed in: zorba
Milestone: None = 2.2

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/891650

Title:
  Use of last()

Status in Zorba - The XQuery Processor:
  New

Bug description:
  The following query..

x//last()

  ..raises XPDY0002 instead of returning the integer 1.

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/891650/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/markos-scratch into lp:zorba

2011-11-17 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/82572
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/markos-scratch into lp:zorba

2011-11-17 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba has 
been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/82572
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/82572
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Bug 891453] Re: XQuery grammar needs EQNames

2011-11-17 Thread Paul J. Lucas
** Changed in: zorba
   Importance: Undecided = Medium

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/891453

Title:
  XQuery grammar needs EQNames

Status in Zorba - The XQuery Processor:
  New

Bug description:
  According to Matthias, the XQuery grammar needs to be extended to
  support EQNames.  There also needs to be an AtonicOrUntionType
  production.

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/891453/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Bug 871335] Re: correct moduleDocumentation for image modules

2011-11-17 Thread Matthias Brantner
** Changed in: zorba
Milestone: 2.1 = 2.2

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/871335

Title:
  correct moduleDocumentation for image modules

Status in Zorba - The XQuery Processor:
  New

Bug description:
  See the attached file for errors.

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/871335/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Bug 872386] Re: doc: re-run CMake after adding module .cpp files

2011-11-17 Thread Matthias Brantner
** Changed in: zorba
Milestone: 2.1 = 2.2

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/872386

Title:
  doc: re-run CMake after adding module .cpp files

Status in Zorba - The XQuery Processor:
  Confirmed

Bug description:
  I have refactored a few classes in the http_client module and brought the 
CMake build directory in an inconsistent state with the install directory. That 
is, running any query using the http-client module I got this error:
  zerr::ZXQP0028_TARGET_NAMESPACE_NOT_PROVIDED. And this without changing the 
module URI.

  This look like a problem in the cmake build system around the modules
  (in this case only internal ones) and the loading of those form the
  install/build directories.

  To solve this I had to delete from the build directory:
  - zorba_modules/zorba_http-client_module
  - modules
  and the install directory

  To replicate this, try:
  - build from lp:~gabipetrovay/zorba/cpp-xml-parsing rev. 10490
  - (n)make install
  - run a query from install directory and make sure that it runs (at r.10490 
you will get a segmentation fault but that is another problem and a sign that 
it find the module)
  - update to rev. 10491
  - run cmake and build again
  - (n)make install
  - now running the query again you should get: 
zerr::ZXQP0028_TARGET_NAMESPACE_NOT_PROVIDED
  - deleting the directories above will solve the problem

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/872386/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Bug 857842] Re: Assertion failed with simple content element with comments

2011-11-17 Thread Matthias Brantner
** Changed in: zorba
Milestone: 2.1 = 2.2

-- 
You received this bug notification because you are a member of Zorba
Coders, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/857842

Title:
  Assertion failed with simple content element with comments

Status in Zorba - The XQuery Processor:
  New

Bug description:
  The following query causes an assertion failure at line 3465 in
  node_items.cpp

  import schema namespace s = http://www.xqdoc.org/1.0;;

  let $hostInfo :=xqdoc xmlns=http://www.xqdoc.org/1.0;
  control
  date?processinginstruction aaa?TS4J!-- --5UJ/date
  versionN/A/version
  /control
  module type=library
  uriDGQEb8Q/uri
  /module
  /xqdoc

  return
validate { $hostInfo }

  If i understand correctly the validator should construct only one text
  child for date with value TSF4J5UJ

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/857842/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp