Changeset: 67fd1d81f0d6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/67fd1d81f0d6
Modified Files:
sql/server/sql_mvc.c
Branch: Jan2022
Log Message:
Cleanup
diffs (56 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
@@ -544,12 +544,9 @@ mvc_commit(mvc *m, int chain, const char
return msg;
}
if (chain) {
- if (sql_trans_begin(m->session) < 0) {
- if (!msg)
- 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);
- } else {
- m->session->auto_commit = 0; /* disable
auto-commit while chaining */
- }
+ if (sql_trans_begin(m->session) < 0)
+ return createException(SQL, "sql.commit",
SQLSTATE(40000) "%s finished successfully, but the session's schema could not
be found while starting the next transaction", operation);
+ m->session->auto_commit = 0; /* disable auto-commit
while chaining */
}
m->type = Q_TRANS;
TRC_INFO(SQL_TRANS,
@@ -602,7 +599,7 @@ mvc_commit(mvc *m, int chain, const char
case SQL_CONFLICT:
if (!msg)
msg = createException(SQL, "sql.commit",
SQLSTATE(40001) "%s transaction is aborted because of concurrency conflicts,
will ROLLBACK instead", operation);
- break;
+ return msg;
default:
break;
}
@@ -610,9 +607,9 @@ mvc_commit(mvc *m, int chain, const char
if (sql_trans_begin(m->session) < 0) {
if (!msg)
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);
- } else {
- m->session->auto_commit = 0; /* disable auto-commit
while chaining */
+ return msg;
}
+ m->session->auto_commit = 0; /* disable auto-commit while
chaining */
}
m->type = Q_TRANS;
TRC_INFO(SQL_TRANS,
@@ -667,11 +664,11 @@ mvc_rollback(mvc *m, int chain, const ch
(void)sql_trans_end(m->session, SQL_ERR);
if (chain) {
if (sql_trans_begin(m->session) < 0) {
- if (!msg)
- msg = createException(SQL,
"sql.rollback", SQLSTATE(40000) "ROLLBACK: finished successfully, but the
session's schema could not be found while starting the next transaction");
- } else {
- m->session->auto_commit = 0; /* disable
auto-commit while chaining */
+ msg = createException(SQL, "sql.rollback",
SQLSTATE(40000) "ROLLBACK: finished successfully, but the session's schema
could not be found while starting the next transaction");
+ m->session->status = -1;
+ return msg;
}
+ m->session->auto_commit = 0; /* disable auto-commit
while chaining */
}
}
if (msg == MAL_SUCCEED)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list