aboutsummaryrefslogtreecommitdiffhomepage
path: root/sqlite
diff options
context:
space:
mode:
authorArseny Smirnov <arseny30@gmail.com>2020-08-12 22:54:34 +0300
committerArseny Smirnov <arseny30@gmail.com>2020-08-12 22:54:34 +0300
commitd4f0162ee91a2d5570f742dc533c1d35c282da07 (patch)
tree94d73ade19fc9fbfe3e391528f767afe558dae85 /sqlite
parent0ef55772092a46416b6392c4e628fffc263db5f2 (diff)
Sqlite: fix DB corruption on some Samsung devices
GitOrigin-RevId: bc3e631f6873c0a4a53b8aea2159727fa0d1e956
Diffstat (limited to 'sqlite')
-rw-r--r--sqlite/sqlite/sqlite3.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sqlite/sqlite/sqlite3.c b/sqlite/sqlite/sqlite3.c
index a4bbc9ccc..e558fd1c7 100644
--- a/sqlite/sqlite/sqlite3.c
+++ b/sqlite/sqlite/sqlite3.c
@@ -42840,7 +42840,8 @@ static int unixLockSharedMemory(unixFile *pDbFd, unixShmNode *pShmNode){
** -shm header size) rather than 0 as a system debugging aid, to
** help detect if a -shm file truncation is legitimate or is the work
** or a rogue process. */
- if( rc==SQLITE_OK && robust_ftruncate(pShmNode->hShm, 3) ){
+ /* Fix SQLite DB corruption on some Samsung devices (3 changed to 0) */
+ if( rc==SQLITE_OK && robust_ftruncate(pShmNode->hShm, 0) ){
rc = unixLogError(SQLITE_IOERR_SHMOPEN,"ftruncate",pShmNode->zFilename);
}
}