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); } }