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

Modified Files:
      Tag: SQL_2-16
        sql.mx sql_scenario.mx 
Log Message:
all mil tests now get HAVE_MONETDB4 conditional
removed backend_interpret (not needed anymore)
fixed 2 leaks in m5/sql
        1) in str_cast (obvious unused/not freed GDKmalloc)
        2) when destroying functions from the cache we no also correctly
                cleanup the stack 



Index: sql_scenario.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_scenario.mx,v
retrieving revision 1.243.2.1
retrieving revision 1.243.2.2
diff -u -d -r1.243.2.1 -r1.243.2.2
--- sql_scenario.mx     2 Feb 2007 16:26:27 -0000       1.243.2.1
+++ sql_scenario.mx     21 Feb 2007 10:06:37 -0000      1.243.2.2
@@ -89,23 +89,14 @@
 static void
 monet5_freestack(backend_stack stk)
 {
-       (void) stk;
+       if (stk)
+               GDKfree(stk);
 #ifdef _SQL_SCENARIO_DEBUG
        stream_printf(GDKout, "#monet5_freestack\n");
 #endif
 }
 
 static void
-monet5_parse(backend_stack stk, char *cmd)
-{
-       (void) stk;
-       (void) cmd;
-#ifdef _SQL_SCENARIO_DEBUG
-       stream_printf(GDKout, "#monet5_parse:%s\n", cmd);
-#endif
-}
-
-static void
 monet5_freecode(backend_code code, backend_stack stk, int nr, char *name)
 {
        int ret = 0;
@@ -188,7 +179,6 @@
        be_funcs = GDKzalloc(sizeof(backend_functions));
        be_funcs->fstack                = &monet5_freestack;
        be_funcs->fcode                 = &monet5_freecode;
-       be_funcs->finterpret    = &monet5_parse;
        monet5_user_init(be_funcs);
        backend_init(be_funcs); /* be_funcs probably leaks */
 

Index: sql.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql.mx,v
retrieving revision 1.207.2.3
retrieving revision 1.207.2.4
diff -u -d -r1.207.2.3 -r1.207.2.4
--- sql.mx      13 Feb 2007 12:06:33 -0000      1.207.2.3
+++ sql.mx      21 Feb 2007 10:06:33 -0000      1.207.2.4
@@ -1845,7 +1845,7 @@
        int tpe = getArgType(mb, pci, 5);
        int len   = *(int *) getArgReference(stk, pci, 6);
        int sz = len + 1;
-       char *r = GDKmalloc(sz);
+       char *r = NULL;
        mvc *m = NULL;
        str msg = getContext(&m, NULL);
 
@@ -1861,7 +1861,8 @@
                        r = GDKstrdup(v);
        }
        if (len > 0 && sz > len) {
-               GDKfree(r);
+               if (r) 
+                       GDKfree(r);
                if (ATOMcmp(TYPE_str, ATOMnilptr(TYPE_str), p) != 0) {
                        throw(SQL, "str_cast", "value too long for type 
(var)char(%d)", len);
                } else {


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to