changeset 86137:b44739543748 userprofile

Better error checking.
author Sjoerd Mullender <sjoerd@acm.org>
date Thu, 21 Jul 2022 14:57:05 +0200
parents 3bc8f8c4238f
children a6f5eda2607b
files sql/backends/monet5/sql_upgrades.c
diffstat 1 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -4690,19 +4690,19 @@ sql_update_default(Client c, mvc *sql)
 		err = SQLstatementIntern(c, buf, "update", true, false, NULL);
 		bat_iterator_end(&ui);
 		bat_iterator_end(&pi);
+		bat authbats[4];
+		authbats[0] = 0;
+		authbats[1] = u->batCacheid;
+		authbats[2] = p->batCacheid;
+		authbats[3] = d->batCacheid;
 		if (err == MAL_SUCCEED &&
-			BATmode(u, true) == GDK_SUCCEED &&
-			BATmode(p, true) == GDK_SUCCEED &&
-			BATmode(d, true) == GDK_SUCCEED &&
-			BBPrename(u, NULL) == 0 &&
-			BBPrename(p, NULL) == 0 &&
-			BBPrename(d, NULL) == 0) {
-			bat authbats[4];
-			authbats[0] = 0;
-			authbats[1] = u->batCacheid;
-			authbats[2] = p->batCacheid;
-			authbats[3] = d->batCacheid;
-			if (TMsubcommit_list(authbats, NULL, 4, getBBPlogno(), getBBPtransid()) != GDK_SUCCEED)
+			(BATmode(u, true) != GDK_SUCCEED ||
+			 BATmode(p, true) != GDK_SUCCEED ||
+			 BATmode(d, true) != GDK_SUCCEED ||
+			 BBPrename(u, NULL) != 0 ||
+			 BBPrename(p, NULL) != 0 ||
+			 BBPrename(d, NULL) != 0 ||
+			 TMsubcommit_list(authbats, NULL, 4, getBBPlogno(), getBBPtransid()) != GDK_SUCCEED)) {
 				fprintf(stderr, "Committing removal of old user/password BATs failed\n");
 		}
 		BBPunfix(u->batCacheid);