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

Modified Files:
        lalg2sql.brg 
Log Message:
propagated changes of Monday Sep 28 2009
from the Aug2009 branch to the development trunk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/09/28 - tsheyar: compiler/sql/lalg2sql.brg,1.166.2.1
-- Fix problems with missing order criteria.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


U lalg2sql.brg
Index: lalg2sql.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/sql/lalg2sql.brg,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -d -r1.166 -r1.167
--- lalg2sql.brg        18 Jun 2009 15:47:45 -0000      1.166
+++ lalg2sql.brg        28 Sep 2009 14:36:05 -0000      1.167
@@ -2498,13 +2498,16 @@
 
             /* unfold the sorting criteria of a numbering operator */
             if (orderby->kind == sql_over &&
-                R(orderby)->kind == sql_wnd_clause &&
-                RR(orderby)->kind == sql_order_by) {
+                R(orderby)->kind == sql_wnd_clause) {
                 assert (L(orderby)->kind == sql_row_number ||
                         L(orderby)->kind == sql_dense_rank);
                 assert (!RL(orderby));
                 /* orderby may become an empty list (aka. NULL) */
-                orderby = RRL(orderby);
+                if (RR(orderby) &&
+                    RR(orderby)->kind == sql_order_by)
+                    orderby = RRL(orderby);
+                else
+                    orderby = NULL;
             } 
             else if (IS_LITERAL(orderby))
                 orderby = NULL;
@@ -2518,13 +2521,16 @@
 
             /* unfold the sorting criteria of a numbering operator */
             if (orderby->kind == sql_over &&
-                R(orderby)->kind == sql_wnd_clause &&
-                RR(orderby)->kind == sql_order_by) {
+                R(orderby)->kind == sql_wnd_clause) {
                 assert (L(orderby)->kind == sql_row_number ||
                         L(orderby)->kind == sql_dense_rank);
                 assert (!RL(orderby));
                 /* orderby may become an empty list (aka. NULL) */
-                orderby = RRL(orderby);
+                if (RR(orderby) &&
+                    RR(orderby)->kind == sql_order_by)
+                    orderby = RRL(orderby);
+                else
+                    orderby = NULL;
             } 
             else if (IS_LITERAL(orderby))
                 orderby = NULL;


------------------------------------------------------------------------------
Come build with us! The BlackBerry® 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-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to