Update of /cvsroot/monetdb/sql/src/server
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20664/src/server

Modified Files:
      Tag: Nov2009
        rel_bin.mx 
Log Message:
check for stack overflow in relational to binary code generation


Index: rel_bin.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/rel_bin.mx,v
retrieving revision 1.93.2.2
retrieving revision 1.93.2.3
diff -u -d -r1.93.2.2 -r1.93.2.3
--- rel_bin.mx  22 Nov 2009 20:29:14 -0000      1.93.2.2
+++ rel_bin.mx  29 Nov 2009 09:42:21 -0000      1.93.2.3
@@ -799,7 +799,6 @@
        if (rel->r) /* first construct the right sub relation */
                right = subrel_bin(sql, rel->r, refs);
        if (!left || !right) { 
-               assert(0);
                if (left) stmt_destroy(left);
                if (right) stmt_destroy(right);
                return NULL;    
@@ -936,7 +935,6 @@
        if (rel->r) /* first construct the right sub relation */
                right = subrel_bin(sql, rel->r, refs);
        if (!left || !right) { 
-               assert(0);
                if (left) stmt_destroy(left);
                if (right) stmt_destroy(right);
                return NULL;    
@@ -1071,7 +1069,6 @@
        if (rel->r) /* first construct the right sub relation */
                right = subrel_bin(sql, rel->r, refs);
        if (!left || !right) { 
-               assert(0);
                if (left) stmt_destroy(left);
                if (right) stmt_destroy(right);
                return NULL;    
@@ -1144,7 +1141,6 @@
        if (rel->r) /* first construct the right sub relation */
                right = subrel_bin(sql, rel->r, refs);
        if (!left || !right) { 
-               assert(0);
                if (left) stmt_destroy(left);
                if (right) stmt_destroy(right);
                return NULL;    
@@ -1282,7 +1278,6 @@
        if (rel->r) /* first construct the right sub relation */
                right = subrel_bin(sql, rel->r, refs);
        if (!left || !right) { 
-               assert(0);
                if (left) stmt_destroy(left);
                if (right) stmt_destroy(right);
                return NULL;    
@@ -1425,10 +1420,8 @@
 
        if (rel->l) { /* first construct the sub relation */
                sub = subrel_bin(sql, rel->l, refs);
-               if (!sub) { 
-                       assert(0);
+               if (!sub) 
                        return NULL;    
-               }
                if (sub->type == st_ordered) {
                        stmt *n = sql_reorder(stmt_dup(sub->op1.stval), 
stmt_dup(sub->op2.stval));
                        stmt_destroy(sub);
@@ -1541,10 +1534,8 @@
 
        if (rel->l) { /* first construct the sub relation */
                sub = subrel_bin(sql, rel->l, refs);
-               if (!sub) { 
-                       assert(0);
+               if (!sub) 
                        return NULL;    
-               }
                sub = row2cols(sub);
        } else {
                predicate = rel2bin_predicate();
@@ -1650,10 +1641,8 @@
 
        if (rel->l) { /* first construct the sub relation */
                sub = subrel_bin(sql, rel->l, refs);
-               if (!sub) { 
-                       assert(0);
+               if (!sub)
                        return NULL;    
-               }
        }
 
        if (sub && sub->type == st_list && sub->op1.lval->h && 
!((stmt*)sub->op1.lval->h->data)->nrcols) {
@@ -1751,10 +1740,8 @@
 
        if (rel->l) /* first construct the sub relation */
                sub = subrel_bin(sql, rel->l, refs);
-       if (!sub) { 
-               assert(0);
+       if (!sub) 
                return NULL;    
-       }
 
        if (rel->exps) {
                sql_exp *limit = rel->exps->h->data;
@@ -2334,10 +2321,8 @@
        if (rel->r) /* first construct the inserts relation */
                inserts = subrel_bin(sql, rel->r, refs);
 
-       if (!inserts) { 
-               assert(0);
+       if (!inserts)  
                return NULL;    
-       }
 
        if (inserts->type == st_ordered) {
                stmt *n = sql_reorder(stmt_dup(inserts->op1.stval), 
stmt_dup(inserts->op2.stval));
@@ -3156,11 +3141,8 @@
 
        if (rel->r) { /* first construct the update relation */
                update = subrel_bin(sql, rel->r, refs);
-
-               if (!update) { 
-                       assert(0);
+               if (!update)  
                        return NULL;    
-               }
        }
        updates = table_update_array(t, &len);
        tid = update->op1.lval->h->data;
@@ -3344,11 +3326,8 @@
 
        if (rel->r) { /* first construct the deletes relation */
                delete = subrel_bin(sql, rel->r, refs);
-
-               if (!delete) { 
-                       assert(0);
+               if (!delete) 
                        return NULL;    
-               }
        }
        if (delete && delete->type == st_list) {
                stmt *s = delete;
@@ -3383,6 +3362,9 @@
 {
        stmt *s = NULL;
 
+       if (THRhighwater())
+               return NULL;
+
        if (!rel)
                return s;
        if (rel_is_ref(rel)) {


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to