/ Check-in [9c1a5eba]
Login

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

Overview
Comment:When testing, avoid injecting an OOM fault into a file-control call made by SQLite on an unopened file-descriptor.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9c1a5eba3ec37c877af4b83c6f8c05b7140304f3d23e49832ba63e321247fc8d
User & Date: dan 2018-04-10 14:29:51
Context
2018-04-10
15:31
Fix a problem causing the LEFT JOIN strength reduction optimization to be incorrectly applied in some cases where the WHERE clause of the query contains a filter expression of the form "lhs.x IS NOT ?". check-in: 1fdaf2c3 user: dan tags: trunk
14:29
When testing, avoid injecting an OOM fault into a file-control call made by SQLite on an unopened file-descriptor. check-in: 9c1a5eba user: dan tags: trunk
12:33
Increase the version number to 3.23.1. check-in: 9488c87b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os.c.

   121    121   ** and we need to know about the failures.  Use sqlite3OsFileControlHint()
   122    122   ** when simply tossing information over the wall to the VFS and we do not
   123    123   ** really care if the VFS receives and understands the information since it
   124    124   ** is only a hint and can be safely ignored.  The sqlite3OsFileControlHint()
   125    125   ** routine has no return value since the return value would be meaningless.
   126    126   */
   127    127   int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
          128  +  if( id->pMethods==0 ) return SQLITE_NOTFOUND;
   128    129   #ifdef SQLITE_TEST
   129    130     if( op!=SQLITE_FCNTL_COMMIT_PHASETWO
   130    131      && op!=SQLITE_FCNTL_LOCK_TIMEOUT
   131    132     ){
   132    133       /* Faults are not injected into COMMIT_PHASETWO because, assuming SQLite
   133    134       ** is using a regular VFS, it is called after the corresponding
   134    135       ** transaction has been committed. Injecting a fault at this point
................................................................................
   138    139       ** The core must call OsFileControl() though, not OsFileControlHint(),
   139    140       ** as if a custom VFS (e.g. zipvfs) returns an error here, it probably
   140    141       ** means the commit really has failed and an error should be returned
   141    142       ** to the user.  */
   142    143       DO_OS_MALLOC_TEST(id);
   143    144     }
   144    145   #endif
   145         -  if( id->pMethods==0 ) return SQLITE_NOTFOUND;
   146    146     return id->pMethods->xFileControl(id, op, pArg);
   147    147   }
   148    148   void sqlite3OsFileControlHint(sqlite3_file *id, int op, void *pArg){
   149    149     if( id->pMethods ) (void)id->pMethods->xFileControl(id, op, pArg);
   150    150   }
   151    151   
   152    152   int sqlite3OsSectorSize(sqlite3_file *id){