From: dan Date: Tue, 4 Aug 2015 15:29:43 +0000 (+0000) Subject: Update the [showdb] program so that the database file is read directly (bypassing... X-Git-Tag: version-3.9.0~240 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=30c16ade950f4f38673c7ab2ef745365bfa18f35;p=thirdparty%2Fsqlite.git Update the [showdb] program so that the database file is read directly (bypassing the SQLite VFS) only if the --raw option is specified. Otherwise, it is read using the default VFS. Also, the URI syntax may be used on the command line to specify the name of the database file to examine, so an alternative VFS may be requested using a URI parameter. FossilOrigin-Name: e3c6d4b6e738c7ea015c0c809a5f7d1a94dda945 --- 30c16ade950f4f38673c7ab2ef745365bfa18f35 diff --cc manifest index ed6d210969,8f78b59000..7a5106a61f --- a/manifest +++ b/manifest @@@ -1,5 -1,5 +1,5 @@@ - C In\sthe\ssqlite3_analyzer.exe\sutility,\sshow\sthe\sdepth\sof\seach\sbtree\sand\sreport\nthe\saverage\sfanout\sof\sindexes\sand\sWITHOUT\sROWID\stables. - D 2015-08-04T14:18:10.060 -C Update\sthe\s[showdb]\sprogram\sso\sthat\sthe\sdatabase\sfile\sis\sread\sdirectly\s(bypassing\sthe\sSQLite\sVFS)\sonly\sif\sthe\s--raw\soption\sis\sspecified.\sOtherwise,\sit\sis\sread\susing\sthe\sdefault\sVFS.\sAn\salternative\sVFS\smay\sbe\sspecified\sby\sspecifying\sthe\sdatabase\sfile\sto\sopen\susing\sthe\sURI\ssyntax. -D 2015-08-04T15:23:49.470 ++C Update\sthe\s[showdb]\sprogram\sso\sthat\sthe\sdatabase\sfile\sis\sread\sdirectly\s(bypassing\sthe\sSQLite\sVFS)\sonly\sif\sthe\s--raw\soption\sis\sspecified.\sOtherwise,\sit\sis\sread\susing\sthe\sdefault\sVFS.\sAlso,\sthe\sURI\ssyntax\smay\sbe\sused\son\sthe\scommand\sline\sto\sspecify\sthe\sname\sof\sthe\sdatabase\sfile\sto\sexamine,\sso\san\salternative\sVFS\smay\sbe\srequested\susing\sa\sURI\sparameter. ++D 2015-08-04T15:29:43.068 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 4de3ef40c8b3b75c0c55ff4242a43c8ce1ad90ee F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@@ -1343,7 -1343,7 +1343,7 @@@ F tool/opcodeDoc.awk b3a2a3d5d3075b8bd9 F tool/pagesig.c ff0ca355fd3c2398e933da5e22439bbff89b803b F tool/restore_jrnl.tcl 6957a34f8f1f0f8285e07536225ec3b292a9024a F tool/rollback-test.c 9fc98427d1e23e84429d7e6d07d9094fbdec65a5 - F tool/showdb.c 3b5d335d537e4dc44d0c86967023819453c87dc6 -F tool/showdb.c 95ed172060f91dd881c65f3906cbb8a43861f3ac ++F tool/showdb.c b1e16174385d5bd0815823a7fda1ecc82ed6088b F tool/showjournal.c 053eb1cc774710c6890b7dd6293300cc297b16a5 F tool/showlocks.c 9920bcc64f58378ff1118caead34147201f48c68 F tool/showstat4.c 9515faa8ec176599d4a8288293ba8ec61f7b728a @@@ -1368,7 -1368,7 +1368,7 @@@ F tool/vdbe_profile.tcl 67746953071a9f8 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f - P 70b57dafb3216feb21091883196831fa1252e7bf - R 13388672818fef0d2cb76a948959a6c9 - U drh - Z 06142420513d4bba3f9f1464c1f7a39e -P 90e34d5119f720496e86a3a6de7771ea87b7dcbb -R 9d7c9f8de5d6d6fb5bb80e2cb324c919 ++P cd997770013e923ac3fa34b1546b97681923c8b1 9699e9bd9a0e813d04c9d37422920670697c46ed ++R 7b43c0477e767bd928070744aae8eca7 + U dan -Z dbdc532b6b382833636acb3f205bead9 ++Z 8f4e8fe91dd9aa3d32924c08cf340019 diff --cc manifest.uuid index 191c9d8ba5,1b21715e9c..e75093fbf5 --- a/manifest.uuid +++ b/manifest.uuid @@@ -1,1 -1,1 +1,1 @@@ - cd997770013e923ac3fa34b1546b97681923c8b1 -9699e9bd9a0e813d04c9d37422920670697c46ed ++e3c6d4b6e738c7ea015c0c809a5f7d1a94dda945 diff --cc tool/showdb.c index c90f410d95,0b88282f1c..892cacd552 --- a/tool/showdb.c +++ b/tool/showdb.c @@@ -18,10 -19,16 +19,16 @@@ #include "sqlite3.h" - static int pagesize = 1024; /* Size of a database page */ - static int db = -1; /* File descriptor for reading the DB */ - static int mxPage = 0; /* Last page number */ - static int perLine = 16; /* HEX elements to print per line */ + static struct GlobalData { + int pagesize; /* Size of a database page */ + int dbfd; /* File descriptor for reading the DB */ + int mxPage; /* Last page number */ + int perLine; /* HEX elements to print per line */ + int bRaw; /* True to access db file via OS APIs */ - sqlite3_file *pFd; /* File descriptor for URI mode */ ++ sqlite3_file *pFd; /* File descriptor for non-raw mode */ + sqlite3 *pDb; /* Database handle that owns pFd */ + } g = {1024, -1, 0, 16, 0, 0, 0}; + typedef long long int i64; /* Datatype for 64-bit integers */