Update of /cvsroot/monetdb/pathfinder/compiler/semantics
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv22277/compiler/semantics

Modified Files:
        heuristic.c 
Log Message:
propagated changes of Thursday Nov 12 2009
from the Nov2009 branch to the development trunk

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2009/11/12 - boncz: compiler/semantics/heuristic.c,1.15.6.4
  my batch of promised bugfixes for Nov2009
  - disable prepared query mechanism for function-only queries (avoid mps!)
  - make heuristic to use indices even more strict (not inside the where clause
    of a for-loop with >1 variables, as it may be a join).
  - fix property bug in shredder (in case of tables with a single tuple, being
    appended to my a incremental multi-doc shred).
  - fix simple bug (crash in printf format) in xrpc_client
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: heuristic.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/semantics/heuristic.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- heuristic.c 8 Oct 2009 17:01:37 -0000       1.18
+++ heuristic.c 12 Nov 2009 08:39:38 -0000      1.19
@@ -711,7 +711,7 @@
         PFpnode_t *push = stack[depth]->child[next_child];
         if (next_child < 2 && push) { /* PUSH child left-deep-first */
             int i, looplifted = 0;
-            if (push->kind == p_ord_ret || push->kind == p_let) {
+            if (push->kind == p_ord_ret || push->kind == p_let || push->kind 
== p_where) {
                 for(i=0; i <= depth; i++) {
                     if (stack[i]->kind == p_flwr) {
                         PFpnode_t *binds = stack[i];
@@ -720,14 +720,15 @@
                             if (next && next->kind == p_let) next = R(binds);
                             if (next && next->kind == p_bind) {
                                 PFpnode_t *var = L(next);
-                                if (var && var->kind == p_vars) looplifted = 1;
+                                if (var && var->kind == p_vars) looplifted++;
+                                next = R(binds);
                             }
                             binds = next;
                         } while(binds && binds->kind == p_binds);
                     }
                 }
             } 
-            if (looplifted) {
+            if (looplifted > (push->kind == p_where)) {
                 depth--; /* POP: do not rewrite below a flower block */
             } else {
                 stack[depth+1] = stack[depth]->child[next_child]; 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to