Changeset: 3ed9c41d5dfb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3ed9c41d5dfb
Modified Files:
        sql/backends/monet5/sql.c
Branch: Jan2022
Log Message:

If an error has already triggered, rollback the transaction and ignore further 
errors


diffs (39 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -5026,18 +5026,23 @@ str_column_vacuum_callback(int argc, voi
 
        } while(0);
 
-       switch (sql_trans_end(session, SQL_OK)) {
-               case SQL_ERR:
-                       TRC_ERROR((component_t) SQL, 
"[str_column_vacuum_callback] -- transaction commit failed (kernel error: %s)", 
GDKerrbuf);
-                       res = GDK_FAIL;
-                       break;
-               case SQL_CONFLICT:
-                       TRC_ERROR((component_t) SQL, 
"[str_column_vacuum_callback] -- transaction is aborted because of concurrency 
conflicts, will ROLLBACK instead");
-                       res = GDK_FAIL;
-                       break;
-               default:
-                       break;
-       }
+       if (res == GDK_SUCCEED) { /* everything is ok, do the commit route */
+               switch (sql_trans_end(session, SQL_OK)) {
+                       case SQL_ERR:
+                               TRC_ERROR((component_t) SQL, 
"[str_column_vacuum_callback] -- transaction commit failed (kernel error: %s)", 
GDKerrbuf);
+                               res = GDK_FAIL;
+                               break;
+                       case SQL_CONFLICT:
+                               TRC_ERROR((component_t) SQL, 
"[str_column_vacuum_callback] -- transaction is aborted because of concurrency 
conflicts, will ROLLBACK instead");
+                               res = GDK_FAIL;
+                               break;
+                       default:
+                               break;
+               }
+       } else { /* an error triggered, rollback and ignore further errors */
+               (void)sql_trans_end(session, SQL_ERR);
+       }
+
        sql_session_destroy(session);
        sa_destroy(sa);
        return res;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to