Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27091/src/backends/monet5

Modified Files:
        sql_gencode.mx sql_optimizer.mx sql_result.mx 
Log Message:
fixed leak in dec_fromstr
When joining multiple tables (with join indices), 
we make sure we first join on the foreign side (ie no more rows).
Also we rewrite join indices into selections. 


Index: sql_result.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_result.mx,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- sql_result.mx       14 Dec 2007 14:10:26 -0000      1.74
+++ sql_result.mx       25 Dec 2007 21:34:31 -0000      1.75
@@ -339,7 +339,10 @@
                showException(SQL,"sql", "decimal wrong format (%s)", p);
                return NULL;
        }
-       r = (@1*)GDKmalloc(sizeof(@1));
+       r = df->ai->data;
+       if (!r)
+               r = (@1*)GDKmalloc(sizeof(@1));
+       df->ai->data = r;
        if (neg)
                *r = -res;
        else

Index: sql_gencode.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_gencode.mx,v
retrieving revision 1.258
retrieving revision 1.259
diff -u -d -r1.258 -r1.259
--- sql_gencode.mx      23 Dec 2007 22:25:16 -0000      1.258
+++ sql_gencode.mx      25 Dec 2007 21:34:31 -0000      1.259
@@ -94,7 +94,7 @@
 
        (void) sql;
        VALcopy(&cst,vr);
-       idx= defConstant(mb, vr->vtype, &cst);
+       idx = defConstant(mb, vr->vtype, &cst);
        return idx;
 }
 @-

Index: sql_optimizer.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_optimizer.mx,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -d -r1.167 -r1.168
--- sql_optimizer.mx    21 Dec 2007 17:02:23 -0000      1.167
+++ sql_optimizer.mx    25 Dec 2007 21:34:31 -0000      1.168
@@ -467,7 +467,7 @@
        /* the optimizer control is a semicolon separated list of names */
        /* the predefined 'default' injects the default plan upon need */
        str optimizers[256];
-       str oldbase= optimizer;
+       str oldbase = optimizer;
        int top=0,i;
        char *nxt, *nme;
 
@@ -487,19 +487,19 @@
                        optimizers[top++] = nme; 
                optimizer = nxt;
        } 
-       if( top== 256){
+       if (top == 256){
                showException(SQL,"optimizer","Too many optimizer steps\n");
                mb->errors++;
        }
 
        /* add the optimizers to the query plan */
        for (i=0;i<top; i++) {
-               InstrPtr p = newFcnCall(mb,"optimizer",optimizers[i]);
-               typeChecker(c->nspace, mb,p,TRUE);
+               InstrPtr p = newFcnCall(mb, "optimizer", optimizers[i]);
+               typeChecker(c->nspace, mb, p, TRUE);
                /* niels added else leaks */
                //pushInstruction(mb, p);
        }
-       if( oldbase)
+       if (oldbase)
                GDKfree(oldbase);
 }
 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to