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

Proposed by Matthias Brantner
Status: Merged
Merged at revision: 11609
Proposed branch: lp:~zorba-coders/zorba/bug-1026250
Merge into: lp:zorba
Diff against target: 993 lines (+563/-31)
31 files modified
include/zorba/pregenerated/diagnostic_list.h (+2/-0)
modules/pregenerated/zorba-errors.xq (+4/-0)
src/compiler/codegen/plan_visitor.cpp (+8/-7)
src/compiler/expression/flwor_expr.cpp (+22/-1)
src/compiler/expression/flwor_expr.h (+5/-2)
src/compiler/parser/parser.y (+4/-10)
src/compiler/parsetree/parsenodes.h (+1/-1)
src/compiler/translator/translator.cpp (+27/-0)
src/diagnostics/diagnostic_en.xml (+5/-1)
src/diagnostics/pregenerated/diagnostic_list.cpp (+3/-0)
src/diagnostics/pregenerated/dict_en.cpp (+2/-1)
src/store/naive/simple_collection.cpp (+25/-6)
src/store/naive/simple_collection.h (+3/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor24.iter (+56/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor25.iter (+56/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor26.iter (+66/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor27.iter (+63/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor28.iter (+57/-0)
test/rbkt/ExpQueryResults/zorba/flwor/flwor24.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/flwor/flwor25.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/flwor/flwor27.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/flwor/flwor28.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/scripting/flwor2.xml.res (+0/-2)
test/rbkt/Queries/zorba/flwor/flwor24.xml (+5/-0)
test/rbkt/Queries/zorba/flwor/flwor24.xq (+25/-0)
test/rbkt/Queries/zorba/flwor/flwor25.xq (+29/-0)
test/rbkt/Queries/zorba/flwor/flwor26.spec (+1/-0)
test/rbkt/Queries/zorba/flwor/flwor26.xq (+30/-0)
test/rbkt/Queries/zorba/flwor/flwor27.xq (+30/-0)
test/rbkt/Queries/zorba/flwor/flwor28.xq (+29/-0)
test/rbkt/Queries/zorba/scripting/flwor2.spec (+1/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1026250
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Matthias Brantner Approve
Review via email: mp+138044@code.launchpad.net

Commit message

fix for bug lp:1026250

Description of the change

- annotation to turn on sequential flwor streaming
- introduce support for pragmas and allows the body of a pragma to be a statement (recent scripting extension)
- collections are versioned in order to avoid deadlocks when modifying a collection that is currently read from (instead raise an error)

To post a comment you must log in.
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/bug-1026250 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug-1026250-2012-12-05T01-32-06.304Z is finished. The
  final status was:

  13 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

Of the failing tests, only some have been modified. If you changed the default behavior, shouldn't you also have to change every affected test by adding the pragma?

lp:~zorba-coders/zorba/bug-1026250 updated
11088. By Paul J. Lucas

Cosmetic change.

11089. By Paul J. Lucas

Cleaned-up assert message.

11090. By Paul J. Lucas

Added operator<< for flwor_expr::ClauseKind.

11091. By Paul J. Lucas

Cleaned-up assert message.

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

I modified test flwor10.xq to be:

declare namespace ext = "http://www.zorba-xquery.com/extensions";

variable $x := 0;

(# ext:materialize #) {
  for $i in (1, 2, 3)
  let $y := { $x := $x + $i; () }
  return $x
}

ran it and got:

Zorba error [zerr:ZXQP0002]: "false": assertion failed with the message: ClauseKind = materialize_clause; raised at /Users/pjl/src/flwor/zorba/repo/bug-1026250/zorba/src/compiler/codegen/plan_visitor.cpp:1028

The switch statement doesn't have a case for materialize_clause. Either it should, or it should never be the case that a materialize_clause should occur here.

FYI: I modified the code on the branch to overload operator<< for ClauseKind -- makes it handy for debugging.

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

Please put a more descriptive commit message for this change.

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

Matthias will get this scheduled within 28msec, hopefully soon.

lp:~zorba-coders/zorba/bug-1026250 updated
11092. By Federico Cavalieri

Merged trunk into the branch

11093. By Federico Cavalieri

Fixed compilation

11094. By Federico Cavalieri

Inverted annotation semantic

11095. By Federico Cavalieri

Implemented no-streaming extension

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

Ready for review

Revision history for this message
Ghislain Fourny (gislenius) wrote :

One of the tests uses ext:nomaterialization without dash. Is this intented?

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

nope, let me fix it

On Wed, Aug 14, 2013 at 3:14 PM, Ghislain Fourny <ghislain.fourny@28msec.com
> wrote:

> One of the tests uses ext:nomaterialization without dash. Is this intented?
> --
> https://code.launchpad.net/~zorba-coders/zorba/bug-1026250/+merge/138044
> Your team Zorba Coders is subscribed to branch lp:zorba.
>
> --
> Mailing list: https://launchpad.net/~zorba-coders
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~zorba-coders
> More help : https://help.launchpad.net/ListHelp
>

lp:~zorba-coders/zorba/bug-1026250 updated
11096. By Federico Cavalieri

Fixed test28

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

Fixed and pushed

On Wed, Aug 14, 2013 at 9:36 PM, Federico Cavalieri <
federico.cavalieri@28msec.com> wrote:

> nope, let me fix it
>
>
> On Wed, Aug 14, 2013 at 3:14 PM, Ghislain Fourny <
> ghislain.fourny@28msec.com> wrote:
>
>> One of the tests uses ext:nomaterialization without dash. Is this
>> intented?
>> --
>> https://code.launchpad.net/~zorba-coders/zorba/bug-1026250/+merge/138044
>> Your team Zorba Coders is subscribed to branch lp:zorba.
>>
>> --
>> Mailing list: https://launchpad.net/~zorba-coders
>> Post to : <email address hidden>
>> Unsubscribe : https://launchpad.net/~zorba-coders
>> More help : https://help.launchpad.net/ListHelp
>>
>
>

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Nice change.

The modifications in the following files don't seem to be needed:
- test/rbkt/Queries/zorba/updates/flwor1.xq
- test/rbkt/Queries/zorba/scripting/flwor6.xq
- test/rbkt/Queries/zorba/updates/flwor1.xq
- test/rbkt/Queries/zorba/no-copy/dataguide-c.xq

I'll add Markos as a second reviewer.

Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
lp:~zorba-coders/zorba/bug-1026250 updated
11097. By Federico Cavalieri

Completely reverted unnecessary test modifications

11098. By Federico Cavalieri

Reverted additional unnecessary test modification

11099. By Federico Cavalieri

Reverted further unnecessary modifications

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

Thanks for the review.
Can you explain me why
SYNC_CODE(theCollection->theLatch.rlock();)
and
SYNC_CODE(theCollection->theLatch.unlock();)
has been commented in this branch?
They were already commented in the branch when I started working on it.

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

> Thanks for the review.
> Can you explain me why
> SYNC_CODE(theCollection->theLatch.rlock();)
> and
> SYNC_CODE(theCollection->theLatch.unlock();)
> has been commented in this branch?
> They were already commented in the branch when I started working on it.
They were causing a deadlock when the collection being read from was modified. This is now fixed using collection versioning. The two lines can be removed.

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

I did not like very much the versioning solution for the collection deadlock. It certainly does not work with multi-threading. But this is not the only thing that is wrong for multi-threading, so I will approve.

I think a better solution would be that any dml:collection() function that is executed within a nonmaterialize pragma acquires the collection lock in exclussive mode. Of course that would require changes in the compiler, runtime, and store api.

review: Approve
Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

I did not like very much the versioning solution for the collection deadlock. It certainly does not work with multi-threading. But this is not the only thing that is wrong for multi-threading, so I will approve.

I think a better solution would be that any dml:collection() function that is executed within a nonmaterialize pragma acquires the collection lock in exclussive mode. Of course that would require changes in the compiler, runtime, and store api.

review: Approve
Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

Thanks for the feedback.
Merging

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

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/bug-1026250/+merge/138044

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

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

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/zorba/pregenerated/diagnostic_list.h'
--- include/zorba/pregenerated/diagnostic_list.h 2013-08-01 09:41:39 +0000
+++ include/zorba/pregenerated/diagnostic_list.h 2013-08-16 07:08:59 +0000
@@ -692,6 +692,8 @@
692692
693extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0040_INCONSISTENT_EDIT;693extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0040_INCONSISTENT_EDIT;
694694
695extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0041_CONCURRENT_MODIFICATION;
696
695extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDST0001_COLLECTION_ALREADY_DECLARED;697extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDST0001_COLLECTION_ALREADY_DECLARED;
696698
697extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDST0002_COLLECTION_ALREADY_IMPORTED;699extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDST0002_COLLECTION_ALREADY_IMPORTED;
698700
=== modified file 'modules/pregenerated/zorba-errors.xq'
--- modules/pregenerated/zorba-errors.xq 2013-08-07 05:28:39 +0000
+++ modules/pregenerated/zorba-errors.xq 2013-08-16 07:08:59 +0000
@@ -602,6 +602,10 @@
602602
603(:~603(:~
604:)604:)
605declare variable $zerr:ZDDY0041 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0041");
606
607(:~
608:)
605declare variable $zerr:ZDST0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZDST0001");609declare variable $zerr:ZDST0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZDST0001");
606610
607(:~611(:~
608612
=== modified file 'src/compiler/codegen/plan_visitor.cpp'
--- src/compiler/codegen/plan_visitor.cpp 2013-07-01 18:59:06 +0000
+++ src/compiler/codegen/plan_visitor.cpp 2013-08-16 07:08:59 +0000
@@ -935,6 +935,9 @@
935 935
936 if (v.is_sequential())936 if (v.is_sequential())
937 {937 {
938 pragma* pr = 0;
939 theCCB->lookup_pragma(&v, "no-materialization", pr);
940
938 if (!isGeneral)941 if (!isGeneral)
939 {942 {
940 if (v.has_sequential_clauses())943 if (v.has_sequential_clauses())
@@ -983,15 +986,13 @@
983986
984 // Note: a materialize clause may exist already in case plan serialization987 // Note: a materialize clause may exist already in case plan serialization
985 // is on (see comment in materialize_clause::clone)988 // is on (see comment in materialize_clause::clone)
986 if (!isGeneral &&989 if (!pr && !isGeneral &&
987 v.get_return_expr()->is_sequential() &&990 v.get_return_expr()->is_sequential() &&
988 v.get_clause(numClauses-1)->get_kind() != flwor_clause::materialize_clause &&991 v.get_clause(numClauses-1)->get_kind() != flwor_clause::materialize_clause &&
989 (v.get_order_clause() != NULL || v.get_group_clause() == NULL))992 (v.get_order_clause() != NULL || v.get_group_clause() == NULL))
990 {993 {
991 materialize_clause* mat =994 materialize_clause* mat = theCCB->theEM->create_materialize_clause(v.get_sctx(),
992 theCCB->theEM->create_materialize_clause(v.get_sctx(),
993 v.get_return_expr()->get_loc());995 v.get_return_expr()->get_loc());
994
995 v.add_clause(mat);996 v.add_clause(mat);
996 ++numClauses;997 ++numClauses;
997 }998 }
@@ -1027,7 +1028,7 @@
1027 ++numForClauses;1028 ++numForClauses;
1028 }1029 }
10291030
1030 if (domExpr->is_sequential() &&1031 if (!pr && domExpr->is_sequential() &&
1031 (k == flwor_clause::for_clause ||1032 (k == flwor_clause::for_clause ||
1032 k == flwor_clause::window_clause ||1033 k == flwor_clause::window_clause ||
1033 numForClauses > 0))1034 numForClauses > 0))
@@ -1066,8 +1067,8 @@
1066 break;1067 break;
1067 }1068 }
1068 default:1069 default:
1069 ZORBA_ASSERT(false);1070 ZORBA_ASSERT_WITH_MSG(false, "ClauseKind = " << k);
1070 }1071 } // switch
10711072
1072 ++i;1073 ++i;
1073 }1074 }
10741075
=== modified file 'src/compiler/expression/flwor_expr.cpp'
--- src/compiler/expression/flwor_expr.cpp 2013-06-14 04:50:39 +0000
+++ src/compiler/expression/flwor_expr.cpp 2013-08-16 07:08:59 +0000
@@ -52,6 +52,27 @@
52/*******************************************************************************52/*******************************************************************************
5353
54********************************************************************************/54********************************************************************************/
55std::ostream& operator<<( std::ostream &o, flwor_clause::ClauseKind k ) {
56 char const *const s[] = {
57 "for_clause",
58 "let_clause",
59 "window_clause",
60 "group_clause",
61 "order_clause",
62 "count_clause",
63 "where_clause",
64 "materialize_clause"
65 };
66 if ( k >= flwor_clause::for_clause && k <= flwor_clause::materialize_clause )
67 o << s[k];
68 else
69 o << "[invalid ClauseKind: " << (int)k << ']';
70 return o;
71}
72
73/*******************************************************************************
74
75********************************************************************************/
55forletwin_clause::forletwin_clause(76forletwin_clause::forletwin_clause(
56 static_context* sctx,77 static_context* sctx,
57 CompilerCB* ccb,78 CompilerCB* ccb,
@@ -671,7 +692,7 @@
671 expr::substitution_t& subst) const692 expr::substitution_t& subst) const
672{693{
673 // we will reach here under the following scenario:694 // we will reach here under the following scenario:
674 // 1. We do plan seriazation695 // 1. We do plan serialization
675 // 2. getPlan is called on udf A; this causes a mat clause to be created696 // 2. getPlan is called on udf A; this causes a mat clause to be created
676 // during the codegen on A's body697 // during the codegen on A's body
677 // 3. getPlan is called on udf B, which invokes A, and A's body is698 // 3. getPlan is called on udf B, which invokes A, and A's body is
678699
=== modified file 'src/compiler/expression/flwor_expr.h'
--- src/compiler/expression/flwor_expr.h 2013-06-14 04:50:39 +0000
+++ src/compiler/expression/flwor_expr.h 2013-08-16 07:08:59 +0000
@@ -50,7 +50,7 @@
50public:50public:
51 typedef var_rebind_list_t rebind_list_t;51 typedef var_rebind_list_t rebind_list_t;
5252
53 typedef enum53 enum ClauseKind
54 {54 {
55 for_clause,55 for_clause,
56 let_clause,56 let_clause,
@@ -60,7 +60,8 @@
60 count_clause,60 count_clause,
61 where_clause,61 where_clause,
62 materialize_clause62 materialize_clause
63 } ClauseKind;63 // if you change this, also ensure that operator<< for it is still correct
64 };
6465
65protected:66protected:
66 static_context * theContext;67 static_context * theContext;
@@ -106,6 +107,8 @@
106 expr::substitution_t& substitution) const = 0;107 expr::substitution_t& substitution) const = 0;
107};108};
108109
110// for debugging
111std::ostream& operator<<( std::ostream&, flwor_clause::ClauseKind );
109112
110/***************************************************************************//**113/***************************************************************************//**
111114
112115
=== modified file 'src/compiler/parser/parser.y'
--- src/compiler/parser/parser.y 2013-06-17 20:05:21 +0000
+++ src/compiler/parser/parser.y 2013-08-16 07:08:59 +0000
@@ -4048,16 +4048,10 @@
40484048
4049// [64]4049// [64]
4050ExtensionExpr :4050ExtensionExpr :
4051 Pragma_list LBRACE RBRACE4051 Pragma_list BlockExpr
4052 {4052 {
4053 $$ = new ExtensionExpr(4053 $$ = new ExtensionExpr(
4054 LOC(@$), dynamic_cast<PragmaList*>($1), NULL4054 LOC(@$), dynamic_cast<PragmaList*>($1), $2
4055 );
4056 }
4057 | Pragma_list LBRACE Expr RBRACE
4058 {
4059 $$ = new ExtensionExpr(
4060 LOC(@$), dynamic_cast<PragmaList*>($1), $3
4061 );4055 );
4062 }4056 }
4063 ;4057 ;
40644058
=== modified file 'src/compiler/parsetree/parsenodes.h'
--- src/compiler/parsetree/parsenodes.h 2013-08-05 13:20:52 +0000
+++ src/compiler/parsetree/parsenodes.h 2013-08-16 07:08:59 +0000
@@ -3506,7 +3506,7 @@
35063506
35073507
3508/*******************************************************************************3508/*******************************************************************************
3509 [88] ExtensionExpr ::= PragmaList "{" Expr? "}"3509 [88] ExtensionExpr ::= PragmaList BlockExpr
3510********************************************************************************/3510********************************************************************************/
3511class ExtensionExpr : public exprnode3511class ExtensionExpr : public exprnode
3512{3512{
35133513
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp 2013-08-12 09:28:02 +0000
+++ src/compiler/translator/translator.cpp 2013-08-16 07:08:59 +0000
@@ -2451,6 +2451,31 @@
2451}2451}
24522452
24532453
2454/*******************************************************************************
2455********************************************************************************/
2456void
2457recognizePragma(expr* e, const zstring& aLocalName)
2458{
2459 for (std::vector<pragma*>::const_iterator lIter = theScopedPragmas.begin();
2460 lIter != theScopedPragmas.end();
2461 ++lIter)
2462 {
2463 pragma* p = *lIter;
2464 if (p->theQName->getNamespace() == ZORBA_EXTENSIONS_NS)
2465 {
2466 if (p->theQName->getLocalName() == aLocalName)
2467 {
2468 e->get_ccb()->add_pragma(e, p);
2469 e->setContainsPragma(ANNOTATION_TRUE);
2470 break;
2471 }
2472 }
2473 }
2474}
2475
2476
2477
2478
2454/////////////////////////////////////////////////////////////////////////////////2479/////////////////////////////////////////////////////////////////////////////////
2455// //2480// //
2456// Module, VersionDecl, MainModule, LibraryModule, ModuleDecl //2481// Module, VersionDecl, MainModule, LibraryModule, ModuleDecl //
@@ -6938,6 +6963,8 @@
69386963
6939 theFlworClausesStack.resize(curClausePos);6964 theFlworClausesStack.resize(curClausePos);
69406965
6966 recognizePragma(flwor, "no-materialization");
6967
6941 push_nodestack(flwor);6968 push_nodestack(flwor);
6942}6969}
69436970
69446971
=== modified file 'src/diagnostics/diagnostic_en.xml'
--- src/diagnostics/diagnostic_en.xml 2013-08-14 04:05:45 +0000
+++ src/diagnostics/diagnostic_en.xml 2013-08-16 07:08:59 +0000
@@ -2279,7 +2279,7 @@
2279 A Zorba programming assertion failed. If this error occurs, it is a bug2279 A Zorba programming assertion failed. If this error occurs, it is a bug
2280 and should be reported.2280 and should be reported.
2281 </comment>2281 </comment>
2282 <value>"$1": assertion failed.${ The following information might help: 2}</value>2282 <value>"$1": assertion failed${ with the message: 2}</value>
2283 </diagnostic>2283 </diagnostic>
22842284
2285 <diagnostic code="ZXQP0003" name="INTERNAL_ERROR">2285 <diagnostic code="ZXQP0003" name="INTERNAL_ERROR">
@@ -2847,6 +2847,10 @@
2847 <diagnostic code="ZDDY0040" name="INCONSISTENT_EDIT">2847 <diagnostic code="ZDDY0040" name="INCONSISTENT_EDIT">
2848 <value>attempt to edit an item with a template of a different kind (for example an object with a node).</value>2848 <value>attempt to edit an item with a template of a different kind (for example an object with a node).</value>
2849 </diagnostic>2849 </diagnostic>
2850
2851 <diagnostic code="ZDDY0041" name="CONCURRENT_MODIFICATION">
2852 <value>"$1": collection was modified while reading</value>
2853 </diagnostic>
28502854
2851 <diagnostic code="ZDST0001" name="COLLECTION_ALREADY_DECLARED">2855 <diagnostic code="ZDST0001" name="COLLECTION_ALREADY_DECLARED">
2852 <value>"$1": collection already declared</value>2856 <value>"$1": collection already declared</value>
28532857
=== modified file 'src/diagnostics/pregenerated/diagnostic_list.cpp'
--- src/diagnostics/pregenerated/diagnostic_list.cpp 2013-08-01 09:41:39 +0000
+++ src/diagnostics/pregenerated/diagnostic_list.cpp 2013-08-16 07:08:59 +0000
@@ -1017,6 +1017,9 @@
1017ZorbaErrorCode ZDDY0040_INCONSISTENT_EDIT( "ZDDY0040" );1017ZorbaErrorCode ZDDY0040_INCONSISTENT_EDIT( "ZDDY0040" );
10181018
10191019
1020ZorbaErrorCode ZDDY0041_CONCURRENT_MODIFICATION( "ZDDY0041" );
1021
1022
1020ZorbaErrorCode ZDST0001_COLLECTION_ALREADY_DECLARED( "ZDST0001" );1023ZorbaErrorCode ZDST0001_COLLECTION_ALREADY_DECLARED( "ZDST0001" );
10211024
10221025
10231026
=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
--- src/diagnostics/pregenerated/dict_en.cpp 2013-08-14 04:12:57 +0000
+++ src/diagnostics/pregenerated/dict_en.cpp 2013-08-16 07:08:59 +0000
@@ -356,6 +356,7 @@
356 { "ZDDY0038", "\"$1\": illegal edit from queue collection" },356 { "ZDDY0038", "\"$1\": illegal edit from queue collection" },
357 { "ZDDY0039", "attempt to edit non-root node in collection \"$1\"" },357 { "ZDDY0039", "attempt to edit non-root node in collection \"$1\"" },
358 { "ZDDY0040", "attempt to edit an item with a template of a different kind (for example an object with a node)." },358 { "ZDDY0040", "attempt to edit an item with a template of a different kind (for example an object with a node)." },
359 { "ZDDY0041", "\"$1\": collection was modified while reading" },
359 { "ZDST0001", "\"$1\": collection already declared" },360 { "ZDST0001", "\"$1\": collection already declared" },
360 { "ZDST0002", "\"$1\": collection already imported into module \"$2\"" },361 { "ZDST0002", "\"$1\": collection already imported into module \"$2\"" },
361 { "ZDST0003", "\"$1\": collection declaration not allowed in main module" },362 { "ZDST0003", "\"$1\": collection declaration not allowed in main module" },
@@ -462,7 +463,7 @@
462 { "ZXQD0006", "\"$1\": invalid UTF-8 byte sequence" },463 { "ZXQD0006", "\"$1\": invalid UTF-8 byte sequence" },
463 { "ZXQP0000", "no error" },464 { "ZXQP0000", "no error" },
464 { "ZXQP0001", "dynamic runtime error${: 1}" },465 { "ZXQP0001", "dynamic runtime error${: 1}" },
465 { "ZXQP0002", "\"$1\": assertion failed.${ The following information might help: 2}" },466 { "ZXQP0002", "\"$1\": assertion failed${ with the message: 2}" },
466 { "ZXQP0003", "internal error${: 1}" },467 { "ZXQP0003", "internal error${: 1}" },
467 { "ZXQP0004", "not yet implemented: $1" },468 { "ZXQP0004", "not yet implemented: $1" },
468 { "ZXQP0005", "\"$1\": feature not enabled" },469 { "ZXQP0005", "\"$1\": feature not enabled" },
469470
=== modified file 'src/store/naive/simple_collection.cpp'
--- src/store/naive/simple_collection.cpp 2013-06-15 02:57:08 +0000
+++ src/store/naive/simple_collection.cpp 2013-08-16 07:08:59 +0000
@@ -41,8 +41,9 @@
41 bool isDynamic)41 bool isDynamic)
42 : 42 :
43 Collection(name),43 Collection(name),
44 theIsDynamic(isDynamic),44 theIsDynamic(isDynamic),
45 theAnnotations(annotations)45 theAnnotations(annotations),
46 theVersion(0)
46{47{
47 theId = GET_STORE().createCollectionId();48 theId = GET_STORE().createCollectionId();
48 theTreeIdGenerator = GET_STORE().getTreeIdGeneratorFactory().createTreeGenerator(0);49 theTreeIdGenerator = GET_STORE().getTreeIdGeneratorFactory().createTreeGenerator(0);
@@ -55,7 +56,8 @@
55********************************************************************************/56********************************************************************************/
56SimpleCollection::SimpleCollection()57SimpleCollection::SimpleCollection()
57 : 58 :
58 theIsDynamic(false)59 theIsDynamic(false),
60 theVersion(0)
59{61{
60 theTreeIdGenerator = GET_STORE().getTreeIdGeneratorFactory().createTreeGenerator(0);62 theTreeIdGenerator = GET_STORE().getTreeIdGeneratorFactory().createTreeGenerator(0);
61}63}
@@ -282,7 +284,8 @@
282 ERROR_PARAMS(ZED(ZXQD0004_NOT_WITHIN_RANGE), position)284 ERROR_PARAMS(ZED(ZXQD0004_NOT_WITHIN_RANGE), position)
283 );285 );
284 }286 }
285287
288 ++theVersion;
286}289}
287290
288291
@@ -382,6 +385,8 @@
382 theTrees[targetPos + i].transfer(items[i]);385 theTrees[targetPos + i].transfer(items[i]);
383 }386 }
384387
388 ++theVersion;
389
385 return xs_integer(targetPos);390 return xs_integer(targetPos);
386}391}
387392
@@ -415,6 +420,7 @@
415 {420 {
416 csize pos = to_xs_unsignedInt(position);421 csize pos = to_xs_unsignedInt(position);
417 theTrees.erase(theTrees.begin() + pos);422 theTrees.erase(theTrees.begin() + pos);
423 ++theVersion;
418 return true;424 return true;
419 }425 }
420 catch (const std::range_error&)426 catch (const std::range_error&)
@@ -468,6 +474,7 @@
468 structuredItem->detachFromCollection();474 structuredItem->detachFromCollection();
469475
470 theTrees.erase(theTrees.begin() + pos);476 theTrees.erase(theTrees.begin() + pos);
477 ++theVersion;
471 return true;478 return true;
472 }479 }
473}480}
@@ -533,6 +540,7 @@
533 theTrees.erase(theTrees.begin() + pos);540 theTrees.erase(theTrees.begin() + pos);
534 }541 }
535542
543 ++theVersion;
536 return xs_integer(last - pos);544 return xs_integer(last - pos);
537 }545 }
538}546}
@@ -623,11 +631,14 @@
623********************************************************************************/631********************************************************************************/
624void SimpleCollection::CollectionIter::open()632void SimpleCollection::CollectionIter::open()
625{633{
626 SYNC_CODE(theCollection->theLatch.rlock();)634 //SYNC_CODE(theCollection->theLatch.rlock();)
627 theHaveLock = true;635 theHaveLock = true;
628636
629 theIterator = theCollection->theTrees.begin();637 theIterator = theCollection->theTrees.begin();
630 theEnd = theCollection->theTrees.end();638 theEnd = theCollection->theTrees.end();
639
640 theVersion = theCollection->theVersion;
641
631 skip();642 skip();
632}643}
633644
@@ -637,6 +648,12 @@
637********************************************************************************/648********************************************************************************/
638bool SimpleCollection::CollectionIter::next(store::Item_t& result)649bool SimpleCollection::CollectionIter::next(store::Item_t& result)
639{650{
651 if (theVersion != theCollection->theVersion)
652 {
653 throw ZORBA_EXCEPTION(zerr::ZDDY0041_CONCURRENT_MODIFICATION,
654 ERROR_PARAMS(theCollection->getName()->getStringValue()));
655 }
656
640 if (!theHaveLock) 657 if (!theHaveLock)
641 {658 {
642 throw ZORBA_EXCEPTION(zerr::ZDDY0019_COLLECTION_ITERATOR_NOT_OPEN,659 throw ZORBA_EXCEPTION(zerr::ZDDY0019_COLLECTION_ITERATOR_NOT_OPEN,
@@ -663,6 +680,8 @@
663{680{
664 theIterator = theCollection->theTrees.begin();681 theIterator = theCollection->theTrees.begin();
665 theEnd = theCollection->theTrees.end();682 theEnd = theCollection->theTrees.end();
683
684 theVersion = theCollection->theVersion;
666 skip();685 skip();
667}686}
668687
@@ -674,7 +693,7 @@
674{693{
675 assert(theHaveLock);694 assert(theHaveLock);
676 theHaveLock = false;695 theHaveLock = false;
677 SYNC_CODE(theCollection->theLatch.unlock();)696 //SYNC_CODE(theCollection->theLatch.unlock();)
678}697}
679698
680} // namespace simplestore699} // namespace simplestore
681700
=== modified file 'src/store/naive/simple_collection.h'
--- src/store/naive/simple_collection.h 2013-02-26 04:12:43 +0000
+++ src/store/naive/simple_collection.h 2013-08-16 07:08:59 +0000
@@ -84,6 +84,7 @@
84 checked_vector<store::Item_t>::iterator theEnd;84 checked_vector<store::Item_t>::iterator theEnd;
85 bool theHaveLock;85 bool theHaveLock;
86 csize theSkip;86 csize theSkip;
87 ulong theVersion;
8788
88 public:89 public:
89 CollectionIter(SimpleCollection* collection, const xs_integer& skip);90 CollectionIter(SimpleCollection* collection, const xs_integer& skip);
@@ -111,6 +112,8 @@
111112
112 const std::vector<store::Annotation_t> theAnnotations;113 const std::vector<store::Annotation_t> theAnnotations;
113114
115 ulong theVersion;
116
114 SYNC_CODE(Latch theLatch;)117 SYNC_CODE(Latch theLatch;)
115118
116protected:119protected:
117120
=== added file 'test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor24.iter'
--- test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor24.iter 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor24.iter 2013-08-16 07:08:59 +0000
@@ -0,0 +1,56 @@
1Iterator tree for const-folded expr:
2<FunctionTraceIterator>
3 <FnConcatIterator/>
4</FunctionTraceIterator>
5
6Iterator tree for main query:
7<SequentialIterator>
8 <CtxVarDeclareIterator varid="4" varname="xmlcontents">
9 <UDFunctionCallIterator function="fetch:content">
10 <SingletonIterator value="xs:string($RBKT_SRC_DIR/Queries/zorba/flwor/flwor24.xml)"/>
11 </UDFunctionCallIterator>
12 </CtxVarDeclareIterator>
13 <flwor::FLWORIterator>
14 <ForVariable name="w">
15 <FnZorbaParseXmlFragmentIterator>
16 <PromoteIterator type="xs:string">
17 <FnDataIterator>
18 <CtxVarIterator varid="4" varname="xmlcontents" varkind="local"/>
19 </FnDataIterator>
20 </PromoteIterator>
21 <TreatIterator type="[NodeXQType elementNode nametest=[uri: http://zorba.io/modules/xml-options, local: options] content=[XQType ANY_TYPE_KIND*]]" quant="?">
22 <ElementIterator>
23 <SingletonIterator value="xs:QName(http://zorba.io/modules/xml-options,opt,options)"/>
24 <ElementIterator>
25 <SingletonIterator value="xs:QName(http://zorba.io/modules/xml-options,opt,parse-external-parsed-entity)"/>
26 <AttributeIterator qname="xs:QName(http://zorba.io/modules/xml-options,opt,skip-root-nodes)">
27 <SingletonIterator value="xs:string(1)"/>
28 </AttributeIterator>
29 </ElementIterator>
30 </ElementIterator>
31 </TreatIterator>
32 </FnZorbaParseXmlFragmentIterator>
33 </ForVariable>
34 <MaterializeClause>
35 <MaterializeForVariable inputVar="w : "/>
36 </MaterializeClause>
37 <ReturnClause>
38 <SequentialIterator>
39 <ApplyIterator>
40 <FnConcatIterator/>
41 </ApplyIterator>
42 <ForVarIterator varname="w"/>
43 </SequentialIterator>
44 </ReturnClause>
45 </flwor::FLWORIterator>
46</SequentialIterator>
47
48Iterator tree for fetch:content:
49<FunctionTraceIterator>
50 <FetchContentIterator>
51 <LetVarIterator varname="uri"/>
52 <SingletonIterator value="xs:string(SOME_CONTENT)"/>
53 <SingletonIterator value="xs:string(UTF-8)"/>
54 </FetchContentIterator>
55</FunctionTraceIterator>
56
057
=== added file 'test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor25.iter'
--- test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor25.iter 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor25.iter 2013-08-16 07:08:59 +0000
@@ -0,0 +1,56 @@
1Iterator tree for const-folded expr:
2<FunctionTraceIterator>
3 <FnConcatIterator/>
4</FunctionTraceIterator>
5
6Iterator tree for main query:
7<SequentialIterator>
8 <CtxVarDeclareIterator varid="4" varname="xmlcontents">
9 <UDFunctionCallIterator function="fetch:content">
10 <SingletonIterator value="xs:string($RBKT_SRC_DIR/Queries/zorba/flwor/flwor24.xml)"/>
11 </UDFunctionCallIterator>
12 </CtxVarDeclareIterator>
13 <CtxVarDeclareIterator varid="5" varname="contents">
14 <FnZorbaParseXmlFragmentIterator>
15 <PromoteIterator type="xs:string">
16 <FnDataIterator>
17 <CtxVarIterator varid="4" varname="xmlcontents" varkind="local"/>
18 </FnDataIterator>
19 </PromoteIterator>
20 <TreatIterator type="[NodeXQType elementNode nametest=[uri: http://zorba.io/modules/xml-options, local: options] content=[XQType ANY_TYPE_KIND*]]" quant="?">
21 <ElementIterator>
22 <SingletonIterator value="xs:QName(http://zorba.io/modules/xml-options,opt,options)"/>
23 <ElementIterator>
24 <SingletonIterator value="xs:QName(http://zorba.io/modules/xml-options,opt,parse-external-parsed-entity)"/>
25 <AttributeIterator qname="xs:QName(http://zorba.io/modules/xml-options,opt,skip-root-nodes)">
26 <SingletonIterator value="xs:string(1)"/>
27 </AttributeIterator>
28 </ElementIterator>
29 </ElementIterator>
30 </TreatIterator>
31 </FnZorbaParseXmlFragmentIterator>
32 </CtxVarDeclareIterator>
33 <flwor::FLWORIterator>
34 <ForVariable name="w">
35 <CtxVarIterator varid="5" varname="contents" varkind="local"/>
36 </ForVariable>
37 <ReturnClause>
38 <SequentialIterator>
39 <ApplyIterator>
40 <FnConcatIterator/>
41 </ApplyIterator>
42 <ForVarIterator varname="w"/>
43 </SequentialIterator>
44 </ReturnClause>
45 </flwor::FLWORIterator>
46</SequentialIterator>
47
48Iterator tree for fetch:content:
49<FunctionTraceIterator>
50 <FetchContentIterator>
51 <LetVarIterator varname="uri"/>
52 <SingletonIterator value="xs:string(SOME_CONTENT)"/>
53 <SingletonIterator value="xs:string(UTF-8)"/>
54 </FetchContentIterator>
55</FunctionTraceIterator>
56
057
=== added file 'test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor26.iter'
--- test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor26.iter 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor26.iter 2013-08-16 07:08:59 +0000
@@ -0,0 +1,66 @@
1Iterator tree for main query:
2<SequentialIterator>
3 <CtxVarDeclareIterator varid="4" varname="coll">
4 <SingletonIterator value="xs:QName(http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl,ddl,coll1)"/>
5 </CtxVarDeclareIterator>
6 <SequentialIterator>
7 <ApplyIterator>
8 <ZorbaCreateCollectionIterator>
9 <CtxVarIterator varid="4" varname="coll" varkind="global"/>
10 </ZorbaCreateCollectionIterator>
11 </ApplyIterator>
12 <ApplyIterator>
13 <ZorbaInsertNodesLastIterator is-dynamic="true" need-to-copy="true">
14 <CtxVarIterator varid="4" varname="coll" varkind="global"/>
15 <FnConcatIterator>
16 <ElementIterator>
17 <SingletonIterator value="xs:QName(,,a)"/>
18 </ElementIterator>
19 <ElementIterator>
20 <SingletonIterator value="xs:QName(,,c)"/>
21 </ElementIterator>
22 <ElementIterator>
23 <SingletonIterator value="xs:QName(,,b)"/>
24 </ElementIterator>
25 </FnConcatIterator>
26 </ZorbaInsertNodesLastIterator>
27 </ApplyIterator>
28 <flwor::FLWORIterator>
29 <ForVariable name="w">
30 <ZorbaCollectionIterator>
31 <CtxVarIterator varid="4" varname="coll" varkind="global"/>
32 </ZorbaCollectionIterator>
33 </ForVariable>
34 <ReturnClause>
35 <SequentialIterator>
36 <ApplyIterator>
37 <FunctionTraceIterator>
38 <IfThenElseIterator>
39 <TypedValueCompareIterator_INTEGER>
40 <ForVarIterator varname="pos"/>
41 <SingletonIterator value="xs:integer(1)"/>
42 </TypedValueCompareIterator_INTEGER>
43 <ApplyIterator>
44 <ZorbaInsertNodesLastIterator is-dynamic="true" need-to-copy="true">
45 <CtxVarIterator varid="4" varname="coll" varkind="global"/>
46 <ElementIterator>
47 <SingletonIterator value="xs:QName(,,d)"/>
48 <EnclosedIterator attr_cont="false">
49 <ForVarIterator varname="pos"/>
50 </EnclosedIterator>
51 </ElementIterator>
52 </ZorbaInsertNodesLastIterator>
53 </ApplyIterator>
54 <ApplyIterator>
55 <FnConcatIterator/>
56 </ApplyIterator>
57 </IfThenElseIterator>
58 </FunctionTraceIterator>
59 </ApplyIterator>
60 <ForVarIterator varname="w"/>
61 </SequentialIterator>
62 </ReturnClause>
63 </flwor::FLWORIterator>
64 </SequentialIterator>
65</SequentialIterator>
66
067
=== added file 'test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor27.iter'
--- test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor27.iter 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor27.iter 2013-08-16 07:08:59 +0000
@@ -0,0 +1,63 @@
1Iterator tree for const-folded expr:
2<FunctionTraceIterator>
3 <FnConcatIterator/>
4</FunctionTraceIterator>
5
6Iterator tree for main query:
7<SequentialIterator>
8 <CtxVarDeclareIterator varid="4" varname="xmlcontents">
9 <UDFunctionCallIterator function="fetch:content">
10 <SingletonIterator value="xs:string($RBKT_SRC_DIR/Queries/zorba/flwor/flwor24.xml)"/>
11 </UDFunctionCallIterator>
12 </CtxVarDeclareIterator>
13 <CtxVarDeclareIterator varid="5" varname="contents">
14 <FnZorbaParseXmlFragmentIterator>
15 <PromoteIterator type="xs:string">
16 <FnDataIterator>
17 <CtxVarIterator varid="4" varname="xmlcontents" varkind="local"/>
18 </FnDataIterator>
19 </PromoteIterator>
20 <TreatIterator type="[NodeXQType elementNode nametest=[uri: http://zorba.io/modules/xml-options, local: options] content=[XQType ANY_TYPE_KIND*]]" quant="?">
21 <ElementIterator>
22 <SingletonIterator value="xs:QName(http://zorba.io/modules/xml-options,opt,options)"/>
23 <ElementIterator>
24 <SingletonIterator value="xs:QName(http://zorba.io/modules/xml-options,opt,parse-external-parsed-entity)"/>
25 <AttributeIterator qname="xs:QName(http://zorba.io/modules/xml-options,opt,skip-root-nodes)">
26 <SingletonIterator value="xs:string(1)"/>
27 </AttributeIterator>
28 </ElementIterator>
29 </ElementIterator>
30 </TreatIterator>
31 </FnZorbaParseXmlFragmentIterator>
32 </CtxVarDeclareIterator>
33 <flwor::FLWORIterator>
34 <ForVariable name="w">
35 <CtxVarIterator varid="5" varname="contents" varkind="local"/>
36 </ForVariable>
37 <OrderBySpec>
38 <FnLocalNameIterator>
39 <TreatIterator type="[NodeXQType anyNode content=[XQType ANY_TYPE_KIND*]]" quant="?">
40 <ForVarIterator varname="w"/>
41 </TreatIterator>
42 </FnLocalNameIterator>
43 </OrderBySpec>
44 <ReturnClause>
45 <SequentialIterator>
46 <ApplyIterator>
47 <FnConcatIterator/>
48 </ApplyIterator>
49 <ForVarIterator varname="w"/>
50 </SequentialIterator>
51 </ReturnClause>
52 </flwor::FLWORIterator>
53</SequentialIterator>
54
55Iterator tree for fetch:content:
56<FunctionTraceIterator>
57 <FetchContentIterator>
58 <LetVarIterator varname="uri"/>
59 <SingletonIterator value="xs:string(SOME_CONTENT)"/>
60 <SingletonIterator value="xs:string(UTF-8)"/>
61 </FetchContentIterator>
62</FunctionTraceIterator>
63
064
=== added file 'test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor28.iter'
--- test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor28.iter 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor28.iter 2013-08-16 07:08:59 +0000
@@ -0,0 +1,57 @@
1Iterator tree for const-folded expr:
2<FunctionTraceIterator>
3 <FnConcatIterator/>
4</FunctionTraceIterator>
5
6Iterator tree for main query:
7<SequentialIterator>
8 <CtxVarDeclareIterator varid="4" varname="coll">
9 <SingletonIterator value="xs:QName(http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl,ddl,coll1)"/>
10 </CtxVarDeclareIterator>
11 <SequentialIterator>
12 <ApplyIterator>
13 <ZorbaCreateCollectionIterator>
14 <CtxVarIterator varid="4" varname="coll" varkind="global"/>
15 </ZorbaCreateCollectionIterator>
16 </ApplyIterator>
17 <ApplyIterator>
18 <ZorbaInsertNodesLastIterator is-dynamic="true" need-to-copy="true">
19 <CtxVarIterator varid="4" varname="coll" varkind="global"/>
20 <FnConcatIterator>
21 <ElementIterator>
22 <SingletonIterator value="xs:QName(,,a)"/>
23 </ElementIterator>
24 <ElementIterator>
25 <SingletonIterator value="xs:QName(,,c)"/>
26 </ElementIterator>
27 <ElementIterator>
28 <SingletonIterator value="xs:QName(,,b)"/>
29 </ElementIterator>
30 </FnConcatIterator>
31 </ZorbaInsertNodesLastIterator>
32 </ApplyIterator>
33 <flwor::FLWORIterator>
34 <ForVariable name="w">
35 <ZorbaCollectionIterator>
36 <CtxVarIterator varid="4" varname="coll" varkind="global"/>
37 </ZorbaCollectionIterator>
38 </ForVariable>
39 <OrderBySpec>
40 <FnLocalNameIterator>
41 <TreatIterator type="[NodeXQType anyNode content=[XQType ANY_TYPE_KIND*]]" quant="?">
42 <ForVarIterator varname="w"/>
43 </TreatIterator>
44 </FnLocalNameIterator>
45 </OrderBySpec>
46 <ReturnClause>
47 <SequentialIterator>
48 <ApplyIterator>
49 <FnConcatIterator/>
50 </ApplyIterator>
51 <ForVarIterator varname="w"/>
52 </SequentialIterator>
53 </ReturnClause>
54 </flwor::FLWORIterator>
55 </SequentialIterator>
56</SequentialIterator>
57
058
=== added file 'test/rbkt/ExpQueryResults/zorba/flwor/flwor24.xml.res'
--- test/rbkt/ExpQueryResults/zorba/flwor/flwor24.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/flwor/flwor24.xml.res 2013-08-16 07:08:59 +0000
@@ -0,0 +1,1 @@
1<a/><c/><b/>
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/rbkt/ExpQueryResults/zorba/flwor/flwor25.xml.res'
--- test/rbkt/ExpQueryResults/zorba/flwor/flwor25.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/flwor/flwor25.xml.res 2013-08-16 07:08:59 +0000
@@ -0,0 +1,1 @@
1<a/><c/><b/>
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/rbkt/ExpQueryResults/zorba/flwor/flwor27.xml.res'
--- test/rbkt/ExpQueryResults/zorba/flwor/flwor27.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/flwor/flwor27.xml.res 2013-08-16 07:08:59 +0000
@@ -0,0 +1,1 @@
1<c/><b/><a/>
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/rbkt/ExpQueryResults/zorba/flwor/flwor28.xml.res'
--- test/rbkt/ExpQueryResults/zorba/flwor/flwor28.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/flwor/flwor28.xml.res 2013-08-16 07:08:59 +0000
@@ -0,0 +1,1 @@
1<c/><b/><a/>
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/rbkt/ExpQueryResults/zorba/scripting/flwor2.xml.res'
--- test/rbkt/ExpQueryResults/zorba/scripting/flwor2.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/scripting/flwor2.xml.res 2013-08-16 07:08:59 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2true
03
=== removed file 'test/rbkt/ExpQueryResults/zorba/scripting/flwor2.xml.res'
--- test/rbkt/ExpQueryResults/zorba/scripting/flwor2.xml.res 2013-02-07 17:24:36 +0000
+++ test/rbkt/ExpQueryResults/zorba/scripting/flwor2.xml.res 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2true
30
=== added file 'test/rbkt/Queries/zorba/flwor/flwor24.xml'
--- test/rbkt/Queries/zorba/flwor/flwor24.xml 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/flwor/flwor24.xml 2013-08-16 07:08:59 +0000
@@ -0,0 +1,5 @@
1<root>
2 <a/>
3 <c/>
4 <b/>
5</root>
0\ No newline at end of file6\ No newline at end of file
17
=== added file 'test/rbkt/Queries/zorba/flwor/flwor24.xq'
--- test/rbkt/Queries/zorba/flwor/flwor24.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/flwor/flwor24.xq 2013-08-16 07:08:59 +0000
@@ -0,0 +1,25 @@
1import module namespace parse-xml = "http://zorba.io/modules/xml";
2import schema namespace opt = "http://zorba.io/modules/xml-options";
3import module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";
4
5declare namespace an = "http://zorba.io/annotations";
6
7declare %an:sequential function local:test-sequential()
8{
9
10};
11
12variable $xmlcontents := fetch:content("$RBKT_SRC_DIR/Queries/zorba/flwor/flwor24.xml");
13
14let $contents := parse-xml:parse(
15 $xmlcontents,
16 <opt:options>
17 <opt:parse-external-parsed-entity opt:skip-root-nodes="1" />
18 </opt:options>)
19
20for $w at $pos in $contents
21return
22{
23 local:test-sequential();
24 $w
25}
0\ No newline at end of file26\ No newline at end of file
127
=== added file 'test/rbkt/Queries/zorba/flwor/flwor25.xq'
--- test/rbkt/Queries/zorba/flwor/flwor25.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/flwor/flwor25.xq 2013-08-16 07:08:59 +0000
@@ -0,0 +1,29 @@
1import module namespace parse-xml = "http://zorba.io/modules/xml";
2import schema namespace opt = "http://zorba.io/modules/xml-options";
3import module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";
4
5declare namespace an = "http://zorba.io/annotations";
6declare namespace ext = "http://zorba.io/extensions";
7
8declare %an:sequential function local:test-sequential()
9{
10
11};
12
13variable $xmlcontents := fetch:content("$RBKT_SRC_DIR/Queries/zorba/flwor/flwor24.xml");
14
15variable $contents := parse-xml:parse(
16 $xmlcontents,
17 <opt:options>
18 <opt:parse-external-parsed-entity opt:skip-root-nodes="1" />
19 </opt:options>);
20
21(# ext:no-materialization #)
22{
23 for $w at $pos in $contents
24 return
25 {
26 local:test-sequential();
27 $w
28 }
29}
0\ No newline at end of file30\ No newline at end of file
131
=== added file 'test/rbkt/Queries/zorba/flwor/flwor26.spec'
--- test/rbkt/Queries/zorba/flwor/flwor26.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/flwor/flwor26.spec 2013-08-16 07:08:59 +0000
@@ -0,0 +1,1 @@
1Error: http://zorba.io/errors:ZDDY0041
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'test/rbkt/Queries/zorba/flwor/flwor26.xq'
--- test/rbkt/Queries/zorba/flwor/flwor26.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/flwor/flwor26.xq 2013-08-16 07:08:59 +0000
@@ -0,0 +1,30 @@
1import module namespace parse-xml = "http://zorba.io/modules/xml";
2import schema namespace opt = "http://zorba.io/modules/xml-options";
3import module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";
4import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
5import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
6
7declare namespace an = "http://zorba.io/annotations";
8declare namespace ext = "http://zorba.io/extensions";
9
10declare variable $coll := xs:QName("ddl:coll1");
11
12declare %an:sequential function local:test-sequential($pos)
13{
14 if ($pos eq 1)
15 then dml:insert-nodes-last($coll, <d>{$pos}</d>);
16 else ();
17};
18
19ddl:create($coll);
20dml:insert-nodes-last($coll, (<a/>,<c/>,<b/>));
21
22(# ext:no-materialization #)
23{
24 for $w at $pos in dml:collection($coll)
25 return
26 {
27 local:test-sequential($pos);
28 $w
29 }
30}
0\ No newline at end of file31\ No newline at end of file
132
=== added file 'test/rbkt/Queries/zorba/flwor/flwor27.xq'
--- test/rbkt/Queries/zorba/flwor/flwor27.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/flwor/flwor27.xq 2013-08-16 07:08:59 +0000
@@ -0,0 +1,30 @@
1import module namespace parse-xml = "http://zorba.io/modules/xml";
2import schema namespace opt = "http://zorba.io/modules/xml-options";
3import module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";
4
5declare namespace an = "http://zorba.io/annotations";
6declare namespace ext = "http://zorba.io/extensions";
7
8declare %an:sequential function local:test-sequential($pos)
9{
10
11};
12
13variable $xmlcontents := fetch:content("$RBKT_SRC_DIR/Queries/zorba/flwor/flwor24.xml");
14
15variable $contents := parse-xml:parse(
16 $xmlcontents,
17 <opt:options>
18 <opt:parse-external-parsed-entity opt:skip-root-nodes="1" />
19 </opt:options>);
20
21(# ext:no-materialization #)
22{
23 for $w at $pos in $contents
24 order by local-name($w) descending
25 return
26 {
27 local:test-sequential($pos);
28 $w
29 }
30}
0\ No newline at end of file31\ No newline at end of file
132
=== added file 'test/rbkt/Queries/zorba/flwor/flwor28.xq'
--- test/rbkt/Queries/zorba/flwor/flwor28.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/flwor/flwor28.xq 2013-08-16 07:08:59 +0000
@@ -0,0 +1,29 @@
1import module namespace parse-xml = "http://zorba.io/modules/xml";
2import schema namespace opt = "http://zorba.io/modules/xml-options";
3import module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";
4import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
5import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
6
7declare namespace an = "http://zorba.io/annotations";
8declare namespace ext = "http://zorba.io/extensions";
9
10declare variable $coll := xs:QName("ddl:coll1");
11
12declare %an:sequential function local:test-sequential($pos)
13{
14
15};
16
17ddl:create($coll);
18dml:insert-nodes-last($coll, (<a/>,<c/>,<b/>));
19
20(# ext:no-materialization #)
21{
22 for $w at $pos in dml:collection($coll)
23 order by local-name($w) descending
24 return
25 {
26 local:test-sequential($pos);
27 $w
28 }
29}
0\ No newline at end of file30\ No newline at end of file
131
=== added file 'test/rbkt/Queries/zorba/scripting/flwor2.spec'
--- test/rbkt/Queries/zorba/scripting/flwor2.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/scripting/flwor2.spec 2013-08-16 07:08:59 +0000
@@ -0,0 +1,1 @@
1Error: http://www.zorba-xquery.com/errors:ZDDY0037

Subscribers

People subscribed via source and target branches