Improvements to the mechanism that attempts to report SQLITE_CORRUPT if
pread() says that the underlying filesystem is corrupt. FossilOrigin-Name: b887c7504e7edeba758f3c1203c6cc56eef499fe05e7e6c6d82939bf7d78c57f
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -3384,7 +3384,6 @@ static int unixRead(
|
||||
*/
|
||||
switch( pFile->lastErrno ){
|
||||
case ERANGE:
|
||||
case ENOENT:
|
||||
case EIO:
|
||||
#ifdef ENXIO
|
||||
case ENXIO:
|
||||
|
||||
+5
-1
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user