SQLite

Check-in [9bd92afd0c]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9bd92afd0cb0a958441e861c7006b77027125b1ceea0868958ec948b6b3c7bc9
User & Date: drh 2019-02-12 12:25:34.464
Context
2019-02-12
15:51
Increase the version number to 3.28.0 for the next release cycle. (check-in: 6eb38c59a8 user: drh tags: trunk)
12:25
Register the "vfsstat" virtual table immediately when loading the vfsstat.c extension. (check-in: 9bd92afd0c user: drh tags: trunk)
01:28
New test cases in test/fuzzdata8.db. (check-in: ab2356f580 user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to ext/misc/vfsstat.c.
779
780
781
782
783
784
785
786
787


788
789
790
791
792
793
794
779
780
781
782
783
784
785


786
787
788
789
790
791
792
793
794







-
-
+
+








/*
** This routine is an sqlite3_auto_extension() callback, invoked to register
** the vfsstat virtual table for all new database connections.
*/
static int vstatRegister(
  sqlite3 *db,
  const char **pzErrMsg,
  const struct sqlite3_api_routines *pThunk
  char **pzErrMsg,
  const sqlite3_api_routines *pThunk
){
  return sqlite3_create_module(db, "vfsstat", &VfsStatModule, 0);
}

#ifdef _WIN32
__declspec(dllexport)
#endif
805
806
807
808
809
810
811


812


813
814
815
816
805
806
807
808
809
810
811
812
813

814
815
816
817
818
819







+
+
-
+
+




){
  int rc = SQLITE_OK;
  SQLITE_EXTENSION_INIT2(pApi);
  vstat_vfs.pVfs = sqlite3_vfs_find(0);
  vstat_vfs.base.szOsFile = sizeof(VStatFile) + vstat_vfs.pVfs->szOsFile;
  rc = sqlite3_vfs_register(&vstat_vfs.base, 1);
  if( rc==SQLITE_OK ){
    rc = vstatRegister(db, pzErrMsg, pApi);
    if( rc==SQLITE_OK ){
    rc = sqlite3_auto_extension(vstatRegister);
      rc = sqlite3_auto_extension(vstatRegister);
    }
  }
  if( rc==SQLITE_OK ) rc = SQLITE_OK_LOAD_PERMANENTLY;
  return rc;
}