diff options
author | Matthieu Gallien <matthieu.gallien@nextcloud.com> | 2022-01-17 20:54:08 +0300 |
---|---|---|
committer | Matthieu Gallien <matthieu.gallien@nextcloud.com> | 2022-01-19 14:01:20 +0300 |
commit | 6c71efee1fd10548f2ea9bef2f4a38cff42f2073 (patch) | |
tree | d5f0054b81f27685544de0d30f1cf71411109d37 /src | |
parent | 7523f07597d9e76991d7bfde992278dca2fcc427 (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.cpp | 2 |
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))); |