/ Check-in [9bd92afd]
Login

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

Overview
Comment:Register the "vfsstat" virtual table immediately when loading the vfsstat.c extension.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:9bd92afd0cb0a958441e861c7006b77027125b1ceea0868958ec948b6b3c7bc9
User & Date: drh 2019-02-12 12:25:34
Context
2019-02-12
15:51
Increase the version number to 3.28.0 for the next release cycle. check-in: 6eb38c59 user: drh tags: trunk
12:25
Register the "vfsstat" virtual table immediately when loading the vfsstat.c extension. check-in: 9bd92afd user: drh tags: trunk
01:28
New test cases in test/fuzzdata8.db. check-in: ab2356f5 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/vfsstat.c.

   779    779   
   780    780   /*
   781    781   ** This routine is an sqlite3_auto_extension() callback, invoked to register
   782    782   ** the vfsstat virtual table for all new database connections.
   783    783   */
   784    784   static int vstatRegister(
   785    785     sqlite3 *db,
   786         -  const char **pzErrMsg,
   787         -  const struct sqlite3_api_routines *pThunk
          786  +  char **pzErrMsg,
          787  +  const sqlite3_api_routines *pThunk
   788    788   ){
   789    789     return sqlite3_create_module(db, "vfsstat", &VfsStatModule, 0);
   790    790   }
   791    791   
   792    792   #ifdef _WIN32
   793    793   __declspec(dllexport)
   794    794   #endif
................................................................................
   805    805   ){
   806    806     int rc = SQLITE_OK;
   807    807     SQLITE_EXTENSION_INIT2(pApi);
   808    808     vstat_vfs.pVfs = sqlite3_vfs_find(0);
   809    809     vstat_vfs.base.szOsFile = sizeof(VStatFile) + vstat_vfs.pVfs->szOsFile;
   810    810     rc = sqlite3_vfs_register(&vstat_vfs.base, 1);
   811    811     if( rc==SQLITE_OK ){
   812         -    rc = sqlite3_auto_extension(vstatRegister);
          812  +    rc = vstatRegister(db, pzErrMsg, pApi);
          813  +    if( rc==SQLITE_OK ){
          814  +      rc = sqlite3_auto_extension(vstatRegister);
          815  +    }
   813    816     }
   814    817     if( rc==SQLITE_OK ) rc = SQLITE_OK_LOAD_PERMANENTLY;
   815    818     return rc;
   816    819   }