]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
7 years agoVersion 3.21.0 branch-3.21 version-3.21.0
drh [Tue, 24 Oct 2017 18:55:49 +0000 (18:55 +0000)] 
Version 3.21.0

FossilOrigin-Name: 1a584e499906b5c87ec7d43d4abce641fdf017c42125b083109bc77c4de48827

7 years agoFix a problem in the incr-blob code causing a new cursor to be opened for
dan [Tue, 24 Oct 2017 17:28:25 +0000 (17:28 +0000)] 
Fix a problem in the incr-blob code causing a new cursor to be opened for
every sqlite3_blob_reopen() call.

FossilOrigin-Name: 41ef34a1f0650c50cacb203665cd9d57db53a49c979bf0d5a78937517f763a2c

7 years agoOn the amalgamation package, enable the sqlite_dbpage virtual table so that
drh [Mon, 23 Oct 2017 21:24:38 +0000 (21:24 +0000)] 
On the amalgamation package, enable the sqlite_dbpage virtual table so that
the .dbinfo command works in the CLI.

FossilOrigin-Name: 54b90b4f27f6f213825e881929fa04a6282e5b909a12e881366f9aef6872dcb6

7 years agoMerge trunk fixes to swarmvtabfault.test and the lsm extension into this
dan [Mon, 23 Oct 2017 20:20:42 +0000 (20:20 +0000)] 
Merge trunk fixes to swarmvtabfault.test and the lsm extension into this
branch. No changes to core SQLite code.

FossilOrigin-Name: f632b87002a7ee9be569aacb5ce85bb7e9c86b7d77bb8d1bf8b55eb5be4ecc77

7 years agoIn the 'swarmvtabfault' test module, make sure to close the database handle prior...
mistachkin [Mon, 23 Oct 2017 20:17:19 +0000 (20:17 +0000)] 
In the 'swarmvtabfault' test module, make sure to close the database handle prior to raising an error from the 'not found' callback script.

FossilOrigin-Name: f317037b31b19007e30bb41c54506d9d241a6d590c2b31e2ddda10d4f6e7605b

7 years agoCleanup a test database file prior to using it.
mistachkin [Mon, 23 Oct 2017 17:36:52 +0000 (17:36 +0000)] 
Cleanup a test database file prior to using it.

FossilOrigin-Name: e1bf5e1d06dbe573671c6b5472b45f5bfa3cf82374f70a76b4c80815bf15a29b

7 years agoUpdates to test procedures so that they all work with encryption. No changes
drh [Mon, 23 Oct 2017 16:34:07 +0000 (16:34 +0000)] 
Updates to test procedures so that they all work with encryption.  No changes
to the core SQLite code.

FossilOrigin-Name: 0481330756e861de8e1eb7136e7dca2f333b2a82377949d2e0eba401af7d73dd

7 years agoAvoid passing a NULL value as the second argument to memcpy().
dan [Mon, 23 Oct 2017 16:03:54 +0000 (16:03 +0000)] 
Avoid passing a NULL value as the second argument to memcpy().

FossilOrigin-Name: 58e5bb491bc0e28412ca188ba8fbe94adc67b5b1e9d7c112c36011400528d577

7 years agoIn lsm (not SQLite), avoid opening the *-shm file before the database file is
dan [Mon, 23 Oct 2017 11:48:00 +0000 (11:48 +0000)] 
In lsm (not SQLite), avoid opening the *-shm file before the database file is
locked. Otherwise, there is a race condition whereby a connection in another
process process may unlink() it while it is still in use.

FossilOrigin-Name: c8b8b9b573665c2b4d278bb679a48ac407374b8d860f0c3f4d50a303043464ad

7 years agoFix minor test script problems revealed by releasetest.tcl.
dan [Mon, 23 Oct 2017 07:53:00 +0000 (07:53 +0000)] 
Fix minor test script problems revealed by releasetest.tcl.

FossilOrigin-Name: c333ee7e9677bda1dad8e80cf94755350bfe20bc0754577442727b6f807ad831

7 years agoFix minor test script problems revealed by releasetest.tcl.
dan [Mon, 23 Oct 2017 07:52:07 +0000 (07:52 +0000)] 
Fix minor test script problems revealed by releasetest.tcl.

FossilOrigin-Name: 15e87d9bc81812fb9de86f9870389217dddb9f9c4d48e42acefce2d35ba293f1

7 years agoFix test cases in dbpage.test so that they work with
dan [Sun, 22 Oct 2017 08:03:39 +0000 (08:03 +0000)] 
Fix test cases in dbpage.test so that they work with
SQLITE_DEFAULT_AUTOVACUUM=1 builds.

FossilOrigin-Name: 9474f061d634721ca462bbad375270b8b39dea44011df3e1aac72021e8bf70fc

7 years agoFix test cases in dbpage.test so that they work with
dan [Sun, 22 Oct 2017 08:02:56 +0000 (08:02 +0000)] 
Fix test cases in dbpage.test so that they work with
SQLITE_DEFAULT_AUTOVACUUM=1 builds.

FossilOrigin-Name: 0fcf1e61ef2b6c1fb8f4846f973d2d427598ffbc80dbc49e56e71513b194bae7

7 years agoAvoid running tests that use sqlite_dbpage with SQLITE_OMIT_VIRTUAL_TABLE
dan [Sun, 22 Oct 2017 07:58:09 +0000 (07:58 +0000)] 
Avoid running tests that use sqlite_dbpage with SQLITE_OMIT_VIRTUAL_TABLE
builds.

FossilOrigin-Name: 6dde8d6154c5b4d36c7aad17d6eaafdb13c66a09d17d4c79f52b2417846ea0b5

7 years agoAvoid running tests that use sqlite_dbpage with SQLITE_OMIT_VIRTUAL_TABLE
dan [Sun, 22 Oct 2017 07:57:29 +0000 (07:57 +0000)] 
Avoid running tests that use sqlite_dbpage with SQLITE_OMIT_VIRTUAL_TABLE
builds.

FossilOrigin-Name: 7bd20a20a0f422765a6e469d1a1b67b95c4a441931688e04a2b1b491a5238528

7 years agoMerge all the enhancements and bug fixes from trunk, since none are
drh [Sat, 21 Oct 2017 17:17:17 +0000 (17:17 +0000)] 
Merge all the enhancements and bug fixes from trunk, since none are
destablizing.  Call this the second beta.

FossilOrigin-Name: fb3ee1b7cac09e4950e4f48b44c277e4f391cb6c8f069644732d2389ca653da4

7 years agoCatch and avoid a 16-bit integer overflow on the number of columns in a
drh [Sat, 21 Oct 2017 14:17:31 +0000 (14:17 +0000)] 
Catch and avoid a 16-bit integer overflow on the number of columns in a
common table expression.  This fixes a problem found by OSS-Fuzz.  The
test case is in TH3.

FossilOrigin-Name: 6ee8cb6ae5fd076ec226bb184b5690ba29f9df8cfaef47aaf13336873b4c1f6c

7 years agoRemove unnecessary "#if SQLITE_MAX_COLUMN". SQLITE_MAX_COLUMN is always
drh [Sat, 21 Oct 2017 13:29:26 +0000 (13:29 +0000)] 
Remove unnecessary "#if SQLITE_MAX_COLUMN".  SQLITE_MAX_COLUMN is always
defined.

FossilOrigin-Name: 6ec82acde81a46a75ed5931fc7dd813f2523753106ad7b8f0b544b9da9824d5a

7 years agoTake extra care to avoid an OOB read caused by a corrupt b-tree page.
dan [Thu, 19 Oct 2017 15:17:38 +0000 (15:17 +0000)] 
Take extra care to avoid an OOB read caused by a corrupt b-tree page.

FossilOrigin-Name: 04925dee41a21ffca9a9f9df27d8165431668c42c2b33d08b077fdb28011170b

7 years agoAvoid using snprintf as a member variable of a struct in sqlite3ext.h. This
dan [Wed, 18 Oct 2017 15:02:01 +0000 (15:02 +0000)] 
Avoid using snprintf as a member variable of a struct in sqlite3ext.h. This
causes problems on OSX. Similar to fix [a1fd3aa8].

FossilOrigin-Name: cd0471ca9f75e7c8be74536ff4ec85b5d70f0d7994b680ed5f45b9f12a46cf46

7 years agoAvoid using snprintf as a member variable of a struct in sqlite3ext.h. This sqlite3ext-fix
dan [Wed, 18 Oct 2017 14:29:36 +0000 (14:29 +0000)] 
Avoid using snprintf as a member variable of a struct in sqlite3ext.h. This
causes problems on OSX.

FossilOrigin-Name: b066d5a69f5391b2cef04b4e288f7d33e63a4ff54325b7e9fbd6aa42529c2f3c

7 years agoThe source code files generated for the 'sqlite3-all.c' target should not have Window...
mistachkin [Tue, 17 Oct 2017 18:33:22 +0000 (18:33 +0000)] 
The source code files generated for the 'sqlite3-all.c' target should not have Windows line-endings.

FossilOrigin-Name: 6a08c43431be18a08bdcbf33d327513f72fff72dac5d02103dab8399d8c3d668

7 years agoFix the ".check" command of the command-line shell to return 1 (error)
drh [Tue, 17 Oct 2017 13:44:46 +0000 (13:44 +0000)] 
Fix the ".check" command of the command-line shell to return 1 (error)
rather than 2 (exit) on a test failure.

FossilOrigin-Name: e2af0cc6ef5fafc785b8b73f51995901f50822972dcfb632494e22402596186d

7 years agoImproved comments, including a typo fix, on the whereLoopCheaperProperSubset()
drh [Mon, 16 Oct 2017 11:50:12 +0000 (11:50 +0000)] 
Improved comments, including a typo fix, on the whereLoopCheaperProperSubset()
function.

FossilOrigin-Name: 700a3c694438ca6cca185d0097f24799e82717ef38cb47bd83666c80f0e3cb2f

7 years agoIn the query planner, do not consider index X to be a proper subset of
drh [Sun, 15 Oct 2017 22:16:25 +0000 (22:16 +0000)] 
In the query planner, do not consider index X to be a proper subset of
index Y if X is a covering index but Y is not.

FossilOrigin-Name: ee31c04353cd75ea4bbadee2994c30d3808b696a4f680187502d104902988a5d

7 years agoUpdates to the Makefiles for MSVC. Cherrypick of [ac8786f3f9f35cb6].
mistachkin [Sat, 14 Oct 2017 19:58:37 +0000 (19:58 +0000)] 
Updates to the Makefiles for MSVC.  Cherrypick of [ac8786f3f9f35cb6].

FossilOrigin-Name: 92eb721faefcdd8396072722d3e4d7ca41b860b306e4bb0f0191dde8f30d0add

7 years agoUpdates to the Makefiles for MSVC.
mistachkin [Sat, 14 Oct 2017 19:54:06 +0000 (19:54 +0000)] 
Updates to the Makefiles for MSVC.

FossilOrigin-Name: ac8786f3f9f35cb6fa72c65f5ca41cc6659f4702cd29ab0c9dcf04d3d1189090

7 years agoImproved ability to generate stand-alone program using TCL and SQLite by
drh [Fri, 13 Oct 2017 20:14:06 +0000 (20:14 +0000)] 
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

7 years agoAdd the tcl/mkccode.tcl script used to construct a single C-language source
drh [Fri, 13 Oct 2017 18:58:55 +0000 (18:58 +0000)] 
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

7 years agoMove a bunch of unrelated test code out of tclsqlite.c and into
drh [Fri, 13 Oct 2017 16:19:48 +0000 (16:19 +0000)] 
Move a bunch of unrelated test code out of tclsqlite.c and into
test_*.c files.  There is still some test code in tclsqlite.c, but the amount
is greatly reduced.

FossilOrigin-Name: a9c4bc88fcf985a0bea14ed5381239cfb697886287998da04a10230b6858ab5d

7 years agoThe db_use_legacy_prepare command no longer exists. Use the undocumented tclsqlite-cleanup
drh [Fri, 13 Oct 2017 16:01:36 +0000 (16:01 +0000)] 
The db_use_legacy_prepare command no longer exists.  Use the undocumented
-use-legacy-prepare option to DB version instead.

FossilOrigin-Name: ea2fa9ab9b3c97e001c1a2f3e24f3554b544070d5f915b9827eb07eb5ea8f00b

7 years agoWhen compiling with SQLITE_TEST, extra options are available on the
drh [Fri, 13 Oct 2017 15:56:26 +0000 (15:56 +0000)] 
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

7 years agoMove some test logic out of tclsqlite.c and into auxiliary test_*.c files.
drh [Fri, 13 Oct 2017 15:06:06 +0000 (15:06 +0000)] 
Move some test logic out of tclsqlite.c and into auxiliary test_*.c files.
This is a work in progress.

FossilOrigin-Name: 95b7687fed75b32a62a0c62d397f4f543bf40095e13c22e15938d5dcfd71fcdf

7 years agoAdd the sqlite_dbpage virtual table (enabled using SQLITE_ENABLE_DBPAGE_VTAB).
drh [Thu, 12 Oct 2017 20:37:20 +0000 (20:37 +0000)] 
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

7 years agoCreate the new ext/repair folder and move checkfreelist.c there. Remove
drh [Thu, 12 Oct 2017 19:50:28 +0000 (19:50 +0000)] 
Create the new ext/repair folder and move checkfreelist.c there.  Remove
checkfreelist.c from the command-line shell (undoing check-in [48418f2e]).

FossilOrigin-Name: dfdebd12bfc80b91d234ab328cb6106d5d37ccb79b58e36e556c1a8af640a4ab

7 years agoFix a harmless compiler warning about an unused parameter.
drh [Thu, 12 Oct 2017 14:18:38 +0000 (14:18 +0000)] 
Fix a harmless compiler warning about an unused parameter.

FossilOrigin-Name: de20133d44773f0b3b8869db5c1cb2a90f0426a54c7f40d12a930003343ad8e0

7 years agoFix the "snapshot-tarball" makefile target, which was broken by the shell.c
drh [Thu, 12 Oct 2017 14:13:20 +0000 (14:13 +0000)] 
Fix the "snapshot-tarball" makefile target, which was broken by the shell.c
change of check-in [36acc0a9].

FossilOrigin-Name: c643ace24c1936f9d2b16bd6d1d13cf08070dfe5b094208b638924e904915339

7 years agoMerge fixes from trunk. All changes are on makefiles and test scripts.
drh [Thu, 12 Oct 2017 14:03:09 +0000 (14:03 +0000)] 
Merge fixes from trunk.  All changes are on makefiles and test scripts.
There are no core code changes.

FossilOrigin-Name: 1fb87a0c6e4db1f8bf51d552d9af1252544b7d7bd2dd80f78870f3b4fd347bad

7 years agoThe src/shell.c file is now generated from src/shell.c.in, so remove shell.c
drh [Thu, 12 Oct 2017 13:47:48 +0000 (13:47 +0000)] 
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

7 years agoMerge fixes from the 3.21 branch.
drh [Thu, 12 Oct 2017 13:21:56 +0000 (13:21 +0000)] 
Merge fixes from the 3.21 branch.

FossilOrigin-Name: 292921692c8919d29f0a67d03ca953d5c1c4900d8c8567cceab27513732be598

7 years agoFix a potential crash that may follow an OOM or other system error in the shell tool.
dan [Thu, 12 Oct 2017 11:33:13 +0000 (11:33 +0000)] 
Fix a potential crash that may follow an OOM or other system error in the shell tool.

FossilOrigin-Name: c36761e1a05c15c48468dd793faf06636f5dcfd3b4314074c4d9c9eac5c2695c

7 years agoUpdate some test cases to work with SQLITE_OMIT_VIRTUALTABLE and
dan [Thu, 12 Oct 2017 11:13:34 +0000 (11:13 +0000)] 
Update some test cases to work with SQLITE_OMIT_VIRTUALTABLE and
DEFAULT_AUTOVACUUM builds.

FossilOrigin-Name: 4b68f424ca9b5d4b0e77065a4e60ec0f70dcce0d01053fd7a6b2ecae9d3a5967

7 years agoMake sure the tableColumnList() routine of the command-line shell does not
drh [Thu, 12 Oct 2017 10:28:30 +0000 (10:28 +0000)] 
Make sure the tableColumnList() routine of the command-line shell does not
cause a null-pointer dereference in an error condition.

FossilOrigin-Name: 5d0ceb8dcdef92cd72307e532a4a6c269b2c458fecb0bbede0bb941099eebc5b

7 years agoMerge fixes from the 3.21 branch.
drh [Thu, 12 Oct 2017 01:24:36 +0000 (01:24 +0000)] 
Merge fixes from the 3.21 branch.

FossilOrigin-Name: 18d4654fd161900f98ff435ea9e0a3c44b9972f84ee9f43096f9998f844ff857

7 years agoFix a typo in a numeric constant in an assert() - a bug that has been present
drh [Thu, 12 Oct 2017 01:19:06 +0000 (01:19 +0000)] 
Fix a typo in a numeric constant in an assert() - a bug that has been present
in the code since check-in [79e22b95038] on 2010-03-30.

FossilOrigin-Name: f0a2724f0a255cd5a262f31e4ee1f99ae713c25a9ecc56dc794c95f223453b9b

7 years agoAdd test file mmapwarm.test. With tests for the sqlite3_mmap_warm() extension.
dan [Wed, 11 Oct 2017 20:27:03 +0000 (20:27 +0000)] 
Add test file mmapwarm.test. With tests for the sqlite3_mmap_warm() extension.

FossilOrigin-Name: 5c4980ef17291dcea5e93ead353b9a95e2fbff56ff7257e9878d095f6827b4e9

7 years agoAdd the checkfreelist extension to the command-line shell.
drh [Wed, 11 Oct 2017 18:26:26 +0000 (18:26 +0000)] 
Add the checkfreelist extension to the command-line shell.

FossilOrigin-Name: 48418f2ed5ab1cb270776166141ce32ed3ebf22ed4e33a66a204d4fde9d11f52

7 years agoCheck that the leaf count on each freelist trunk page is in range as part of
dan [Wed, 11 Oct 2017 18:21:44 +0000 (18:21 +0000)] 
Check that the leaf count on each freelist trunk page is in range as part of
checkfreelist processing.

FossilOrigin-Name: 4e89406248f51d3b83d61e5472fb493f3d3b4ff2a69bf256c7e15445eeb2f3ec

7 years agoAdd new extension "checkfreelist", which uses sqlite_dbpage to check that
dan [Wed, 11 Oct 2017 18:00:34 +0000 (18:00 +0000)] 
Add new extension "checkfreelist", which uses sqlite_dbpage to check that
there are no invalid entries on the database free-list.

FossilOrigin-Name: 21930ef5376261d95fa325be7761d327a350d4ae6b4573c83ddb4d294dea51c4

7 years agoConvert the implementation of the ".dbstat" dot-command of the command-line
drh [Wed, 11 Oct 2017 17:51:08 +0000 (17:51 +0000)] 
Convert the implementation of the ".dbstat" dot-command of the command-line
shell to use the sqlite_dbpage table.

FossilOrigin-Name: 497409e167c7c025fbddc319b4fa9a8b965f70d05ac88c060dee469f70321388

7 years agoMake JSON1 defines consistent in the makefiles for MSVC.
mistachkin [Wed, 11 Oct 2017 17:50:22 +0000 (17:50 +0000)] 
Make JSON1 defines consistent in the makefiles for MSVC.

FossilOrigin-Name: 31eee0e4bffc5419e076a589049bfea7327dfc666fcc2767c0b700f506055c4e

7 years agoEnable JSON by default in the Windows command-line shell sqlite3.exe.
drh [Wed, 11 Oct 2017 17:25:08 +0000 (17:25 +0000)] 
Enable JSON by default in the Windows command-line shell sqlite3.exe.

FossilOrigin-Name: 79c96121baf065fd78ba4f1fe82ce725b6372df20e9323d88022b7c243701372

7 years agoEnable sqlite_dbpage and dbstat virtual tables in the shell, by default.
drh [Wed, 11 Oct 2017 17:13:29 +0000 (17:13 +0000)] 
Enable sqlite_dbpage and dbstat virtual tables in the shell, by default.

FossilOrigin-Name: 01bf856c424c20b464f26973720bf5dcd3e89509c5b02c3625d4828f0385d3db

7 years agoGet writes working on the sqlite_dbpage virtual table. Add a few test cases.
drh [Wed, 11 Oct 2017 15:02:53 +0000 (15:02 +0000)] 
Get writes working on the sqlite_dbpage virtual table.  Add a few test cases.

FossilOrigin-Name: a8b264d811e5bcb7e3ae8a12bf5b6830a9d1adff1f59436dda9e886f97da242f

7 years agoInitial implementation of the "sqlite_dbpage" virtual table. Currently
drh [Wed, 11 Oct 2017 13:48:11 +0000 (13:48 +0000)] 
Initial implementation of the "sqlite_dbpage" virtual table.  Currently
it is read-only and has a place-holder xBestIndex.

FossilOrigin-Name: c2c1d656e3f52465192c2a697a976cd1837ccc4e10708a2377cff8bf6eaa7d49

7 years agoIn the speed-check.sh test script, allow an additional test-name argument
drh [Wed, 11 Oct 2017 12:20:36 +0000 (12:20 +0000)] 
In the speed-check.sh test script, allow an additional test-name argument
which becomes the comparison baseline, in place of "trunk".

FossilOrigin-Name: 0245adffc6f9b580217e0d2feb396d6895e54cdc25f5dfc9c8f4090b919e9e49

7 years agoCreate a branch for the 3.21.0 release. Development continues on trunk.
drh [Wed, 11 Oct 2017 11:12:20 +0000 (11:12 +0000)] 
Create a branch for the 3.21.0 release.  Development continues on trunk.

FossilOrigin-Name: 0f160a8abb0409b6e687ebc13b732559b3d65428f72430df142fd925eb39e9a2

7 years agoDROP TABLE now works for WITHOUT ROWID tables and the SQLITE_OMIT_AUTOVACUUM
drh [Tue, 10 Oct 2017 13:37:22 +0000 (13:37 +0000)] 
DROP TABLE now works for WITHOUT ROWID tables and the SQLITE_OMIT_AUTOVACUUM
compile-time option.  Fix for ticket [e651b1341861d6]

FossilOrigin-Name: b8c1b5a584aeb6ab63cff875ca16135efeadac16b4b32afa589845477feebf32

7 years agoFix harmless compiler warnings in FTS5 seen with MSVC.
mistachkin [Sun, 8 Oct 2017 02:22:06 +0000 (02:22 +0000)] 
Fix harmless compiler warnings in FTS5 seen with MSVC.

FossilOrigin-Name: 5594a121bf132a98d0ecb4cf86d9f2681925c9416206096bf11c9370a5dae22f

7 years agoFix harmless compiler warning seen with MSVC.
mistachkin [Sat, 7 Oct 2017 23:58:55 +0000 (23:58 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: 39d920d1ef0cce40195b21e148f78f544710348fa180c0e76f743a73e5236d45

7 years agoRevise variable declaration moved in the previous check-in so sqlite3VdbeReset()...
mistachkin [Sat, 7 Oct 2017 23:35:40 +0000 (23:35 +0000)] 
Revise variable declaration moved in the previous check-in so sqlite3VdbeReset() is consistent with sqlite3VdbeRewind().

FossilOrigin-Name: 63d1b425ee6a7d2ae782b738d81d98e39342ae7fe7c4fd217a28a0bdafe4f222

7 years agoFix C99-style variable declaration issue seen with older versions of MSVC.
mistachkin [Sat, 7 Oct 2017 23:31:33 +0000 (23:31 +0000)] 
Fix C99-style variable declaration issue seen with older versions of MSVC.

FossilOrigin-Name: 14b181e862bd742555c51b87fab59d6f8f6602fe2c18dde3ef3b020779912419

7 years agoAdd tests for the example fts3 "rank" function that appears in the
dan [Fri, 6 Oct 2017 18:00:36 +0000 (18:00 +0000)] 
Add tests for the example fts3 "rank" function that appears in the
documentation.

FossilOrigin-Name: 702b137aa4f76543647e177beeb1ca2b3cd18c61021c78880e9aa8656f341d65

7 years agoFix compiler warnings that come up with SQLITE_OMIT_WAL.
drh [Thu, 5 Oct 2017 20:57:38 +0000 (20:57 +0000)] 
Fix compiler warnings that come up with SQLITE_OMIT_WAL.

FossilOrigin-Name: 8ca0fa8dfe6a66aea7fc63f15e6f704cb190aa0760a3fec2db5f6bad3861a135

7 years agoFix a problem building with SQLITE_OMIT_WAL defined.
dan [Thu, 5 Oct 2017 20:02:49 +0000 (20:02 +0000)] 
Fix a problem building with SQLITE_OMIT_WAL defined.

FossilOrigin-Name: 373b0ace480aa303bbf512ea8806a17f6186b16d6316a7b724499bf94b3974d4

7 years agoFix the command-line shell so that the ".schema --indent" command does a better
drh [Thu, 5 Oct 2017 19:12:10 +0000 (19:12 +0000)] 
Fix the command-line shell so that the ".schema --indent" command does a better
job of dealing with \r\n in the middle of a CREATE statement in the schema.

FossilOrigin-Name: 4258fb578a6e75590c7314fe511ca8dc6659e5f2d3a54d8f60ff705fe51ccc92

7 years agoDisable the delta checksum verification in RBU by default. Reenable it using
drh [Thu, 5 Oct 2017 11:29:37 +0000 (11:29 +0000)] 
Disable the delta checksum verification in RBU by default.  Reenable it using
-DRBU_ENABLE_DELTA_CKSUM, if desired.

FossilOrigin-Name: d22c99b6ba997179ef3ccd341d9c36d5213d699305d15942d82587a0bfd16f9d

7 years agoUpdates to requirements marks.
drh [Wed, 4 Oct 2017 18:26:44 +0000 (18:26 +0000)] 
Updates to requirements marks.

FossilOrigin-Name: 40964a4ef7565ea0ddf452f48cb22373d068528e07d40eefc008f2231c969422

7 years agoUpdate the speedtest1 program so that it prints the output of "PRAGMA
dan [Wed, 4 Oct 2017 17:05:04 +0000 (17:05 +0000)] 
Update the speedtest1 program so that it prints the output of "PRAGMA
compile_options" if the -stats option is specified.

FossilOrigin-Name: 7c69f8f1089c3e3843fbf7ec37a897c849a3df822a4ce3b4fcde586adf991a3f

7 years agoFix typos in session extension header comments. No changes to code.
mistachkin [Wed, 4 Oct 2017 16:35:01 +0000 (16:35 +0000)] 
Fix typos in session extension header comments.  No changes to code.

FossilOrigin-Name: 182ec9d6f6c44938de0a2cd542e259d082deeeabc12a1815fff35e3ed1e524ef

7 years agoNew test cases for ticket [b899b6042f97f5] derived from a bug report on
drh [Wed, 4 Oct 2017 14:13:29 +0000 (14:13 +0000)] 
New test cases for ticket [b899b6042f97f5] derived from a bug report on
the mailing list from Wout Mertens.

FossilOrigin-Name: ef94ea061d2ec8ee0243e97dfcfc7a7c75dd22006e61a7195b780722bbc925db

7 years agoAmend recent changes to busy.test to avoid failing with SQLITE_ENABLE_STAT4
dan [Wed, 4 Oct 2017 12:08:35 +0000 (12:08 +0000)] 
Amend recent changes to busy.test to avoid failing with SQLITE_ENABLE_STAT4
builds.

FossilOrigin-Name: 9ff4944194c56b38843bc626dc51604db8e1ca8a0fd221e2d6f78c840d57c341

7 years agoTurn restriction 20 on the query flattener into an assert since the situation
drh [Wed, 4 Oct 2017 12:06:31 +0000 (12:06 +0000)] 
Turn restriction 20 on the query flattener into an assert since the situation
restricted can no longer occur because of the more aggressive use of
co-routines.

FossilOrigin-Name: 4464f40ccd7c5553f4d44120ca6dac4e9445f08f083f7dcb3bd66b4413d818e0

7 years agoAdd tests to verify that the busy-handler is invoked correctly when processing "PRAGM...
dan [Wed, 4 Oct 2017 10:39:28 +0000 (10:39 +0000)] 
Add tests to verify that the busy-handler is invoked correctly when processing "PRAGMA optimize" and ANALYZE commands.

FossilOrigin-Name: fb83c3d8df250cb701fbe775b48ab93f5674496f68c57e04f50668c43c2de328

7 years agoRemove a redundant restriction from the query flattener.
drh [Wed, 4 Oct 2017 05:59:54 +0000 (05:59 +0000)] 
Remove a redundant restriction from the query flattener.

FossilOrigin-Name: 66629b2a0997ceedcfb38553f2200466b6c4e352ea00f8a0a7cb67a660c19523

7 years agoFix a minor typo in the query flattener header comment. No code changes.
drh [Wed, 4 Oct 2017 02:30:45 +0000 (02:30 +0000)] 
Fix a minor typo in the query flattener header comment.  No code changes.

FossilOrigin-Name: d050dc605c24bcf60c0c47d13612ad53b871d3d4eff681c0c1b933acf53fb5ee

7 years agoSimplify the computation of types on columns of a view.
drh [Tue, 3 Oct 2017 19:53:12 +0000 (19:53 +0000)] 
Simplify the computation of types on columns of a view.

FossilOrigin-Name: 772b0db1469c9e1c2728cf65dd070e29c624e75c3a5da72ee1297f15d758dd13

7 years agoDo not enable SELECT tracing with -DSQLITE_DEBUG. Require the
drh [Tue, 3 Oct 2017 18:35:57 +0000 (18:35 +0000)] 
Do not enable SELECT tracing with -DSQLITE_DEBUG.  Require the
-DSQLITE_ENABLE_SELECTTRACE compile-time option to enable SELECT tracing.

FossilOrigin-Name: f5c395834c2a776beba6fe172cc4a5e428ce30b9cb4259ef8e440f10455a41e9

7 years agoAdd some OK_IF_ALWAYS_TRUE() marks on optimization branches in select.c.
drh [Tue, 3 Oct 2017 17:29:40 +0000 (17:29 +0000)] 
Add some OK_IF_ALWAYS_TRUE() marks on optimization branches in select.c.

FossilOrigin-Name: 1dd828088d6981dfebf9f4d650dad8431bece4405650c61f90eb8d8f43289b52

7 years agoRemove an unused variable from sqlite3Insert() and fix harmless
drh [Tue, 3 Oct 2017 17:17:34 +0000 (17:17 +0000)] 
Remove an unused variable from sqlite3Insert() and fix harmless
compiler warnings associated with -DSQLITE_MUTATION_TEST.

FossilOrigin-Name: 7be760e907274131bcd4acfaff9e72c9c59a05e7d411db3d9afe690fe0d64b4b

7 years agoFix the sqlite3_column_decltype() interface to return the correct datatype
drh [Tue, 3 Oct 2017 16:57:33 +0000 (16:57 +0000)] 
Fix the sqlite3_column_decltype() interface to return the correct datatype
when the value comes through a CTE.

FossilOrigin-Name: 966438bd259ade3a2d4a6ec9587ce79c81a21b942248bffb389995b9132b53e3

7 years agoThe simplification to sqlite3SelectExpand() in last night's
drh [Tue, 3 Oct 2017 14:24:24 +0000 (14:24 +0000)] 
The simplification to sqlite3SelectExpand() in last night's
[3a4ffb21] check-in was not completely correct.  This adjustment is needed
for correct OOM handling in some configurations.

FossilOrigin-Name: c5ad5e1675f6cb5a54df21606dfec2198a7cf88acc529460ebe27bdab128a6e5

7 years agoDo not compute column and row size estimates for the transient Table objects
drh [Tue, 3 Oct 2017 03:01:09 +0000 (03:01 +0000)] 
Do not compute column and row size estimates for the transient Table objects
associated with the result set of a SELECT statement, since those estimates
are never used for anything constructive.

FossilOrigin-Name: e4342fd401d4025eecc53ebfcd59f3150166a5f0bd6adb1b5820703bd4a1ec58

7 years agoMark a single branch within sqlite3SelectExpand() as an optimization.
drh [Mon, 2 Oct 2017 23:50:08 +0000 (23:50 +0000)] 
Mark a single branch within sqlite3SelectExpand() as an optimization.

FossilOrigin-Name: 3a4ffb21d0ee2326c31b9ddc512d79d4ebf3a249a2840e88e99165978eec31fd

7 years agoSimplification to sqlite3SelectPrep() for improved testability.
drh [Mon, 2 Oct 2017 23:30:45 +0000 (23:30 +0000)] 
Simplification to sqlite3SelectPrep() for improved testability.

FossilOrigin-Name: 5bf2ccb908dc6ebf7e063014b0a4bed7e3e9e0a555f78c6b4f6647adfb7209e4

7 years agoAdd the OK_IF_ALWAYS_TRUE() and OK_IF_ALWAYS_FALSE() macros for marking
drh [Mon, 2 Oct 2017 21:29:51 +0000 (21:29 +0000)] 
Add the OK_IF_ALWAYS_TRUE() and OK_IF_ALWAYS_FALSE() macros for marking
conditionals that improve performance but do not change the outcome.

FossilOrigin-Name: 6035c9b2728f47d338696978eb6fe5a7d6cb84bbea0792ef985c0986ac8f39dd

7 years agoAvoid using lookaside memory for persistent virtual table structures.
drh [Mon, 2 Oct 2017 13:20:43 +0000 (13:20 +0000)] 
Avoid using lookaside memory for persistent virtual table structures.

FossilOrigin-Name: d815f255dfbcd6d64326f7bc0ad3fe3c4ff08270ca75f8836ef2a919d5e57401

7 years agoThe query planner now always prefers to implement a FROM-clause subquery using
drh [Mon, 2 Oct 2017 02:52:54 +0000 (02:52 +0000)] 
The query planner now always prefers to implement a FROM-clause subquery using
a co-routine rather than flattening the subquery into the outer query.

FossilOrigin-Name: c9104b59c7ed360291f7f6fc8caae938e9840c77620d598e4096f78183bf807a

7 years agoImprovements to a comment in lempar.c. No code changes.
drh [Mon, 2 Oct 2017 02:32:12 +0000 (02:32 +0000)] 
Improvements to a comment in lempar.c.  No code changes.

FossilOrigin-Name: 8000d230171fe53599fc6a916666f60f88f789e6c9c6c2869514c02d837d6fc8

7 years agoMore details in the header comment of pushDownWhereTerms(). No changes to prefer-coroutine-sort-subquery
drh [Sat, 30 Sep 2017 11:47:06 +0000 (11:47 +0000)] 
More details in the header comment of pushDownWhereTerms().  No changes to
code.

FossilOrigin-Name: 928486231ff7cc0df17a5aa23a080a1b8720e168db5227a7dbd34861283ba689

7 years agoMake sure the SQLITE_Stat34 optimization switch is always 0x800, a value
drh [Sat, 30 Sep 2017 10:50:34 +0000 (10:50 +0000)] 
Make sure the SQLITE_Stat34 optimization switch is always 0x800, a value
which is hard-coded in the TH3 test suite.

FossilOrigin-Name: 6aed4ea34c4163c682ad5bb2956fdf4f3a3ad048fefd3edab0fef6761c3783cc

7 years agoFix unreachable conditionals and revise a testcase that was made obsolete by
drh [Sat, 30 Sep 2017 01:25:04 +0000 (01:25 +0000)] 
Fix unreachable conditionals and revise a testcase that was made obsolete by
the changes on this branch.

FossilOrigin-Name: 71f0adf7ca6824c3aba69104b9976dbb71b377474529e1a36220b4804293501e

7 years agoAlways render a subquery that is not part of a join as a co-routine.
drh [Fri, 29 Sep 2017 22:13:24 +0000 (22:13 +0000)] 
Always render a subquery that is not part of a join as a co-routine.

FossilOrigin-Name: 6b1651d711eae6e7c65a191f02ca2439160bcd677099712289e76a0f8422fd37

7 years agoMerge the query flattener comment improvements from trunk.
drh [Fri, 29 Sep 2017 16:08:46 +0000 (16:08 +0000)] 
Merge the query flattener comment improvements from trunk.

FossilOrigin-Name: f62cd4d940506c39db82e83ff3df8ab1856f1fb91ffda835ae2d727263ee9b0b

7 years agoClean up the comments on the query flattener to more clearly and accurately
drh [Fri, 29 Sep 2017 16:07:56 +0000 (16:07 +0000)] 
Clean up the comments on the query flattener to more clearly and accurately
express the conditions under which the flattener is able to run.

FossilOrigin-Name: 0840f9f824c16212ce3fd6c859e501176eb0a58924ea1728a54d5bdfd0c25c86

7 years agoMerge changes from trunk.
drh [Fri, 29 Sep 2017 14:31:16 +0000 (14:31 +0000)] 
Merge changes from trunk.

FossilOrigin-Name: 06f432fb7c979f1bb7f01f5c90716ce5c0248f73f70b78a9870b9de5c9bf7ef4

7 years agoMake sure the 6th parameter to the authorizer callback for view subqueries
drh [Fri, 29 Sep 2017 12:44:52 +0000 (12:44 +0000)] 
Make sure the 6th parameter to the authorizer callback for view subqueries
has the correct view name.

FossilOrigin-Name: 2a45bbc9fd1c64f1c4c4dac38f063cd67480fcb6da24bf93fdefbfca66fd81ab

7 years agoBetter names for subqueries in EXPLAIN comments.
drh [Fri, 29 Sep 2017 12:12:52 +0000 (12:12 +0000)] 
Better names for subqueries in EXPLAIN comments.

FossilOrigin-Name: 04ef40a8fea88776e0d8b73d942922d45d0c038fbfac1a9a82b9322181b4ad92

7 years agoDo not flatten subqueries that contain an ORDER BY or GROUP BY clause and
drh [Thu, 28 Sep 2017 20:06:53 +0000 (20:06 +0000)] 
Do not flatten subqueries that contain an ORDER BY or GROUP BY clause and
can be implemented using a co-routine.

FossilOrigin-Name: 042d655dd9002e8b89a798ad955b0285891aecf79f6978c5312e70ffe0609a46

7 years agoRemove the (undocumented) query-planner control that prevents
drh [Thu, 28 Sep 2017 17:29:24 +0000 (17:29 +0000)] 
Remove the (undocumented) query-planner control that prevents
a "SELECT ALL" subquery in FROM clause from being implemented as a co-routine.

FossilOrigin-Name: ff2f5a31a2ac67a2fdbb25793e8013cb0e062ab90bdcba2d52a62d6d4d8b6d18