Changeset: d40dd622b787 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d40dd622b787
Modified Files:
        sql/backends/monet5/sql_scenario.c
        tools/monetdbe/monetdbe.c
Branch: Jul2021
Log Message:

Make sure started transactions always finish properly


diffs (48 lines):

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
@@ -480,6 +480,11 @@ SQLinit(Client c)
                        sql_table *t = s ? mvc_bind_table(m, s, 
"systemfunctions") : NULL;
                        if (t == NULL)
                                store->first = 1;
+                       msg = mvc_rollback(m, 0, NULL, false);
+               }
+               if (msg) {
+                       freeException(msg);
+                       msg = MAL_SUCCEED;
                }
        }
        if (store->first > 0) {
diff --git a/tools/monetdbe/monetdbe.c b/tools/monetdbe/monetdbe.c
--- a/tools/monetdbe/monetdbe.c
+++ b/tools/monetdbe/monetdbe.c
@@ -1562,20 +1562,22 @@ monetdbe_execute(monetdbe_statement *stm
        backend *b = (backend *) stmt_internal->mdbe->c->sqlcontext;
        mvc *m = b->mvc;
        monetdbe_database_internal *mdbe = stmt_internal->mdbe;
+       MalStkPtr glb = NULL;
+       cq *q = stmt_internal->q;
+       Symbol s = NULL;
 
        if ((mdbe->msg = SQLtrans(m)) != MAL_SUCCEED)
                return mdbe->msg;
 
        /* check if all inputs are bound */
        for(int i = 0; i< list_length(stmt_internal->q->f->ops); i++){
-               if (!stmt_internal->data[i].vtype)
-                       return createException(MAL, 
"monetdbe.monetdbe_execute", "Parameter %d not bound to a value", i);
+               if (!stmt_internal->data[i].vtype) {
+                       mdbe->msg = createException(MAL, 
"monetdbe.monetdbe_execute", "Parameter %d not bound to a value", i);
+                       goto cleanup;
+               }
        }
-       cq* q = stmt_internal->q;
-
-       MalStkPtr glb = NULL;
-       Symbol s = findSymbolInModule(mdbe->c->usermodule, q->f->imp);
-
+
+       s = findSymbolInModule(mdbe->c->usermodule, q->f->imp);
        if ((mdbe->msg = callMAL(mdbe->c, s->def, &glb, stmt_internal->args, 
0)) != MAL_SUCCEED)
                goto cleanup;
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to