1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

If an EXCEPTION_IN_PAGE_ERROR exception is caught, make the underlying OS error code available via sqlite3_system_errno().

FossilOrigin-Name: fdb20e9ee48465b94aa6ac3c5e263ecaa7c3b10f4a193e79f965b7c35944b08b
This commit is contained in:
dan
2021-09-10 21:28:56 +00:00
parent ee7c667a36
commit 9023444fea
9 changed files with 94 additions and 26 deletions

View File

@@ -136,6 +136,23 @@ void sqlite3ErrorClear(sqlite3 *db){
*/
void sqlite3SystemError(sqlite3 *db, int rc){
if( rc==SQLITE_IOERR_NOMEM ) return;
#ifdef SQLITE_USE_SEH
if( rc==SQLITE_IOERR_IN_PAGE ){
int ii;
int iErr;
sqlite3BtreeEnterAll(db);
for(ii=0; ii<db->nDb; ii++){
if( db->aDb[ii].pBt ){
iErr = sqlite3PagerWalSystemErrno(sqlite3BtreePager(db->aDb[ii].pBt));
if( iErr ){
db->iSysErrno = iErr;
}
}
}
sqlite3BtreeLeaveAll(db);
return;
}
#endif
rc &= 0xff;
if( rc==SQLITE_CANTOPEN || rc==SQLITE_IOERR ){
db->iSysErrno = sqlite3OsGetLastError(db->pVfs);