Commit Graph

584 Commits

Author SHA1 Message Date
drh
60ba57d9c5 Merge enhancements from trunk.
FossilOrigin-Name: 150f07fec1e6d1fc0601820d717d8712fc513fe0d4bed67c8679eb51bca30d53
2017-12-23 18:34:49 +00:00
dan
43efc18669 Experimentally add the SQLite expert functionality to the shell tool.
FossilOrigin-Name: 51068dbaeaef13bb80af8126b8c4f3a454dee63de5127d706db50bf789533e60
2017-12-19 17:42:13 +00:00
dan
11546779b7 Merge latest trunk changes into this branch.
FossilOrigin-Name: d5b597b52a1213cdf382d96f4df3535727be0852b25bafd12bbef54da946c5f2
2017-12-16 19:16:24 +00:00
dan
d1b51d4955 Do not use the compress() and uncompress() functions in ext/misc/compress.c -
they are not quite compatible with the spec. Instead use new functions in
ext/misc/sqlar.c.

FossilOrigin-Name: 7652b3c2374084047b6c1da3e525e0cac34fe220597f81e793bc4fd9f33358da
2017-12-16 19:11:26 +00:00
dan
62128540ef Add script to amalgamate all LSM files into "lsm1.c".
FossilOrigin-Name: e32b69d73062e233b0ac853611d10b24546a346a603289ab0e339a3604ae2af4
2017-12-13 14:22:48 +00:00
dan
3d9c7c3a4f Merge latest trunk changes into this branch.
FossilOrigin-Name: 373fa21bffd37053bb1a741d3ace2f003a5639bf373c20ea7bb24a31080888b3
2017-11-29 16:16:29 +00:00
drh
1884d00dd0 Merge all recent enhancements from trunk.
FossilOrigin-Name: 24adf90ffb3ce9ff3c26efef0357f3a47312e8d11dc391ef2cc7e6873ef25895
2017-10-31 18:15:36 +00:00
drh
927dd51fce Add the checkfreelist extension to the sqlite3_checker binary.
FossilOrigin-Name: 0c22f0d6d19e595c0577b0bad416522e71647f54d2eb5cda587e2ccc5f63dd6a
2017-10-31 18:09:40 +00:00
drh
2737fa0376 Add build infrastructure for the sqlite3_checker command-line utility.
FossilOrigin-Name: 429e3c3c85d6b677038be93567f93e69eb756442bb421bb02ee5d5d69290fa09
2017-10-31 15:49:19 +00:00
drh
6f09910779 Fix redundancies in the makefiles that resulted from moving shell.c over
to shell.c.in.

FossilOrigin-Name: bf09fa683ea42b7552bd2f29ab5371bd175f0055cf9a453e6f8c6f4408cd168f
2017-10-31 12:20:43 +00:00
drh
666fb6914d Add the showshm utility program for printing out the shm header in a
human-readable format.

FossilOrigin-Name: f6304fd142c998aba44f02c6018223af2630671b4791d750b70a59ab1adb8d6d
2017-10-30 23:25:06 +00:00
drh
96a206fa10 Improved ability to generate stand-alone program using TCL and SQLite by
compiling with -DTCLSH_INIT_PROC=name to cause the TCL interpreter to be
initialized using procedure name().  Both sqlite3_analyzer and testfixture
are now built this way.

FossilOrigin-Name: d65d1f297ddb07b799ff5b2e560575fc59a6fa74c752269cc85ab84348fb7da4
2017-10-13 20:14:06 +00:00
drh
903b23022d Add the tcl/mkccode.tcl script used to construct a single C-language source
fiel for programs that combine C-code, SQLite, and TCL.  Use this script to
construct the sqlite3_analyzer program.

FossilOrigin-Name: 298a3fddec459c4fd2b840bd363239dc627f1dda90e2d5e478846cb895a8ad82
2017-10-13 18:58:55 +00:00
dan
2da1504432 Fix main.mk to name the win32 executable "sqlite3_expert.exe", not
"sqlite3_expert".

FossilOrigin-Name: e38571d518ff399d1033b33843dae60bc61181cdf692dcd8e2e14746bf0d1e61
2017-10-13 16:24:32 +00:00
drh
1df6470d35 When compiling with SQLITE_TEST, extra options are available on the
"DB version" command for controlling the internal state of the SqliteDb
object, for testing purposes.

FossilOrigin-Name: bf86478d9c6b899d6441e80cf9d17b58731e5d354e31b11f0d58a798f6fab896
2017-10-13 15:56:26 +00:00
drh
c318f730a4 Move some test logic out of tclsqlite.c and into auxiliary test_*.c files.
This is a work in progress.

FossilOrigin-Name: 95b7687fed75b32a62a0c62d397f4f543bf40095e13c22e15938d5dcfd71fcdf
2017-10-13 15:06:06 +00:00
dan
ae542401d8 Update main.mk to build the sqlite3_expert program with -DSQLITE_THREADSAFE=0
and -DSQLITE_OMIT_LOAD_EXTENSION. To minimize dependencies.

FossilOrigin-Name: 4c68ad7da48c941eb1ca0210a85d95467f3f3640bdc55a02686166471806ca4e
2017-10-13 14:20:15 +00:00
drh
88dd668942 Add the sqlite_dbpage virtual table (enabled using SQLITE_ENABLE_DBPAGE_VTAB).
Make that virtual table and dbstat available to the command-line shell.

FossilOrigin-Name: eaeeb09d4aa1dbccdd2488af8461e2a8c8a53d92c63fd56330be041ad72a9e4a
2017-10-12 20:37:20 +00:00
dan
4fa5cb3598 Update this branch to match latest trunk.
FossilOrigin-Name: d325da6c50f2f9c10f50b3839f87c155876c339879bb8bdb82567b5ff34ef7ba
2017-10-12 14:13:31 +00:00
drh
aa62d2e48f The src/shell.c file is now generated from src/shell.c.in, so remove shell.c
from version control and update the makefiles to build it automatically.

FossilOrigin-Name: 36acc0a97fdcc6f54f29c68c4e131702f69c3e59e58237ff4e5c647928699956
2017-10-12 13:47:48 +00:00
dan
518e3f0673 Merge latest trunk changes with this branch.
FossilOrigin-Name: 2719cf5c5bbe8e31d18368d54d968af3878ad2e15f0666e18d7b567d7439c451
2017-10-11 20:26:07 +00:00
drh
ca5cf1229b Enable sqlite_dbpage and dbstat virtual tables in the shell, by default.
FossilOrigin-Name: 01bf856c424c20b464f26973720bf5dcd3e89509c5b02c3625d4828f0385d3db
2017-10-11 17:13:29 +00:00
drh
a43c8c8a60 Initial implementation of the "sqlite_dbpage" virtual table. Currently
it is read-only and has a place-holder xBestIndex.

FossilOrigin-Name: c2c1d656e3f52465192c2a697a976cd1837ccc4e10708a2377cff8bf6eaa7d49
2017-10-11 13:48:11 +00:00
dan
460f1fa55c Add extension "mmapwarm.c". Provides function sqlite3_mmap_warm(), used to
"warm up" the memory mapping used by SQLite in mmap mode to access db file
content.

FossilOrigin-Name: d4a30b91f9aad93510baead8c04ee51b82c98763be5a224ed4873298214c963a
2017-09-18 16:28:56 +00:00
drh
f39e0ed4de Add the "mksourceid" program to the build process. That program changes
the SQLITE_SOURCE_ID if the source tree has been modified in any way.

FossilOrigin-Name: d4c05e04f7e1325a3260808ee17252876f678e78bf0cf6569a18a52ff674bd7a
2017-08-22 19:19:00 +00:00
dan
d8ecefa5ab Add the "unionvtab" virtual table extension in ext/misc/unionvtab.c.
FossilOrigin-Name: 62a86aa6c0519cf1fa232169122d3d6ae8d2f66b20530fb934a82a15712bd2f0
2017-07-15 20:48:30 +00:00
drh
0db5bfe5de Small adjustment to main.mk that facilitates giving non-standard compile-time
options to the shell.

FossilOrigin-Name: 7c7d53a9bbc27fde2dcc028cb7765c76cad0a784e53095b652c90d371968c53d
2017-07-06 22:43:41 +00:00
drh
c6603af755 Rename the "stmts" virtual table to just "stmt" without the final "s".
FossilOrigin-Name: adfdb80105c46ac42b71132c80a91dbd5b1c9ff241fb4fbb5d04641a88898d90
2017-06-29 14:33:51 +00:00
drh
c79983312f Add the stmts virtual table to testfixture builds. Add new compile-time
options SQLITE_ENABLE_QPSG and SQLITE_ENABLE_STMTSVTAB to ctime.c

FossilOrigin-Name: 60c628293a1d8a1505e1a36dbd01b1f62bcfd7915e144044c92385423cbf8e07
2017-06-29 13:41:59 +00:00
drh
f00f530b7d Build the "stmts" virtual table into the amalgamation. It is active only
when compiled using SQLITE_ENABLE_STMTSVTAB.  That option is supplied to the
command-line shell.

FossilOrigin-Name: 0ff057d86e42e518fda22bfbf5f1977ab6bd0a74a9211ff259ee7e8a7ce98b58
2017-06-28 15:47:29 +00:00
dan
e064d572e7 Remove the tool/schemalint.tcl script. And related Makefile entries. It is
superseded by sqlite3_expert.

FossilOrigin-Name: 269bf52e27611cd00fa7f73ee98b395a30dec215232cf1c34f6b741112ba530b
2017-05-04 14:02:05 +00:00
drh
138bd6df41 In sqlite3expert.c, do not copy the schema for virtual tables. Updates to
makefiles to make building easier.

FossilOrigin-Name: da15752dccf6090e40ec825db89048eca2b30185882225bf81f1891e914c2e7f
2017-05-03 12:15:20 +00:00
dan
cd84474ece Changes to allow the code in sqlite3expert.c to be tested directly (via the
API in sqlite3expert.h) instead of by invoking the sqlite3_expert application.
Fix memory leaks and other problems.

FossilOrigin-Name: 5dd9831721b70a89a26728adcd49c7f6103ef8266891a79c2db34d913702709e
2017-04-10 16:13:20 +00:00
dan
8e0b8e0688 Refactor code to suggest indexes from the shell tool into an extension in
ext/expert. Unfinished.

FossilOrigin-Name: 305e19f976ca064638a294e0817bf547ea745e1eb74746c5855514e6ced9c5fa
2017-04-07 20:14:22 +00:00
dan
fbf3bdcdbc Merge latest trunk into this branch.
FossilOrigin-Name: cb721d0b36268a7b0ef493fa4d7f6bcbaa9ead8b1990e3c3fae015fa1d545226
2017-03-31 11:20:20 +00:00
drh
688633cb9e Infrastructure for an extension C-library to implement sqlite3_db_dump() and
a corresponding "dbdump" command-line utility - both of which do the same
work as the ".dump" command of the CLI.

FossilOrigin-Name: 74c5ace498f72d7f5495203678bedd0bc540211131a4e4db7b62115d5322a288
2017-03-13 19:26:34 +00:00
drh
a6bf20b587 Fix an error in the SQLITE_MAX_MEMORY implementation resulting from a bad
merge.  Update the OSSFuzz interface so that it times out after running
the byte-code engine for 10 seconds.

FossilOrigin-Name: f8560c60d10c0365b33342ab05b5a953987b0471
2017-03-10 17:03:11 +00:00
drh
fb546afb4d Remove the test/dbselftest.c program. In its place, add the ".selftest"
command to the CLI.  The new CLI version is .selftest is slightly different
in that it uses SHA3 hashing instead of SHA1, so the new is subtly 
incompatible with the old.

FossilOrigin-Name: f4fcd46f08ba59d2a3e772cad98383129f648386
2017-03-09 22:00:33 +00:00
drh
b9e9bc1de6 Add the initial version of the "dbselftest" utility program.
FossilOrigin-Name: 1fcac8365e0f7bcfd55442d718da6626c864d45a
2017-02-07 17:36:12 +00:00
drh
d1b2566b07 Document the --mmap option in the --help screen for kvtest. Enhance kvtest so
that numeric arguments can have suffixes like "K" or "M".  Add kvtest to the
unix makefiles.

FossilOrigin-Name: 175bda87288c7ce15b163316159f53a60822ccad
2017-01-23 19:11:38 +00:00
drh
508286701a Get the "--testset rtree" option working on speedtest1. Add the --rtree,
--lookaside, and --clang options to the speed-check.sh script.

FossilOrigin-Name: 87b640c8d07a76b2bc7e896e01965cc09e06f77b
2017-01-20 16:09:12 +00:00
drh
6918e2f9b2 Enhance fuzzershell.c to read and execute SQL commands in the autoexec table
of the database under test.  Add the dbfuzz.c test program combining selected
features of fuzzershell.c and fuzzcheck.c.

FossilOrigin-Name: ef6e071a62cd79a0edbbef9f41ca9482540e5cb8
2016-12-17 20:27:22 +00:00
drh
c06e54345c Adjust the unix makefiles so that "make test" runs fuzzcheck prior to even
attempting to build the other test programs.

FossilOrigin-Name: bb48f7a55945da4cee369bae0809037900fcaac7
2016-12-14 11:23:51 +00:00
drh
c9c81dc6d7 Add the remember(V,PTR) extension function which copies an SQL value into
an application variable.

FossilOrigin-Name: d2d30914d81022d7d4e1670caf9326524520deaf
2016-11-30 16:54:52 +00:00
drh
362b66f051 Enhance fuzzcheck.c to accept database-specific configuration parameters in
the option CONFIG table.  Add the fuzzdata5.db fuzz database containing
test cases from OSS-FUZZ.

FossilOrigin-Name: a71fad4538311ede111815d221d9eb8d9018092b
2016-11-14 18:27:41 +00:00
drh
55377b4717 Fix the ossfuzz.c test module so that it does not segfault after a
"PRAGMA empty_result_callbacks=1;".  Add the ossshell.c program for
simple command-line testing of ossfuzz.c.

FossilOrigin-Name: 6f2d43eca68175ed28abae3afa792095af906af2
2016-11-14 17:25:57 +00:00
drh
ea432ba2df Add the test/ossfuzz.c interface adaptor for OSS-FUZZ. Make previsions for
testing the adaptor using fuzzcheck.c.

FossilOrigin-Name: 119d6ef8478ea6ab07dfd0e974d2f5a8dcfce87e
2016-11-11 16:33:47 +00:00
dan
000f95b1ba Add new file test_delete.c, containing test code for deleting an sqlite database.
FossilOrigin-Name: fb0b95e9405a3180d13c6318409af361e9df7632
2016-09-09 20:00:40 +00:00
drh
6bada27205 Prototype for the remember(V,PTR) extension function.
FossilOrigin-Name: f0942c362f45ca1e986e142dbdd3ad957626dfb1
2016-08-09 21:08:42 +00:00
drh
cc15313cc9 Add the experimental SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION compile-time option.
When enabled, the "unknown function" error is suppressed for EXPLAIN and
a no-op function named "unknown()" is substituted.  This facilitiates using
the command-line shell to analyze queries from applications that contain
many application-defined functions that are not normally available to the
shell.

FossilOrigin-Name: b7f30a9ff20d580fdaecdcf2b644d09ad6c2575e
2016-08-04 12:35:17 +00:00