Update of /cvsroot/monetdb/pathfinder/compiler/algebra/opt
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19590/compiler/algebra/opt

Modified Files:
      Tag: May2009
        opt_const.c opt_mvd.c 
Log Message:
-- Make the error message for missing documents more informative:               
                     
   Include the document name in the error message.                              
                     
                                                                                
                     
-- Adjust new error messages in the testweb.                                    
                   
                                                                                
                     
-- Adjust stable output (for tests with a modified inter-document order).       
                   
                                                                                
                     
-- Fix/Extend a cross product rewrite (for unreferenced inputs).

-- Simplify the 'missing document' error message in the algebra                 
                     
   for constant document names (which is the default).                          
                     


U opt_mvd.c
Index: opt_mvd.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_mvd.c,v
retrieving revision 1.52
retrieving revision 1.52.2.1
diff -u -d -r1.52 -r1.52.2.1
--- opt_mvd.c   12 May 2009 20:09:41 -0000      1.52
+++ opt_mvd.c   20 May 2009 14:36:05 -0000      1.52.2.1
@@ -141,29 +141,20 @@
             PFprop_card (p->prop) == 1)
             return dummy (R(p));
         else {
-            PFalg_proj_t *proj_list2;
-            proj_list2 = PFmalloc ((R(p)->schema.count - 1)
-                                   * sizeof (*(proj_list)));
-            count = 0;
-            /* split up the columns such that they do not conflict
-               anymore */
-            assert (R(p)->schema.count > 1);
-            /* throw out the first column of the left child
-               from the right child */
-            for (j = 0; j < R(p)->schema.count; j++)
-                if (L(p)->schema.items[0].name !=
-                    R(p)->schema.items[j].name) {
-                    proj_list2[count++] =
-                        proj (R(p)->schema.items[j].name,
-                              R(p)->schema.items[j].name);
-                }
-            /* keep only the first column of the left child */
-            proj_list[0] = proj (L(p)->schema.items[0].name,
-                                 L(p)->schema.items[0].name);
+            /* The left side does not add anything to the result
+               (except for the cardinality). */
 
-            /* apply project operator on both childs */
-            return cross (PFla_project_ (L(p), 1, proj_list),
-                          PFla_project_ (R(p), count, proj_list2));
+            /* new dummy column */
+            PFalg_col_t dummy = PFcol_new (col_iter);
+
+            return PFla_project_ (
+                       cross (
+                           project (
+                               attach (L(p), dummy, lit_nat (42)), 
+                               proj (dummy, dummy)),
+                           R(p)),
+                       p->schema.count,
+                       PFalg_proj_create (p->schema));
         }
     }
     else {

U opt_const.c
Index: opt_const.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_const.c,v
retrieving revision 1.46
retrieving revision 1.46.2.1
diff -u -d -r1.46 -r1.46.2.1
--- opt_const.c 7 May 2009 14:24:11 -0000       1.46
+++ opt_const.c 20 May 2009 14:36:02 -0000      1.46.2.1
@@ -723,6 +723,30 @@
                                    PFalg_lit_bln (false));
                 break;
             }
+            /* concatenate two constant strings */
+            if (p->sem.fun_1to1.kind == alg_fun_fn_concat &&
+                PFprop_const (p->prop, clat (p->sem.fun_1to1.refs, 0)) &&
+                PFprop_const (p->prop, clat (p->sem.fun_1to1.refs, 1))) {
+                char *str0 = PFprop_const_val (
+                                 p->prop,
+                                 clat (p->sem.fun_1to1.refs, 0)).val.str,
+                     *str1 = PFprop_const_val (
+                                 p->prop,
+                                 clat (p->sem.fun_1to1.refs, 1)).val.str,
+                     *s;
+                unsigned int count = strlen (str0) + strlen (str1) + 1;
+
+                /* try to avoid constructing two long strings */
+                if (count < 2048) {
+                    s = (char *) PFmalloc (count);
+               
+                    strcat (strcpy (s, str0), str1);
+
+                    *p = *PFla_attach (L(p), p->sem.fun_1to1.res,
+                                       PFalg_lit_str (s));
+                    break;
+                }
+            }
             break;
 
         case la_num_eq:


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to