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

Modified Files:
        prop_key.c 
Log Message:
-- Changed the semantic content of the la_ref_tbl operator.
-- In the semantic content of the la_ref_tbl operator we now store the 
*positions* (w.r.t. the schema) of key attributes instead of their names, so 
that renamings of attribute names (e.g. by some plan optimization phases) don't 
have to be done additionally on this key attribute infos.

Index: prop_key.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_key.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- prop_key.c  6 Dec 2007 08:42:31 -0000       1.32
+++ prop_key.c  6 Dec 2007 22:41:33 -0000       1.33
@@ -288,17 +288,24 @@
 
 
         case la_ref_tbl:
-            /* just copy keys from the semantical infos */
-            for (unsigned int i = 0; i < PFarray_last (n->sem.ref_tbl.keys); 
i++)
-                *(PFalg_att_t *) PFarray_add (n->prop->keys) =
-                    *(PFalg_att_t *) PFarray_at (n->sem.ref_tbl.keys, i);
+            /* Make sure we don't process a component key here. */
+            if(PFarray_last (n->sem.ref_tbl.keys) == 1)
+            {
+                int keyPos =  *(int*) PFarray_at (n->sem.ref_tbl.keys, 0);
 
+                assert(keyPos >= 0);
+                
+                PFalg_schm_item_t schemaItem = n->schema.items[keyPos];
+                PFalg_att_t key = schemaItem.name;
+
+                *(PFalg_att_t *) PFarray_add (n->prop->keys) = key;
+
+            }
 
 
             break;
 
 
-
         case la_disjunion:
             /*
              * If


-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to