Update of /cvsroot/monetdb/pathfinder/compiler/sql
In directory 
sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19729/compiler/sql

Modified Files:
      Tag: XQFT
        lalg2sql.brg 
Log Message:
propagated changes of Wednesday Mar 17 2010 - Thursday Mar 18 2010
from the development trunk to the XQFT branch

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2010/03/17 - tsheyar: compiler/sql/lalg2sql.brg,1.170
  -- Align input and output columns of the merge_adjacent_text_nodes operator
     in the SQL code generation.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2010/03/17 - tsheyar: compiler/sql/lalg2sql.brg,1.171
  -- Cope with polymorphic item sequences in the SQL code generation for rank 
operators.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: lalg2sql.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/sql/lalg2sql.brg,v
retrieving revision 1.168.2.1
retrieving revision 1.168.2.2
diff -u -d -r1.168.2.1 -r1.168.2.2
--- lalg2sql.brg        7 Jan 2010 16:03:50 -0000       1.168.2.1
+++ lalg2sql.brg        18 Mar 2010 11:29:31 -0000      1.168.2.2
@@ -4556,22 +4556,26 @@
                 asc = PFord_order_dir_at (sortby, i) == DIR_ASC;
 
                 expr_ty = type_of (L(p), ord);
-                expr = col_env_lookup (COLMAP(L(p)),
-                                       ord,
-                                       expr_ty);
+                /* cope with polymorphic columns here */
+                for (PFalg_simple_type_t t = 1; t; t <<= 1)
+                    if (t & TYPE_MASK (expr_ty)) {
+                        expr = col_env_lookup (COLMAP(L(p)),
+                                               ord,
+                                               t);
 
-                srtbylist = sortkey_list (
-                                sortkey_item (
-                                    /* different handling of boolean
-                                       types as search criterion */
-                                    (expr->kind == sql_column_name ||
-                                     expr->kind == sql_lit_int     ||
-                                     expr_ty    != aat_bln)
-                                         ? expr
-                                         : case_ (when (expr, TRUE_INT),
-                                                  else_ (FALSE_INT)),
-                                    asc),
-                                srtbylist);
+                        srtbylist = sortkey_list (
+                                        sortkey_item (
+                                            /* different handling of boolean
+                                               types as search criterion */
+                                            (expr->kind == sql_column_name ||
+                                             expr->kind == sql_lit_int     ||
+                                             t != aat_bln)
+                                            ? expr
+                                            : case_ (when (expr, TRUE_INT),
+                                                     else_ (FALSE_INT)),
+                                            asc),
+                                        srtbylist);
+                    }
             }
             col_env_add (COLMAP(p),
                          p->sem.sort.res,
@@ -5338,6 +5342,27 @@
             /* copy all existing column, from, and where lists */
             copy_cols_from_where (p, R(p));
 
+            /* align the column names */
+            for (unsigned int i = 0; i < PFarray_last (COLMAP(p)); i++) {
+                PFalg_col_t col;
+                col = (*(sql_column_env_t *) PFarray_at (COLMAP(p), i)).col;
+                if (col == p->sem.merge_adjacent.iter_in) {
+                    (*(sql_column_env_t *) PFarray_at (COLMAP(p), i)).col
+                        = p->sem.merge_adjacent.iter_res;
+                    continue;
+                }
+                if (col == p->sem.merge_adjacent.pos_in) {
+                    (*(sql_column_env_t *) PFarray_at (COLMAP(p), i)).col
+                        = p->sem.merge_adjacent.pos_res;
+                    continue;
+                }
+                if (col == p->sem.merge_adjacent.item_in) {
+                    (*(sql_column_env_t *) PFarray_at (COLMAP(p), i)).col
+                        = p->sem.merge_adjacent.item_res;
+                    continue;
+                }
+            }
+
             FRAG(p) = FRAG(L(p));
             break;
 


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to