Update of /cvsroot/monetdb/pathfinder/compiler/algebra/prop
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19380/algebra/prop

Modified Files:
        prop_unq_names.c 
Log Message:
-- Fixed the mapping of recursion arguments in the unique column name inference.


U prop_unq_names.c
Index: prop_unq_names.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_unq_names.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- prop_unq_names.c    17 Mar 2008 17:41:21 -0000      1.32
+++ prop_unq_names.c    3 Apr 2008 12:39:30 -0000       1.33
@@ -563,9 +563,13 @@
         case la_rec_arg:
             /* The both inputs (seed and recursion) do not use
                the same column names. Thus we live with inconsistent
-               unique names and introduce a renaming projection
-               (Schema R -> Schema L) during name mapping. */
-            bulk_add_name_pairs (np_list, L(n));
+               unique names and introduce renaming projections
+               (Schema R -> new and Schema L -> new) during the name
+               mapping. */
+
+            /* create new unique names for all attributes */
+            for (unsigned int i = 0; i < n->schema.count; i++)
+                new_name_pair (np_list, n->schema.items[i].name, id++);
             break;
 
         case la_rec_base:
@@ -641,24 +645,32 @@
             /* infer the unique names of the arguments */
             cur_col_id = prop_infer_rec_seed (L(n), cur_col_id);
             cur_col_id = prop_infer_rec_seed (R(n), cur_col_id);
+
+            /* recursion parameters do not have properties */
+            reset_property (n);
             break;
 
         case la_rec_arg:
             /* infer the unique names of the seed */
             cur_col_id = prop_infer (L(n), cur_col_id);
 
+            reset_property (n);
+
+            /* infer unique name columns */
+            cur_col_id = infer_unq_names (n, cur_col_id);
+
             n->sem.rec_arg.base->bit_dag = true;
             reset_property (n->sem.rec_arg.base);
 
-            /* copy the mapping of the unique column names of the seed
-               to its base. */
-            bulk_add_name_pairs (n->sem.rec_arg.base->prop->name_pairs,
-                                 L(n));
+            /* copy the mapping of the unique column names of the recursion
+               argument to its base. */
+            bulk_add_name_pairs (n->sem.rec_arg.base->prop->name_pairs, n);
 
-            /* The both inputs (seed and recursion) now do not use
-               the same column names: the unique names are inconsistent.
-               Thus the name mapping has to introduce a renaming projection
-               (Schema R -> Schema L). */
+            /* The both inputs (seed and recursion) do not use
+               the same column names. Thus we live with inconsistent
+               unique names and introduce renaming projections
+               (Schema R -> new and Schema L -> new) during the name
+               mapping. */
             break;
 
         case la_nil:
@@ -691,10 +703,11 @@
             /* infer the unique names of the recursion body */
             cur_col_id = prop_infer (R(n), cur_col_id);
 
-            /* The both inputs (seed and recursion) now do not use
-               the same column names: the unique names are inconsistent.
-               Thus the name mapping has to introduce a renaming projection
-               (Schema R -> Schema L). */
+            /* The both inputs (seed and recursion) do not use
+               the same column names. Thus we live with inconsistent
+               unique names and introduce renaming projections
+               (Schema R -> new and Schema L -> new) during the name
+               mapping. */
             break;
 
         case la_nil:
@@ -708,11 +721,6 @@
     }
 
     n->bit_dag = true;
-    reset_property (n);
-
-    /* infer unique name columns */
-    cur_col_id = infer_unq_names (n, cur_col_id);
-
     return cur_col_id;
 }
 


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to