Skip to content

Commit

Permalink
Sqlite: fix DB corruption on some Samsung devices
Browse files Browse the repository at this point in the history
GitOrigin-RevId: bc3e631f6873c0a4a53b8aea2159727fa0d1e956
  • Loading branch information
arseny30 committed Aug 12, 2020
1 parent 0ef5577 commit d4f0162
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sqlite/sqlite/sqlite3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit d4f0162

Please sign in to comment.