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

use SUBSEQUENCE_INT function, instead of SUBSEQUENCE_INT in partial_eval_eq 
rewrite rule
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/92439
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/expression/flwor_expr.cpp'
--- src/compiler/expression/flwor_expr.cpp	2012-02-02 09:56:52 +0000
+++ src/compiler/expression/flwor_expr.cpp	2012-02-10 10:51:20 +0000
@@ -803,6 +803,12 @@
 
 flwor_clause_t materialize_clause::clone(expr::substitution_t& subst) const
 {
+  // we will reach here under the following scenario:
+  // 1. We do plan seriazation
+  // 2. getPlan is called on udf A; this causes a mat clause to be created
+  //    during the codegen on A's body
+  // 3. getPlan is called on udf B, which invokes A, and A's body is
+  //    inlined (and as a result cloned) inside B's body.
   return new materialize_clause(theContext, get_loc());
 }
 

=== modified file 'src/compiler/rewriter/rules/fold_rules.cpp'
--- src/compiler/rewriter/rules/fold_rules.cpp	2012-01-26 19:56:14 +0000
+++ src/compiler/rewriter/rules/fold_rules.cpp	2012-02-10 10:51:20 +0000
@@ -951,23 +951,16 @@
     }
     else
     {
-      store::Item_t pVal;
-      store::Item_t iVal = val;
-      GenericCast::promote(pVal, iVal, &*rtm.DOUBLE_TYPE_ONE, tm, val_expr->get_loc());
-      expr_t dpos = new const_expr(val_expr->get_sctx(), LOC(val_expr), pVal);
-
       std::vector<expr_t> args(3);
       args[0] = count_expr->get_arg(0);
-      args[1] = dpos;
-      args[2] = new const_expr(val_expr->get_sctx(),
-                               LOC(val_expr),
-                               xs_double(2.0));
+      args[1] = val_expr;
+      args[2] = new const_expr(val_expr->get_sctx(), LOC(val_expr), xs_integer(2));
 
-      expr_t subseq_expr = 
-      expr_tools::fix_annotations(new fo_expr(count_expr->get_sctx(),
-                                              LOC(count_expr),
-                                              GET_BUILTIN_FUNCTION(FN_SUBSEQUENCE_3),
-                                              args));
+      expr_t subseq_expr = expr_tools::fix_annotations(
+      new fo_expr(count_expr->get_sctx(),
+                  LOC(count_expr),
+                  GET_BUILTIN_FUNCTION(OP_ZORBA_SUBSEQUENCE_INT_3),
+                  args));
 
       return expr_tools::fix_annotations(
              new fo_expr(fo.get_sctx(),

=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2012-02-02 09:56:52 +0000
+++ src/compiler/translator/translator.cpp	2012-02-10 10:51:20 +0000
@@ -11945,11 +11945,8 @@
     theTypeStack.push(seqmatch);
   }
 #else /* ZORBA_NO_XMLSCHEMA */
-  throw XQUERY_EXCEPTION(
-    zerr::ZXQP0005_NOT_ENABLED,
-    ERROR_PARAMS( ZED( XMLSchema ) ),
-    ERROR_LOC( loc )
-  );
+  RAISE_ERROR(zerr::ZXQP0005_NOT_ENABLED, loc,
+  ERROR_PARAMS(ZED(XMLSchema)));
 #endif /* ZORBA_NO_XMLSCHEMA */
   return no_state;
 }

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