From: drh <> Date: Thu, 8 Jan 2026 13:43:15 +0000 (+0000) Subject: Enhance the --vfs command-line option to the CLI such that if the argument X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22b08034aa4b2569cf54f40add494e5451fe4b7d;p=thirdparty%2Fsqlite.git Enhance the --vfs command-line option to the CLI such that if the argument is not a valid VFS name, but is the name of a file, attempt to load that file as an extension, which presumably adds the desired VFS. FossilOrigin-Name: 509954b44eb305a4401ddcbcce24d8f9ed5534717290888899d716b9df40c981 --- diff --git a/manifest b/manifest index 4a963a4fd0..8250b7a1a6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sthe\sshowdb\sutility,\sthe\s-tmstmp\soption\sworks\swithout\s-csv\sfor\sthe\spgidx\ncommand. -D 2026-01-08T13:20:36.301 +C Enhance\sthe\s--vfs\scommand-line\soption\sto\sthe\sCLI\ssuch\sthat\sif\sthe\sargument\nis\snot\sa\svalid\sVFS\sname,\sbut\sis\sthe\sname\sof\sa\sfile,\sattempt\sto\sload\sthat\nfile\sas\san\sextension,\swhich\spresumably\sadds\sthe\sdesired\sVFS. +D 2026-01-08T13:43:15.539 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -738,7 +738,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 47aa7fdc9ec4c19b103ac5e79d7887d30119b5675309facf5eed1118391c868b F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 4d45a04431db072040d6625ee21c1dc483c9b2b64a5ab419f4a4e05aabed1204 -F src/shell.c.in e15a10d4d11c3e34bc2059dd29e9c1f7e7eafe66c0c195310b21c4940c59511d +F src/shell.c.in 6c4f20a4787933b0a5fce307b7d9d67e00805966a52186f0c2cd04d75691c38b F src/sqlite.h.in 476f3efeb5dd26ad94dcbce262ca7eb9d042d797a92d624059c67ef37d5b3ab4 F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479 F src/sqlite3ext.h 5d5330f5f8461f5ce74960436ddcfa53ecd09c2b8b23901e22ae38aec3243998 @@ -2191,8 +2191,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P 6fa09449738af03d096208e26447b795f2825d6aaa397de09590cf18b065f82d -R 8fd9691005ccfe6bf27e94848c7c9911 +P c0aecd2189b431d82eca1c1d6718920cf928d910d443ea506e7b3bf3c5d7e246 +R 8831b900d82357c1d3aa973bdb8ea7c9 U drh -Z 0bc0a7bcfad2b426d91d7190bf1fff2a +Z b7d5cc86868374aca5662283466f56bc # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7e69b0f1c6..26f08c532c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c0aecd2189b431d82eca1c1d6718920cf928d910d443ea506e7b3bf3c5d7e246 +509954b44eb305a4401ddcbcce24d8f9ed5534717290888899d716b9df40c981 diff --git a/src/shell.c.in b/src/shell.c.in index 3e9136f7fb..d022517ec5 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -13023,6 +13023,21 @@ int SQLITE_CDECL main(int argc, char **argv){ sqlite3_vfs *pVfs = sqlite3_vfs_find(zVfs); if( pVfs ){ sqlite3_vfs_register(pVfs, 1); + }else if( access(zVfs,0)==0 ){ + /* If the VFS name is not the name of an existing VFS, but it is + ** the name of a file, then try to load that file as an extension. + ** Presumably the extension implements the desired VFS. */ + sqlite3 *db = 0; + char *zErr = 0; + sqlite3_open(":memory:", &db); + sqlite3_enable_load_extension(db, 1); + rc = sqlite3_load_extension(db, zVfs, 0, &zErr); + sqlite3_close(db); + if( (rc&0xff)!=SQLITE_OK ){ + cli_printf(stderr, "could not load extension VFS \"%s\": %s\n", + zVfs, zErr); + exit(1); + } }else{ cli_printf(stderr,"no such VFS: \"%s\"\n", zVfs); exit(1);