Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>2022-01-17 20:54:08 +0300
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>2022-01-19 14:01:20 +0300
commit6c71efee1fd10548f2ea9bef2f4a38cff42f2073 (patch)
treed5f0054b81f27685544de0d30f1cf71411109d37 /src
parent7523f07597d9e76991d7bfde992278dca2fcc427 (diff)
add assert to prevent database errors to be no op
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Diffstat (limited to 'src')
-rw-r--r--src/common/ownsql.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/ownsql.cpp b/src/common/ownsql.cpp
index 736f7f03f..8132472f3 100644
--- a/src/common/ownsql.cpp
+++ b/src/common/ownsql.cpp
@@ -308,8 +308,10 @@ bool SqlQuery::exec()
rc = sqlite3_reset(_stmt); /* This will also return SQLITE_LOCKED */
n++;
OCC::Utility::usleep(SQLITE_SLEEP_TIME_USEC);
+ Q_ASSERT_X(false, "SQLITE_LOCKED", "database is locked");
} else if (rc == SQLITE_BUSY) {
OCC::Utility::usleep(SQLITE_SLEEP_TIME_USEC);
+ Q_ASSERT_X(false, "SQLITE_BUSY", "database is locked");
n++;
}
} while ((n < SQLITE_REPEAT_COUNT) && ((rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED)));