Changeset: 42380b60557d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=42380b60557d
Modified Files:
        monetdb5/mal/mal_import.c
        monetdb5/modules/atoms/Tests/inet01.malC
Branch: malerrors
Log Message:

Fix register MAL function


diffs (45 lines):

diff --git a/monetdb5/mal/mal_import.c b/monetdb5/mal/mal_import.c
--- a/monetdb5/mal/mal_import.c
+++ b/monetdb5/mal/mal_import.c
@@ -293,20 +293,22 @@ compileString(Symbol *fcn, Client cntxt,
        mal_unquote(qry = GDKstrdup(s));
        if (old != s)
                GDKfree(s);
-       b = (buffer *) GDKmalloc(sizeof(buffer));
+       b = (buffer *) GDKzalloc(sizeof(buffer));
        if (b == NULL) {
                GDKfree(qry);
                return MAL_MALLOC_FAIL;
        }
 
-       buffer_init(b, qry, len);
-       c= MCinitClient((oid)0, bstream_create(buffer_rastream(b, 
"compileString"), b->len),0);
+       c= MCinitClient((oid)0, 0, 0);
        if( c == NULL){
                GDKfree(b);
                GDKfree(qry);
                throw(MAL,"mal.eval","Can not create user context");
        }
-       // compile in context of called
+       buffer_init(b, qry, len +1);
+       c->fdin = bstream_create(buffer_rastream(b, "compileString"), b->len);
+       strncpy(c->fdin->buf, qry, len+1);
+       // compile in context of called for
        c->curmodule = c->usermodule = cntxt->usermodule;
        c->promptlength = 0;
        c->listing = 0;
diff --git a/monetdb5/modules/atoms/Tests/inet01.malC 
b/monetdb5/modules/atoms/Tests/inet01.malC
--- a/monetdb5/modules/atoms/Tests/inet01.malC
+++ b/monetdb5/modules/atoms/Tests/inet01.malC
@@ -11,9 +11,9 @@ i4 := inet.new("192.168.0.3/24");
 io.print(i4);
 
 i5 := inet.new("/0");
-catch AnyException:str;
+catch ParseException:str;
 io.printf("Caught parse exception\n");
-exit AnyException;
+exit ParseException;
 io.print(i5);
 
 i6 := inet.new("127/32");
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to