SQLite

Check-in [04f6439f]
Login

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

Overview
Comment:Fix seg-fault upon appendvfs attempt to open non-existent file.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 04f6439f4d9b9b1f717c3aa243a93585df7e7844c216fab5d15bebb050ab00b1
User & Date: larrybr 2021-04-07 09:31:32
Context
2021-04-07
12:02
Fix a possible crash that could occur when executing a drop column operation on a corrupt database schema. (check-in: c3378494 user: dan tags: trunk)
09:31
Fix seg-fault upon appendvfs attempt to open non-existent file. (check-in: 04f6439f user: larrybr tags: trunk)
2021-04-06
23:29
Do not apply the optimization that omits DISTINCT if all result terms are part of a UNIQUE index if the index is also a partial index. Fix for the bug reported by forum post 66954e9ece. (check-in: c2f940b0 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/misc/appendvfs.c.
526
527
528
529
530
531
532
533
534
535



536
537
538
539
540
541
542
  memset(pApndFile, 0, sizeof(ApndFile));
  pFile->pMethods = &apnd_io_methods;
  pApndFile->iMark = -1;    /* Append mark not yet written */

  rc = pBaseVfs->xOpen(pBaseVfs, zName, pBaseFile, flags, pOutFlags);
  if( rc==SQLITE_OK ){
    rc = pBaseFile->pMethods->xFileSize(pBaseFile, &sz);
  }
  if( rc ){
    pBaseFile->pMethods->xClose(pBaseFile);



    pFile->pMethods = 0;
    return rc;
  }
  if( apndIsOrdinaryDatabaseFile(sz, pBaseFile) ){
    /* The file being opened appears to be just an ordinary DB. Copy
    ** the base dispatch-table so this instance mimics the base VFS. 
    */







<
|
|
>
>
>







526
527
528
529
530
531
532

533
534
535
536
537
538
539
540
541
542
543
544
  memset(pApndFile, 0, sizeof(ApndFile));
  pFile->pMethods = &apnd_io_methods;
  pApndFile->iMark = -1;    /* Append mark not yet written */

  rc = pBaseVfs->xOpen(pBaseVfs, zName, pBaseFile, flags, pOutFlags);
  if( rc==SQLITE_OK ){
    rc = pBaseFile->pMethods->xFileSize(pBaseFile, &sz);

    if( rc ){
      pBaseFile->pMethods->xClose(pBaseFile);
    }
  }
  if( rc ){
    pFile->pMethods = 0;
    return rc;
  }
  if( apndIsOrdinaryDatabaseFile(sz, pBaseFile) ){
    /* The file being opened appears to be just an ordinary DB. Copy
    ** the base dispatch-table so this instance mimics the base VFS. 
    */