/ Check-in [b2e79f8f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Avoid downgrading SQLITE_CORRUPT errors detected by the schema parser into SQLITE_NOMEM or SQLITE_ERROR errors.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b2e79f8ff0836fcc98a2df9377aad9137307c34058030ecd1b5d4ec3277ed36a
User & Date: drh 2019-08-15 13:46:39
Context
2019-08-15
13:53
Ensure that SQLite does not attempt to process incompatible window functions in a single scan. Fix for [256741a1]. check-in: 4f5b2d93 user: dan tags: trunk
13:46
Avoid downgrading SQLITE_CORRUPT errors detected by the schema parser into SQLITE_NOMEM or SQLITE_ERROR errors. check-in: b2e79f8f user: drh tags: trunk
13:17
Ensure that the cell overwrite optimization does not overwrite the header of the b-tree page. check-in: 4cc5694c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/prepare.c.

   111    111       assert( (rc&0xFF)==(rcp&0xFF) );
   112    112       db->init.iDb = saved_iDb;
   113    113       /* assert( saved_iDb==0 || (db->mDbFlags & DBFLAG_Vacuum)!=0 ); */
   114    114       if( SQLITE_OK!=rc ){
   115    115         if( db->init.orphanTrigger ){
   116    116           assert( iDb==1 );
   117    117         }else{
   118         -        pData->rc = rc;
          118  +        if( rc > pData->rc ) pData->rc = rc;
   119    119           if( rc==SQLITE_NOMEM ){
   120    120             sqlite3OomFault(db);
   121    121           }else if( rc!=SQLITE_INTERRUPT && (rc&0xFF)!=SQLITE_LOCKED ){
   122    122             corruptSchema(pData, argv[1], sqlite3_errmsg(db));
   123    123           }
   124    124         }
   125    125       }