Changeset: f2249db30745 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f2249db30745
Modified Files:
        monetdb5/mal/mal_module.c
        sql/backends/monet5/sql_scenario.c
Branch: Jan2022
Log Message:

If an epilogue function throws an exception, clear it


diffs (32 lines):

diff --git a/monetdb5/mal/mal_module.c b/monetdb5/mal/mal_module.c
--- a/monetdb5/mal/mal_module.c
+++ b/monetdb5/mal/mal_module.c
@@ -274,11 +274,13 @@ void freeModule(Module m)
        if ((s = findSymbolInModule(m, "epilogue")) != NULL) {
                InstrPtr pci = getInstrPtr(s->def,0);
                if (pci && pci->token == COMMANDsymbol && pci->argc == 1) {
-                       int ret = 0;
+                       int status = 0;
+                       str ret = MAL_SUCCEED;
 
                        assert(pci->fcn != NULL);
-                       (*pci->fcn)(&ret);
-                       (void)ret;
+                       ret = (*pci->fcn)(&status);
+                       freeException(ret);
+                       (void)status;
                }
        }
        freeSubScope(m);
diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -222,7 +222,7 @@ SQLepilogue(void *ret)
                if (!res)
                        res = msab_retreatScenario(s);
                if (res != NULL) {
-                       char *err = createException(MAL, "sql.start", "%s", 
res);
+                       char *err = createException(MAL, "sql.epilogue", "%s", 
res);
                        free(res);
                        return err;
                }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to