Changeset: a003814d64ce for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a003814d64ce
Modified Files:
        monetdb5/mal/mal_embedded.c
        monetdb5/modules/atoms/mtime.c
        monetdb5/modules/mal/mal_init.mal
Branch: mdbl-mal
Log Message:

Another round, simplifying using callString()
SQL queries can be executed


diffs (96 lines):

diff --git a/monetdb5/mal/mal_embedded.c b/monetdb5/mal/mal_embedded.c
--- a/monetdb5/mal/mal_embedded.c
+++ b/monetdb5/mal/mal_embedded.c
@@ -19,6 +19,7 @@
 #include "mal_namespace.h"
 #include "mal_exception.h"
 #include "mal_private.h"
+#include "mal_builder.h"
 #include "mal_embedded.h"
 
 static int embeddedinitialized = 0;
@@ -82,13 +83,13 @@ static struct{
 #include "../modules/mal/sysmon.include"
 #include "../modules/mal/sample.include"
 
-//#include "../optimizer/optimizer.include"
+#include "../optimizer/optimizer.include"
 
 #include "../modules/mal/iterator.include"
 #include "../modules/mal/txtsim.include"
 #include "../modules/mal/tokenizer.include"
 
-//#include "../modules/mal/mal_mapi.include"
+#include "../modules/mal/mal_mapi.include"
 #include "../modules/mal/oltp.include"
 #include "../modules/mal/wlc.include"
 
@@ -111,27 +112,20 @@ str
 malEmbeddedBoot(Client c)
 {
        int i;
-       str s;
-       Symbol fcn;
+       str msg = MAL_SUCCEED;
 
-       (void) c;
+       
        if( embeddedinitialized )
                return MAL_SUCCEED;
        for(i = 0; malSignatures[i].modnme; i++){
-               // fprintf(stderr, "Module %s", malSignatures[i].modnme);
-
-               s = loadLibrary(malSignatures[i].modnme, FALSE);
-               if (s) {
-                       fprintf(stderr,"%s\n", s);
-                       GDKfree(s);
+               msg = callString(c, malSignatures[i].source, FALSE);
+               if (msg) {
+                       fprintf(stderr,"!ERROR: malEmbeddedBoot: %s\n", msg);
+                       GDKfree(msg);
                }
-
-               // fprintf(stderr, "Parse the source %s\n", 
malSignatures[i].source);
-               compileString(&fcn, c, malSignatures[i].source);
-               fprintFunction(stderr, c->curprg->def, 0, LIST_MAL_ALL);
        }
        embeddedinitialized = 1;
-       return MAL_SUCCEED;
+       return msg;
 }
 
 str
diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c
--- a/monetdb5/modules/atoms/mtime.c
+++ b/monetdb5/modules/atoms/mtime.c
@@ -1537,7 +1537,10 @@ MTIMEtimezone(tzone *ret, const char * c
        BATiter tzi;
 
        if ((p = BUNfnd(timezone_name, *name)) == BUN_NONE)
-               throw(MAL, "mtime.setTimezone", "unknown timezone");
+               throw(MAL, "mtime.setTimezone", "unknown timezone_name");
+       if ( timezone_def == 0)
+               throw(MAL, "mtime.setTimezone", "unknown timezone_def");
+
        tzi = bat_iterator(timezone_def);
        z = (tzone *) BUNtloc(tzi, p);
        if ((s = tzone_set_local(z)) != MAL_SUCCEED)
diff --git a/monetdb5/modules/mal/mal_init.mal 
b/monetdb5/modules/mal/mal_init.mal
--- a/monetdb5/modules/mal/mal_init.mal
+++ b/monetdb5/modules/mal/mal_init.mal
@@ -80,13 +80,13 @@
 #include sysmon;
 #include sample;
 
-include optimizer; -- FATAL: error initSQLreferences when embedded
+#include optimizer; -- FATAL: error initSQLreferences when embedded
 
 #include iterator;
 #include txtsim;
 #include tokenizer;
 
-include mal_mapi;
+#include mal_mapi;
 #include oltp;
 #include wlc;
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to