aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2020-11-18 21:50:05 +0000
committerdrh <drh@noemail.net>2020-11-18 21:50:05 +0000
commitf56a4bfcd12cb7990ef171ffb89d2a27cd03ed4e (patch)
tree32971050ece8f7cd4bc8705fefc56406b47bc983 /src
parent5a07d10fd15408218a6324bea6ff9ec080a73218 (diff)
downloadsqlite-f56a4bfcd12cb7990ef171ffb89d2a27cd03ed4e.tar.gz
sqlite-f56a4bfcd12cb7990ef171ffb89d2a27cd03ed4e.zip
Improvements to the mechanism that attempts to report SQLITE_CORRUPT if
pread() says that the underlying filesystem is corrupt. FossilOrigin-Name: b887c7504e7edeba758f3c1203c6cc56eef499fe05e7e6c6d82939bf7d78c57f
Diffstat (limited to 'src')
-rw-r--r--src/malloc.c3
-rw-r--r--src/os_unix.c1
-rw-r--r--src/vdbe.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/malloc.c b/src/malloc.c
index 79366d548..a0f7a739c 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -799,9 +799,6 @@ static SQLITE_NOINLINE int apiHandleError(sqlite3 *db, int rc){
sqlite3Error(db, SQLITE_NOMEM);
return SQLITE_NOMEM_BKPT;
}
- if( rc==SQLITE_IOERR_CORRUPTFS ){
- return SQLITE_CORRUPT_BKPT;
- }
return rc & db->errMask;
}
diff --git a/src/os_unix.c b/src/os_unix.c
index b1e017376..18f2b5461 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3384,7 +3384,6 @@ static int unixRead(
*/
switch( pFile->lastErrno ){
case ERANGE:
- case ENOENT:
case EIO:
#ifdef ENXIO
case ENXIO:
diff --git a/src/vdbe.c b/src/vdbe.c
index 5823ebd92..5d9aacbad 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -8157,7 +8157,11 @@ default: { /* This is really OP_Noop, OP_Explain */
** an error of some kind.
*/
abort_due_to_error:
- if( db->mallocFailed ) rc = SQLITE_NOMEM_BKPT;
+ if( db->mallocFailed ){
+ rc = SQLITE_NOMEM_BKPT;
+ }else if( rc==SQLITE_IOERR_CORRUPTFS ){
+ rc = SQLITE_CORRUPT_BKPT;
+ }
assert( rc );
if( p->zErrMsg==0 && rc!=SQLITE_IOERR_NOMEM ){
sqlite3VdbeError(p, "%s", sqlite3ErrStr(rc));