Changeset: 85c9a6dad1c5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=85c9a6dad1c5
Modified Files:
        monetdb5/optimizer/opt_iot.c
        monetdb5/optimizer/opt_prelude.c
        sql/backends/monet5/iot/basket.c
        sql/backends/monet5/iot/iot.c
        sql/backends/monet5/iot/iot.h
        sql/backends/monet5/iot/petrinet.h
        sql/backends/monet5/sql_optimizer.c
Branch: iot
Log Message:

Get it compile again


diffs (109 lines):

diff --git a/monetdb5/optimizer/opt_iot.c b/monetdb5/optimizer/opt_iot.c
--- a/monetdb5/optimizer/opt_iot.c
+++ b/monetdb5/optimizer/opt_iot.c
@@ -40,8 +40,6 @@
                fnd= 1; break;\
        }
 
-#undef OPTDEBUGiot
-#define OPTDEBUGiot
 int
 OPTiotImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
@@ -221,6 +219,11 @@ OPTiotImplementation(Client cntxt, MalBl
         if (old[i])
             pushInstruction(mb,old[i]);
 
+    /* Defense line against incorrect plans */
+       chkTypes(cntxt->fdout, cntxt->nspace, mb, FALSE);
+       chkFlow(cntxt->fdout, mb);
+       chkDeclarations(cntxt->fdout, mb);
+
        OPTDEBUGiot {
                mnstr_printf(cntxt->fdout, "#iot optimizer final\n");
                printFunction(cntxt->fdout, mb, stk, LIST_MAL_DEBUG);
diff --git a/monetdb5/optimizer/opt_prelude.c b/monetdb5/optimizer/opt_prelude.c
--- a/monetdb5/optimizer/opt_prelude.c
+++ b/monetdb5/optimizer/opt_prelude.c
@@ -454,6 +454,7 @@ void optimizerInit(void)
        subsortRef = putName("subsort");
        takeRef= putName("take");
        transRef= putName("trans");
+       transactionRef= putName("transaction");
        timestampRef = putName("timestamp");
        not_uniqueRef= putName("not_unique");
        sampleRef= putName("sample");
diff --git a/sql/backends/monet5/iot/basket.c b/sql/backends/monet5/iot/basket.c
--- a/sql/backends/monet5/iot/basket.c
+++ b/sql/backends/monet5/iot/basket.c
@@ -33,8 +33,7 @@
 #include "mal_builder.h"
 #include "opt_prelude.h"
 
-//#define _DEBUG_BASKET_ if(0)
-#define _DEBUG_BASKET_ 
+#define _DEBUG_BASKET_ if(0)
 
 str statusname[4] = { "<unknown>", "active", "paused", "locked" };
 
diff --git a/sql/backends/monet5/iot/iot.c b/sql/backends/monet5/iot/iot.c
--- a/sql/backends/monet5/iot/iot.c
+++ b/sql/backends/monet5/iot/iot.c
@@ -112,12 +112,16 @@ IOTquery(Client cntxt, MalBlkPtr mb, Mal
                        return msg;
                qry = cntxt->curprg->def;
        }
+       chkProgram(cntxt->fdout,cntxt->nspace,qry);
+       if( qry->errors)
+               msg = createException(SQL,"iot.query","Error in iot query");
 
        _DEBUG_IOT_ fprintf(stderr,"#iot: bake a new continuous query plan\n");
        scope = findModule(cntxt->nspace, putName(sch));
        s = newFunction(putName(sch), putName(nme), FUNCTIONsymbol);
        if (s == NULL)
-               throw(SQL, "iot.query", "Procedure code does not exist.");
+               msg = createException(SQL, "iot.query", "Procedure code does 
not exist.");
+
        freeMalBlk(s->def);
        s->def = copyMalBlk(qry);
        p = getInstrPtr(s->def, 0);
diff --git a/sql/backends/monet5/iot/iot.h b/sql/backends/monet5/iot/iot.h
--- a/sql/backends/monet5/iot/iot.h
+++ b/sql/backends/monet5/iot/iot.h
@@ -37,7 +37,7 @@
 #define iot_export extern
 #endif
 
-#define _DEBUG_IOT_ if(1)
+#define _DEBUG_IOT_ if(0)
 #define IOTout mal_clients[0].fdout
 
 iot_export MT_Lock iotLock;
diff --git a/sql/backends/monet5/iot/petrinet.h 
b/sql/backends/monet5/iot/petrinet.h
--- a/sql/backends/monet5/iot/petrinet.h
+++ b/sql/backends/monet5/iot/petrinet.h
@@ -23,7 +23,7 @@
 #include "sql_scenario.h"
 #include "basket.h"
 
-#define _DEBUG_PETRINET_ if(1)
+#define _DEBUG_PETRINET_ if(0)
 
 #define PNout mal_clients[1].fdout
 /*#define  _BASKET_SIZE_*/
diff --git a/sql/backends/monet5/sql_optimizer.c 
b/sql/backends/monet5/sql_optimizer.c
--- a/sql/backends/monet5/sql_optimizer.c
+++ b/sql/backends/monet5/sql_optimizer.c
@@ -228,7 +228,12 @@ addQueryToCache(Client c)
 {
        str msg = NULL;
 
+       chkProgram(c->fdout, c->nspace, c->curprg->def);
        insertSymbol(c->nspace, c->curprg);
+       if( c->curprg->def->errors){
+               showScriptException(c->fdout, c->curprg->def, 0, MAL, "MAL 
program contains errors");
+               GDKfree(msg);
+       }
        msg = optimizeQuery(c);
        if (msg != MAL_SUCCEED) {
                showScriptException(c->fdout, c->curprg->def, 0, MAL, "%s", 
msg);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to