Skip to content

Commit d4f0162

Browse files
committed
Sqlite: fix DB corruption on some Samsung devices
GitOrigin-RevId: bc3e631f6873c0a4a53b8aea2159727fa0d1e956
1 parent 0ef5577 commit d4f0162

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sqlite/sqlite/sqlite3.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42840,7 +42840,8 @@ static int unixLockSharedMemory(unixFile *pDbFd, unixShmNode *pShmNode){
4284042840
** -shm header size) rather than 0 as a system debugging aid, to
4284142841
** help detect if a -shm file truncation is legitimate or is the work
4284242842
** or a rogue process. */
42843-
if( rc==SQLITE_OK && robust_ftruncate(pShmNode->hShm, 3) ){
42843+
/* Fix SQLite DB corruption on some Samsung devices (3 changed to 0) */
42844+
if( rc==SQLITE_OK && robust_ftruncate(pShmNode->hShm, 0) ){
4284442845
rc = unixLogError(SQLITE_IOERR_SHMOPEN,"ftruncate",pShmNode->zFilename);
4284542846
}
4284642847
}

0 commit comments

Comments
 (0)