Update of /cvsroot/monetdb/sql/src/server
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19576/src/server

Modified Files:
      Tag: Aug2009
        rel_bin.mx 
Log Message:
fixed bug with 2 coun'ts (or other aggregates) with a limit statement.


U rel_bin.mx
Index: rel_bin.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/rel_bin.mx,v
retrieving revision 1.87.2.4
retrieving revision 1.87.2.5
diff -u -d -r1.87.2.4 -r1.87.2.5
--- rel_bin.mx  3 Sep 2009 20:44:48 -0000       1.87.2.4
+++ rel_bin.mx  19 Sep 2009 18:53:34 -0000      1.87.2.5
@@ -1759,7 +1759,7 @@
 
        if (sub->type == st_ordered) {
                stmt *s = stmt_dup(sub->op2.stval);
-               order = stmt_dup(sub->op1.stval);
+               order = column(stmt_dup(sub->op1.stval));
                stmt_destroy(sub);
                sub = s;
        }
@@ -1778,7 +1778,7 @@
                if (order) {
                        limit = stmt_limit(stmt_dup(order), o, l, 0);
                } else {
-                       limit = stmt_limit(stmt_dup(n->data), o, l, 0);
+                       limit = stmt_limit(column(stmt_dup(n->data)), o, l, 0);
                        if (lmt >= 0) {
                                n = n->next;
                                list_append(newl, limit);
@@ -1794,7 +1794,7 @@
                        else
                                p = stmt_semijoin(stmt_dup(p), stmt_dup(limit));
                        for ( ; n; n = n->next) {
-                               stmt *s = stmt_dup(n->data);
+                               stmt *s = column(stmt_dup(n->data));
                                stmt *prj = find_projection_join(s);
                
                                /* for all but the order column we can reduce */
@@ -1808,9 +1808,9 @@
                                stmt *s;
                
                                if (lmt < 0)
-                                       s = stmt_diff(stmt_dup(n->data), 
stmt_dup(limit));
+                                       s = 
stmt_diff(column(stmt_dup(n->data)), stmt_dup(limit));
                                else
-                                       s = stmt_semijoin(stmt_dup(n->data), 
stmt_dup(limit));
+                                       s = 
stmt_semijoin(column(stmt_dup(n->data)), stmt_dup(limit));
                                list_append(newl, s);
                        }
                }


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to