Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/markos-scratch 
into lp:zorba.

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/102192

Fixed bug #891650
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/102192
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-04-16 15:17:02 +0000
+++ ChangeLog	2012-04-16 21:56:21 +0000
@@ -12,6 +12,7 @@
   * Fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest)
   * Fixed bug 955135 (err:XQDY0044 not caught by try-catch expressions)
   * Fixed bug #967864 (var substitution did not update theFreeVars property)
+  * Fixed buf #891650 (context size var not always declared within path expr)
   * Fixed bug #948879 (--uri-path doesn't work with fetch:content())
   * Fixed bug in window iterator (binding the end vars in the output tuple stream)
   * Fixed bug #866547 (protect index-join rule from general flwor)

=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2012-04-16 15:34:36 +0000
+++ src/compiler/translator/translator.cpp	2012-04-16 21:56:21 +0000
@@ -8600,7 +8600,7 @@
   else
   {
     expr_t inputSeqExpr = wrap_in_dos_and_dupelim(pathExpr, false);
-    rchandle<flwor_expr> flworExpr = wrap_expr_in_flwor(inputSeqExpr, false);
+    rchandle<flwor_expr> flworExpr = wrap_expr_in_flwor(inputSeqExpr, (axisStep == NULL));
     push_nodestack(flworExpr.getp());
   }
 }

=== modified file 'src/runtime/api/plan_wrapper.cpp'
--- src/runtime/api/plan_wrapper.cpp	2012-03-30 19:03:09 +0000
+++ src/runtime/api/plan_wrapper.cpp	2012-04-16 21:56:21 +0000
@@ -143,7 +143,8 @@
   // However, for reasons of lazy evaluation, we also return the result
   // that was computed before the exit expression was evaluated
   // (see test scripting/exit4.xq)
-  if (!theExitValue) {
+  if (!theExitValue) 
+  {
     try
     {
       return PlanIterator::consumeNext(result, theIterator, *thePlanState);

=== modified file 'src/runtime/core/internal_operators.cpp'
--- src/runtime/core/internal_operators.cpp	2012-04-09 23:08:06 +0000
+++ src/runtime/core/internal_operators.cpp	2012-04-16 21:56:21 +0000
@@ -34,26 +34,30 @@
 SERIALIZABLE_CLASS_VERSIONS(UnhoistIterator)
 
 
+
 void HoistIteratorState::init(PlanState& planState)
 {
   PlanIteratorState::init(planState);
   theDone = false;
 }
 
+
 void HoistIteratorState::reset(PlanState& planState)
 {
   PlanIteratorState::reset(planState);
   theDone = false;
 }
 
+
 bool
 HoistIterator::nextImpl(store::Item_t& result, PlanState& planState) const
 {
   bool error = false;
-  HoistIteratorState *state;
+
+  HoistIteratorState* state;
   DEFAULT_STACK_INIT(HoistIteratorState, state, planState);
 
-  while(!state->theDone) 
+  while (!state->theDone) 
   {
     try 
     {
@@ -67,8 +71,10 @@
 
       GENV_ITEMFACTORY->createError(result, ze.release());
     }
+
     STACK_PUSH(error || !state->theDone, state);
   }
+
   STACK_END(state);
 }
 

=== modified file 'src/runtime/core/internal_operators.h'
--- src/runtime/core/internal_operators.h	2012-03-30 19:03:09 +0000
+++ src/runtime/core/internal_operators.h	2012-04-16 21:56:21 +0000
@@ -22,16 +22,20 @@
 
 namespace zorba {
 
-class HoistIteratorState : public PlanIteratorState {
-  public:
-    bool theDone;
+class HoistIteratorState : public PlanIteratorState 
+{
+public:
+  bool theDone;
 
-    void init(PlanState& planState);
-    void reset(PlanState& planState);
+public:
+  void init(PlanState& planState);
+  void reset(PlanState& planState);
 };
 
+
 NARY_ITER_STATE(HoistIterator, HoistIteratorState);
 
+
 NARY_ITER(UnhoistIterator);
 
 }

=== modified file 'src/runtime/eval/eval.cpp'
--- src/runtime/eval/eval.cpp	2012-04-14 06:37:23 +0000
+++ src/runtime/eval/eval.cpp	2012-04-16 21:56:21 +0000
@@ -188,6 +188,12 @@
     ulong maxOuterVarId;
     copyOuterVariables(planState, outerSctx, evalDctx, maxOuterVarId);
 
+    // If we are here after a reet, we must set state->thePlanWrapper to NULL
+    // before reseting the state->thePlan. Otherwise, the current state->thePlan
+    // will be destroyed first, and then we will attempt to close it when 
+    // state->thePlanWrapper is reset later. 
+    state->thePlanWrapper = NULL;
+
     // Compile
     state->thePlan = compile(evalCCB,
                              item->getStringValue(),

=== modified file 'src/store/naive/simple_pul.h'
--- src/store/naive/simple_pul.h	2012-03-30 19:03:09 +0000
+++ src/store/naive/simple_pul.h	2012-04-16 21:56:21 +0000
@@ -153,7 +153,7 @@
 
 protected:
   // Bookeeping
-  Collection                 * theCollection;
+  Collection                       * theCollection;
 
   PULImpl                          * thePul;
 

=== added file 'test/rbkt/ExpQueryResults/zorba/paths/path28.xml.res'
--- test/rbkt/ExpQueryResults/zorba/paths/path28.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/paths/path28.xml.res	2012-04-16 21:56:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+1

=== added file 'test/rbkt/Queries/zorba/paths/path28.xq'
--- test/rbkt/Queries/zorba/paths/path28.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/paths/path28.xq	2012-04-16 21:56:21 +0000
@@ -0,0 +1,2 @@
+<x/>/last()
+

-- 
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

Reply via email to