Skip to content

Commit b1fa49f

Browse files
committed
Merge branch 'main' into update-build-pipeline
2 parents 365e5aa + a6333a6 commit b1fa49f

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/cloudsync.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,14 +2031,17 @@ int cloudsync_payload_apply (sqlite3_context *context, const char *payload, int
20312031
stmt_reset(vm);
20322032
}
20332033

2034-
char buf[256];
2035-
if (xdata.dbversion != dbversion) {
2036-
snprintf(buf, sizeof(buf), "%lld", xdata.dbversion);
2037-
dbutils_settings_set_key_value(db, context, CLOUDSYNC_KEY_CHECK_DBVERSION, buf);
2038-
}
2039-
if (xdata.seq != seq) {
2040-
snprintf(buf, sizeof(buf), "%lld", xdata.seq);
2041-
dbutils_settings_set_key_value(db, context, CLOUDSYNC_KEY_CHECK_SEQ, buf);
2034+
if (rc == SQLITE_DONE) rc = SQLITE_OK;
2035+
if (rc == SQLITE_OK) {
2036+
char buf[256];
2037+
if (xdata.dbversion != dbversion) {
2038+
snprintf(buf, sizeof(buf), "%lld", xdata.dbversion);
2039+
dbutils_settings_set_key_value(db, context, CLOUDSYNC_KEY_CHECK_DBVERSION, buf);
2040+
}
2041+
if (xdata.seq != seq) {
2042+
snprintf(buf, sizeof(buf), "%lld", xdata.seq);
2043+
dbutils_settings_set_key_value(db, context, CLOUDSYNC_KEY_CHECK_SEQ, buf);
2044+
}
20422045
}
20432046

20442047
// cleanup vm
@@ -2048,6 +2051,7 @@ int cloudsync_payload_apply (sqlite3_context *context, const char *payload, int
20482051
if (clone) cloudsync_memory_free(clone);
20492052

20502053
if (rc != SQLITE_DONE) {
2054+
sqlite3_result_error(context, sqlite3_errmsg(db), -1);
20512055
sqlite3_result_error_code(context, SQLITE_MISUSE);
20522056
return -1;
20532057
}

0 commit comments

Comments
 (0)