Update of /cvsroot/monetdb/pathfinder/compiler/sql
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv2760/sql

Modified Files:
        lalg2sql.brg 
Log Message:
-- In the SQL code generation remove duplicate entries from the group by list
   (now on a higher layer as the previous version did not work out as aspected).


U lalg2sql.brg
Index: lalg2sql.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/sql/lalg2sql.brg,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -d -r1.164 -r1.165
--- lalg2sql.brg        16 Jun 2009 14:38:43 -0000      1.164
+++ lalg2sql.brg        16 Jun 2009 15:24:39 -0000      1.165
@@ -4058,18 +4058,20 @@
                 switch (p->sem.aggr.aggr[i].kind) {
                     case alg_aggr_dist:
                     {
-                        PFsql_t *collist = groupbylist;
-                        /* Try to find the expression @a expr
-                           in the column list. */
-                        while (collist) {
-                            if (R(collist) == expr)
-                                break;
-                            else
-                                collist = L(collist);
+                        bool found = false;
+                        /* Try to find the column col in the rank order list. 
*/
+                        if (rule == 36) {
+                            PFord_ordering_t sortby = L(p)->sem.sort.sortby;
+                            unsigned int     i;
+                            for (i = 0; i < PFord_count (sortby); i++)
+                                if (PFord_order_col_at (sortby, i) == col) {
+                                    found = true;
+                                    break;
+                                }
                         }
-                        /* In case the expression did not exist in
+                        /* In case the column did not exist in
                            the column list already ... */
-                        if (!collist)
+                        if (!found)
                             /* ... extend the group by list. */
                             groupbylist = column_list (groupbylist, expr);
                     }   break;


------------------------------------------------------------------------------
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