Changeset: ce5cd7ea3f0d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ce5cd7ea3f0d
Modified Files:
        sql/server/sql_mvc.c
Branch: Jul2021
Log Message:

no WLC* on savepoints
to be able to see which line reports exception adapted one sqlstate.


diffs (53 lines):

diff --git a/sql/server/sql_mvc.c b/sql/server/sql_mvc.c
--- a/sql/server/sql_mvc.c
+++ b/sql/server/sql_mvc.c
@@ -525,6 +525,9 @@ mvc_commit(mvc *m, int chain, const char
                return msg;
        }
 
+       /* save points only */
+       assert(name || tr->parent);
+
        /* commit and cleanup nested transactions */
        if (tr->parent) {
                while (tr->parent != NULL && ok == SQL_OK) {
@@ -536,7 +539,7 @@ mvc_commit(mvc *m, int chain, const char
                        tr = sql_trans_destroy(tr);
                m->session->tr = tr;
                if (ok != SQL_OK)
-                       msg = createException(SQL, "sql.commit", 
SQLSTATE(40000) "%s transaction is aborted because of concurrency conflicts, 
will ROLLBACK instead", operation);
+                       msg = createException(SQL, "sql.commit", 
SQLSTATE(40001) "%s transaction is aborted because of concurrency conflicts, 
will ROLLBACK instead", operation);
        }
 
        /* if there is nothing to commit reuse the current transaction */
@@ -544,14 +547,6 @@ mvc_commit(mvc *m, int chain, const char
                if (!chain)
                        (void)sql_trans_end(m->session, ok);
                m->type = Q_TRANS;
-               /* save points not handled by WLC...
-               msg = WLCcommit(m->clientid);
-               if (msg != MAL_SUCCEED) {
-                       if ((other = mvc_rollback(m, chain, name, false)) != 
MAL_SUCCEED)
-                               freeException(other);
-                       return msg;
-               }
-               */
                TRC_INFO(SQL_TRANS,
                        "Commit done (no changes)\n");
                return msg;
@@ -559,14 +554,7 @@ mvc_commit(mvc *m, int chain, const char
 
        if ((ok = sql_trans_commit(tr)) == SQL_ERR)
                GDKfatal("%s transaction commit failed (perhaps your disk is 
full?) exiting (kernel error: %s)", operation, GDKerrbuf);
-       /*
-       msg = WLCcommit(m->clientid);
-       if (msg != MAL_SUCCEED) {
-               if ((other = mvc_rollback(m, chain, name, false)) != 
MAL_SUCCEED)
-                       freeException(other);
-               return msg;
-       }
-       */
+
        (void)sql_trans_end(m->session, ok);
        if (chain && sql_trans_begin(m->session) < 0)
                msg = createException(SQL, "sql.commit", SQLSTATE(40000) "%s 
finished successfully, but the session's schema could not be found while 
starting the next transaction", operation);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to