Changeset: ffefb664c5fc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ffefb664c5fc
Modified Files:
        sql/backends/monet5/sql_cquery.c
Branch: trails
Log Message:

Allow to start a CQ if it is set to delete by the scheduler in a previous call 
in the same block.


diffs (32 lines):

diff --git a/sql/backends/monet5/sql_cquery.c b/sql/backends/monet5/sql_cquery.c
--- a/sql/backends/monet5/sql_cquery.c
+++ b/sql/backends/monet5/sql_cquery.c
@@ -539,7 +539,7 @@ CQregister(Client cntxt, MalBlkPtr mb, M
        }
 
        idx = CQlocateAlias(alias);
-       if(idx != pnettop) {
+       if(idx != pnettop && pnet[idx].status != CQDELETE) {
                msg = createException(SQL,"cquery.register",SQLSTATE(3F000) 
"The continuous %s %s is already registered.\n",
                                                          err_message, alias);
                GDKfree(alias);
@@ -975,7 +975,7 @@ CQderegister(str alias, int which)
 
        MT_lock_set(&ttrLock);
        idx = CQlocateAlias(alias);
-       if(idx == pnettop) {
+       if(idx == pnettop || pnet[idx].status == CQDELETE) {
                msg = createException(SQL, "cquery.deregister",
                                                          SQLSTATE(42000) "The 
continuous %s %s has not yet started\n", err_message, alias);
                goto unlock;
@@ -1339,6 +1339,10 @@ CQstartScheduler(void)
        }
 
        cntxt->curmodule = cntxt->usermodule = userModule();
+       if( cntxt->curmodule == NULL) {
+               MCcloseClient(cntxt, CQ_CLIENT);
+               throw(MAL, "cquery.startScheduler",SQLSTATE(HY001) "Could not 
initialize CQscheduler\n");
+       }
 
        if( SQLinitClient(cntxt) != MAL_SUCCEED) {
                MCcloseClient(cntxt, CQ_CLIENT);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to