Update of /cvsroot/monetdb/pathfinder/compiler/algebra/map
In directory sc8-pr-cvs16:/tmp/cvs-serv25318/algebra/map

Modified Files:
        intro_proxy.c 
Log Message:
-- Bugfix: avoid to list a column in a projection twice.


Index: intro_proxy.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/map/intro_proxy.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- intro_proxy.c       7 May 2007 10:17:08 -0000       1.25
+++ intro_proxy.c       7 May 2007 11:23:38 -0000       1.26
@@ -2104,6 +2104,25 @@
     /* adjust the count */
     req_cols.count = count;
 
+    /* We are certain that this join is only a mapping join
+       (see join_entry ()). Any input column (at the proxy base)
+       that is propagated along the left *and* the right side
+       of the equi-join and which is not modified contains
+       the same values and can be pruned from the entry_proj
+       projection list. Here we can prune one of its occurrences
+       in the above renaming projection list. */
+    for (i = 0; i < dist_count; i++)
+        for (j = i+1; j < dist_count; j++)
+            if (entry_proj[i].new == entry_proj[j].new) {
+                /* copy the last projection pair to the
+                   current column that appears twice */
+                dist_count--;
+                entry_proj[i] = entry_proj[dist_count];
+                proxy_proj[i] = proxy_proj[dist_count];
+                i--;
+                break;
+            }
+        
     /* Rebuild the proxy entry operator and extend it with a projection
        that maps the resulting column names to the names of the proxy
        base. In addition map the old key column to the resulting relation


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to