]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
5 years agoRework this changes so that instead of setting the WhereTerm.truthProb when stat4-truthprob
drh [Mon, 24 Feb 2020 16:46:08 +0000 (16:46 +0000)] 
Rework this changes so that instead of setting the WhereTerm.truthProb when
a term is seen to be of low selectivity, it merely sets a new flag
(the TERM_HIGHTRUTH flag) which causes whereLoopOutputAdjust() to ignore
that term.

FossilOrigin-Name: 4558163b6a525990f0f1b6629dbb76daf49bcaf1ddbaf0c50fe05ce9ee480ff8

5 years agoDisable the new analyzeG.test module if not building with STAT4.
drh [Mon, 24 Feb 2020 13:35:34 +0000 (13:35 +0000)] 
Disable the new analyzeG.test module if not building with STAT4.

FossilOrigin-Name: 4a9d3005769e0398183b03a3e132e3946b9d1c48073af2e0559d7beeac3245c0

5 years agoMerge bugfix from trunk.
drh [Mon, 24 Feb 2020 13:26:29 +0000 (13:26 +0000)] 
Merge bugfix from trunk.

FossilOrigin-Name: b542dee9de843c19664c19df7435c6034d23d0d213804d588ec0ff599082d576

5 years agoFix a problem with ALTER TABLE for views that have a nested FROM clause.
drh [Sun, 23 Feb 2020 17:34:45 +0000 (17:34 +0000)] 
Fix a problem with ALTER TABLE for views that have a nested FROM clause.
Ticket [f50af3e8a565776b].

FossilOrigin-Name: c431b3fd8fd0f6a6974bba3e9366b0430ec003d570e7ce70ceefbcff5fe4b6fa

5 years agoDo not activate the truthProb adjustment mechanism if the truth probability
drh [Sat, 22 Feb 2020 18:27:48 +0000 (18:27 +0000)] 
Do not activate the truthProb adjustment mechanism if the truth probability
is less than the heuristic value, as there could be correlations unknown to
stat4.  Also add additional tracing output to make truthProb adjustments more
visible.

FossilOrigin-Name: c535fea147ce5c6e4aab25d3c85a3f53a7364c5b5ee10fb6d393c5911a02be7e

5 years agoAdd new test file analyzeG.test, containing a test for the change on this branch.
dan [Sat, 22 Feb 2020 17:32:00 +0000 (17:32 +0000)] 
Add new test file analyzeG.test, containing a test for the change on this branch.

FossilOrigin-Name: 243ab1852a2291595527ea1f26e78ad83eda285ae28f876bc1c703677f495cfa

5 years agoWhen stat4 information is available, try to use it to improve the truth
drh [Sat, 22 Feb 2020 16:58:49 +0000 (16:58 +0000)] 
When stat4 information is available, try to use it to improve the truth
probability of WHERE clause terms that do not participate in the index.

FossilOrigin-Name: 1babd6ec5d60e2c34aa1c0285ead768a88004218468e97262411973fe3487022

5 years agoIn the OP_Column opcode, if the cursor is marked NullRow (due to being the
drh [Sat, 22 Feb 2020 13:01:19 +0000 (13:01 +0000)] 
In the OP_Column opcode, if the cursor is marked NullRow (due to being the
right table of a LEFT JOIN that does not match) and the cursor is the table
cursor for an OR-optimization with a covering index, then do not substitute
the covering index cursor, since the covering index cursor does not have
the NullRow flag set.  Ticket [aa4378693018aa99]

FossilOrigin-Name: f02030b3403d67734bba471a91ad5bfdb03ddf6fdc3ef14808a04495e43b0470

5 years agoAdd test case for previous commit.
dan [Thu, 20 Feb 2020 14:11:08 +0000 (14:11 +0000)] 
Add test case for previous commit.

FossilOrigin-Name: 14d14eb537075c6ac77513b1e7305bed8bc01a9034dfb763fd96f76400f2b705

5 years agoEarly-out on the INTERSECT query processing following an error.
drh [Thu, 20 Feb 2020 14:08:51 +0000 (14:08 +0000)] 
Early-out on the INTERSECT query processing following an error.

FossilOrigin-Name: a67cf5b7d37d5b1484be32092635faafd8f76e5881898cd9435517c4b287d663

5 years agoFix a potential NULL pointer dereference following OOM. Problem discovered
drh [Wed, 19 Feb 2020 15:39:46 +0000 (15:39 +0000)] 
Fix a potential NULL pointer dereference following OOM.  Problem discovered
by dbsqlfuzz.  Test case in TH3.

FossilOrigin-Name: 5aeb5a2d295e10d5fc1d456b3acaf8ac13c04cb5bb71a8c4571541d366e95887

5 years agoRemove a NEVER() macro and add a test case to cause its argument to be true.
drh [Tue, 18 Feb 2020 23:58:58 +0000 (23:58 +0000)] 
Remove a NEVER() macro and add a test case to cause its argument to be true.

FossilOrigin-Name: ee034fe916448e953ee7824e5c0db99a36a0ad138ebfb25f751bf84cb80a8fa7

5 years agoAdd the new sqlite3_create_filename() and sqlite3_free_filename() interfaces
drh [Tue, 18 Feb 2020 19:49:48 +0000 (19:49 +0000)] 
Add the new sqlite3_create_filename() and sqlite3_free_filename() interfaces
for use by Shims.  Use these interfaces inside the multiplexor.

FossilOrigin-Name: 9469f36ac89e4b75d0ab25fefbeff25201992c53141da915dcaa017083cab6db

5 years agoConvert invalid surrogates to 0xfffd when translating UTF.
drh [Mon, 17 Feb 2020 23:08:16 +0000 (23:08 +0000)] 
Convert invalid surrogates to 0xfffd when translating UTF.

FossilOrigin-Name: 7fab1393c2b22b1f3b159b631e06e7e0d3900850ee249c38e4d3cdd0aacf637e

5 years agoA better (smaller and faster) solution to ticket [4374860b29383380].
drh [Mon, 17 Feb 2020 19:25:07 +0000 (19:25 +0000)] 
A better (smaller and faster) solution to ticket [4374860b29383380].

FossilOrigin-Name: abc473fb8fb999005dc79a360e34f97b3b25429decf1820dd2afa5c19577753d

5 years agoTake care when checking the table of a TK_COLUMN expression node to see if the
drh [Mon, 17 Feb 2020 00:12:04 +0000 (00:12 +0000)] 
Take care when checking the table of a TK_COLUMN expression node to see if the
table is a virtual table to first ensure that the Expr.y.pTab pointer is not
null due to generated column optimizations.  Ticket [4374860b29383380].

FossilOrigin-Name: 9d0d4ab95dc0c56e053c2924ed322a9ea7b25439e6f74599f706905a1994e454

5 years agoAvoid an infinite recursion on an illegal recursive definition of an
drh [Sun, 16 Feb 2020 17:40:35 +0000 (17:40 +0000)] 
Avoid an infinite recursion on an illegal recursive definition of an
fts5vocab table.

FossilOrigin-Name: 109ee07433b274a39954cef62bf67d47bcda960df9bef56127210ebf1c3c104c

5 years agoFix problems in the constant propagation optimization that were introduced
drh [Thu, 13 Feb 2020 22:12:35 +0000 (22:12 +0000)] 
Fix problems in the constant propagation optimization that were introduced
by check-in [1c3e5c20a9e6f501].  Fix for ticket [1dcb4d44964846ad]

FossilOrigin-Name: c9a8defcef35a1fee6bcbb88252a2d0076dabe8381b0128b2257b5b5cc494e0f

5 years agoDisallow the skip-scan optimization in the absence of sqlite_stat1 data.
drh [Thu, 13 Feb 2020 14:51:54 +0000 (14:51 +0000)] 
Disallow the skip-scan optimization in the absence of sqlite_stat1 data.

FossilOrigin-Name: e0c6b8bdb76fcd4f08c89ff20dce6a33ef3c11752e1e919fec5c4e7d423c4b93

5 years agoOmit O_NOFOLLOW from the open() call when opening /dev/null, since /dev/null
drh [Thu, 13 Feb 2020 13:45:04 +0000 (13:45 +0000)] 
Omit O_NOFOLLOW from the open() call when opening /dev/null, since /dev/null
is a symlink on Solaris, we are told.

FossilOrigin-Name: 0c683c43a62fe25c6cb765e4a31556ec91a7c21af79349b3d7eeb13f73dd1cdc

5 years agoFix an incorrect assert() statement that was added yesterday.
drh [Thu, 13 Feb 2020 11:46:47 +0000 (11:46 +0000)] 
Fix an incorrect assert() statement that was added yesterday.
Tickets [41c1456a6e61c0e7] and [fb8c538a8f57ae2a].

FossilOrigin-Name: abfb043ebb0c55fdc2be58255bc852b13865d81fa4c2e0dbe8c375810557aafe

5 years agoIncrease the default upper bound on the number of parameters in a single
drh [Wed, 12 Feb 2020 20:50:20 +0000 (20:50 +0000)] 
Increase the default upper bound on the number of parameters in a single
SQL statement to 32766 (from 999).

FossilOrigin-Name: 2def75693a8ae002375aff80db0e6c970c75f75e8b6ba64f2c518712badb0ae8

5 years agoWhen determining whether an == or IS constraint in a WHERE clause makes an ORDER...
dan [Wed, 12 Feb 2020 11:57:35 +0000 (11:57 +0000)] 
When determining whether an == or IS constraint in a WHERE clause makes an ORDER BY term redundant, consider the collation sequence used by the == or IS comparison, not the collation sequence of the comparison expression itself. Possible fix for [fb8c538a8f].

FossilOrigin-Name: 16aed5d0c63dcdc2054dbb8a4b6b992476640433bf81e19301e6db5a3fc82633

5 years agoMark the sha1() extension function as SQLITE_DETERMINISTIC.
drh [Mon, 10 Feb 2020 19:24:49 +0000 (19:24 +0000)] 
Mark the sha1() extension function as SQLITE_DETERMINISTIC.

FossilOrigin-Name: 7d8dcfb95cea732e7588e7505bf80a171dd2e371b164c9435c6ac286060df6df

5 years agoFix the build for when SQLITE_VDBE_COVERAGE is used.
drh [Mon, 10 Feb 2020 13:29:10 +0000 (13:29 +0000)] 
Fix the build for when SQLITE_VDBE_COVERAGE is used.

FossilOrigin-Name: 084381649edf374ccc5664f136055109a31d4c3a19c4ae2ee5275f630507a2a3

5 years agoDuring byte-code generation, strive to avoid jumps that merely jump to the
drh [Fri, 7 Feb 2020 19:44:13 +0000 (19:44 +0000)] 
During byte-code generation, strive to avoid jumps that merely jump to the
following instruction.

FossilOrigin-Name: bcf876e67e75f6709f2b25683a3952bbbb87c672bb9d7af456feebc0ab9f6c31

5 years agoSimplify the code by removing the unsupported and undocumented
drh [Fri, 7 Feb 2020 01:12:53 +0000 (01:12 +0000)] 
Simplify the code by removing the unsupported and undocumented
SQLITE_HAS_CODEC compile-time option

FossilOrigin-Name: 5a877221ce90e7523059353a68650c5fdd28ed032807afc2f10afbfbf864bdfe

5 years agoThere is no need to keep track of the number of changed rows or of the
drh [Thu, 6 Feb 2020 20:46:08 +0000 (20:46 +0000)] 
There is no need to keep track of the number of changed rows or of the
last-insert-rowid while running VACUUM.

FossilOrigin-Name: a8a7c05b16f6c73ac55c359fbf62cae4a76eb0d105a3c53e9f47cede9fd85916

5 years agoUnroll the comparison loop inside keywordCode() for to avoid unnecessary
drh [Thu, 6 Feb 2020 15:38:43 +0000 (15:38 +0000)] 
Unroll the comparison loop inside keywordCode() for to avoid unnecessary
comparisions and thus help that routine run faster.

FossilOrigin-Name: cec5f920f5c2a963f88329a08a443fc04be2dd6f7f2d840be63c0ab1de898f0a

5 years agoSeparate OP_IdxInsert and OP_SorterInsert into completely separate opcodes,
drh [Thu, 6 Feb 2020 13:57:08 +0000 (13:57 +0000)] 
Separate OP_IdxInsert and OP_SorterInsert into completely separate opcodes,
helping each one to run a little faster.

FossilOrigin-Name: 447d71f0867a11f789eba164ea77470b3ae4953927556304b0861cf690250776

5 years agoRemove dead code from the sqlite3_filename_database() function.
drh [Thu, 6 Feb 2020 13:09:56 +0000 (13:09 +0000)] 
Remove dead code from the sqlite3_filename_database() function.

FossilOrigin-Name: 1b6185550f2bcfa11513898984f1fc2029e0356e9acdc786c5c4a8006b1da2ba

5 years agoFix some fts3 problems found by usan.
dan [Thu, 6 Feb 2020 10:55:10 +0000 (10:55 +0000)] 
Fix some fts3 problems found by usan.

FossilOrigin-Name: fb7ccf61bed8d862986eda7096bec3df5947f1d1c88f27e7d9c8acf420f40c50

5 years agoSmall size reduction and performance improvement in the
drh [Wed, 5 Feb 2020 18:28:17 +0000 (18:28 +0000)] 
Small size reduction and performance improvement in the
sqlite3VdbeMemFromBtree() interface used to pull content out of the b-tree
and into an sqlite3_value object.

FossilOrigin-Name: ae6dd8d3e921670ee6450453b54245dd71bcfff3fd1bc7fdb7cf4cf9585c3375

5 years agoEnable more detailed log messages in SQLITE_ENABLE_CORRUPT_PGNO builds if database...
dan [Tue, 4 Feb 2020 20:01:44 +0000 (20:01 +0000)] 
Enable more detailed log messages in SQLITE_ENABLE_CORRUPT_PGNO builds if database corruption is encountered.

FossilOrigin-Name: 57c36a293e16bb4d9652874124ee1447bef278e08664bc8dd0070a0ee2ef1173

5 years agoExtend the OP_Copy-coalesce optimization fix of check-in [b36126c1889e323c]
drh [Tue, 4 Feb 2020 01:41:44 +0000 (01:41 +0000)] 
Extend the OP_Copy-coalesce optimization fix of check-in [b36126c1889e323c]
so that it is also correctly disabled by the CASE operator.
Ticket [9d3666754ac37d5a].

FossilOrigin-Name: 29a969d6b1709b80d9cb88b60971e4eb021f7f5f8ee9a619be74b833a78a35ef

5 years agoFix a problem with the byte-code decompiler that was inserted by the
drh [Tue, 4 Feb 2020 00:55:27 +0000 (00:55 +0000)] 
Fix a problem with the byte-code decompiler that was inserted by the
enhancements at [4248980a356f659b]

FossilOrigin-Name: af63e95dcdd6e9741cdddc3698e857e3b8be40048d3036f939f3583e517c4eff

5 years agoCosmetic change to the xfer-optimization to put the OP_RowData opcode closer
drh [Mon, 3 Feb 2020 19:56:51 +0000 (19:56 +0000)] 
Cosmetic change to the xfer-optimization to put the OP_RowData opcode closer
to the corresponding OP_Insert opcode.  This makes it slightly easier to read
and understand the code.

FossilOrigin-Name: 0ea2dbfc9088561d62c3456803cb08d357e4e60f1d21f6ed37315564be4957d3

5 years agoIncrease the version number to 3.32.0.
drh [Mon, 3 Feb 2020 12:25:18 +0000 (12:25 +0000)] 
Increase the version number to 3.32.0.

FossilOrigin-Name: 8130bbb4217bd4a4db1f6bf97115a60bee8b29943bed0c7bdf54bba5edbed8fc

5 years agoOn an INSERT or UPDATE, perform affinity conversions on new data prior to
drh [Sat, 1 Feb 2020 21:03:27 +0000 (21:03 +0000)] 
On an INSERT or UPDATE, perform affinity conversions on new data prior to
running CHECK constraints.  Ticket [86ba67afafded936].

FossilOrigin-Name: 1d4f86201dab9a22df9ef8175a7ebf3640e97cdb23a06fb454b4c69bfda3a9af

5 years agoFix the comment display for the OP_Function opcode. And at the same time,
drh [Sat, 1 Feb 2020 17:38:24 +0000 (17:38 +0000)] 
Fix the comment display for the OP_Function opcode.  And at the same time,
improve the comment generating logic to make use of the newer
sqlite3_str_appendf() interface.

FossilOrigin-Name: 4248980a356f659b10b12c778592996d53c91fae4ea50c8566678da176bdd152

5 years agoMerge the sqlite3CodecQueryParameters() fix into trunk.
drh [Sat, 1 Feb 2020 14:20:35 +0000 (14:20 +0000)] 
Merge the sqlite3CodecQueryParameters() fix into trunk.

FossilOrigin-Name: a812f533693a3605f297199ae0320d663e872208675e86860c5c1803943943aa

5 years agoFix a problem in sqlite3CodecQueryParameters() that was introduced by the
drh [Sat, 1 Feb 2020 13:30:39 +0000 (13:30 +0000)] 
Fix a problem in sqlite3CodecQueryParameters() that was introduced by the
query parameter encoding changes for the 3.31.1 release.

FossilOrigin-Name: cc65ca541265bd7061ed8f5ec9a54f3c384c41019c5ea1c68dcaabeff3495839

5 years agoFix a minor typo in a comment in the btreeinfo extension.
drh [Fri, 31 Jan 2020 14:52:19 +0000 (14:52 +0000)] 
Fix a minor typo in a comment in the btreeinfo extension.

FossilOrigin-Name: b5a66d10f4bbaf10def7b50b9ed98b05b41bb2c2af5ab9a90f6cda61169ab123

5 years agoFix a problem with the processing of IN(...) constraints handled by virtual table...
dan [Wed, 29 Jan 2020 15:03:01 +0000 (15:03 +0000)] 
Fix a problem with the processing of IN(...) constraints handled by virtual table implementations that do not set the "omit" flag when the virtual table column contains at least one NULL value.

FossilOrigin-Name: dcb4838757ca49cf149a6e883b3eb0ac8a075147387a078280dfabe39b1a3e8d

5 years agoAdd a test case for commit [ffd8bb93].
dan [Wed, 29 Jan 2020 13:56:35 +0000 (13:56 +0000)] 
Add a test case for commit [ffd8bb93].

FossilOrigin-Name: bcd5b37b8ebd67537f60c0061fcbc70b2aebebb88d6fb842ccf321a3e20c122c

5 years agoRemove a NEVER() that is in fact reachable. Test cases in dbsqlfuzz and TH3.
drh [Wed, 29 Jan 2020 13:50:11 +0000 (13:50 +0000)] 
Remove a NEVER() that is in fact reachable.  Test cases in dbsqlfuzz and TH3.

FossilOrigin-Name: ffd8bb9351fbd8c1285491d4e10734f6816689de6042d640c178a5ecda75a5ef

5 years agoAdd new memory barriers during initialization.
drh [Wed, 29 Jan 2020 13:10:50 +0000 (13:10 +0000)] 
Add new memory barriers during initialization.

FossilOrigin-Name: a9b2adc5d61790abd86839d12e7ecb98a85d7e4cde5f94558530e32449d9e483

5 years agoModify a couple of FTS test cases so that they work on big-endian platforms.
drh [Wed, 29 Jan 2020 12:37:59 +0000 (12:37 +0000)] 
Modify a couple of FTS test cases so that they work on big-endian platforms.

FossilOrigin-Name: b20503aaf5b6595afafee6aa2bc6276354a62b0f583f6d94e31fedfdfc130347

5 years agoFaster decoding of 32-bit variable-length integers in cases were we do not
drh [Tue, 28 Jan 2020 20:27:42 +0000 (20:27 +0000)] 
Faster decoding of 32-bit variable-length integers in cases were we do not
need to know the number of bytes in the encoding.

FossilOrigin-Name: 59a31b16b54a0068c81ee65bc2fa905c2c826e98da3a7ffd8c3ea860a2827b4a

5 years agoSmall performance improvement to the key-comparision routine for strings.
drh [Tue, 28 Jan 2020 20:09:39 +0000 (20:09 +0000)] 
Small performance improvement to the key-comparision routine for strings.

FossilOrigin-Name: 41454499a2b63c5fe6fae2d2085773a5f7d869250dcbe669929d20c961211f70

5 years agoReinstate the optimization of converting "a IN (C)" into "a=C" but only
drh [Tue, 28 Jan 2020 18:09:53 +0000 (18:09 +0000)] 
Reinstate the optimization of converting "a IN (C)" into "a=C" but only
if C is a constant.  If the RHS is a table column, the complications of
managing affinity and collations become too involved to mess with.

FossilOrigin-Name: 8ac26a23d7f0ef29c5eb007c7467181f8b96102c8600ea8a5b15cc7584af27bd

5 years agoFix a 4 byte OOB read in test_multiplex.c.
dan [Tue, 28 Jan 2020 16:55:32 +0000 (16:55 +0000)] 
Fix a 4 byte OOB read in test_multiplex.c.

FossilOrigin-Name: 912148913c11d98e48119a2c1fa7a0e52f318af36e7e2491d968ffde286c949f

5 years agoMinor change for compatibility with the s390 architecture.
drh [Tue, 28 Jan 2020 15:02:23 +0000 (15:02 +0000)] 
Minor change for compatibility with the s390 architecture.

FossilOrigin-Name: 04885763c4cd00cbca26d048f2b19316bfc93e8edebeceaa171ebfc6c563d53e

5 years agoVersion 3.31.1 version-3.31.1
drh [Mon, 27 Jan 2020 19:55:54 +0000 (19:55 +0000)] 
Version 3.31.1

FossilOrigin-Name: 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837bb4d6

5 years agoUpdate the version number to 3.31.1.
drh [Mon, 27 Jan 2020 17:09:02 +0000 (17:09 +0000)] 
Update the version number to 3.31.1.

FossilOrigin-Name: 6fb9a8fb85486a8fccc462856316ef523450c23a7a7a81c8dfb323fbe809f8f5

5 years agoRevise the layout of filenames in the Pager object so that it is unchanged
drh [Mon, 27 Jan 2020 14:40:44 +0000 (14:40 +0000)] 
Revise the layout of filenames in the Pager object so that it is unchanged
from prior versions.  It turns out that some important 3rd-party software
does questionable pointer manipulations on those filenames that depend on
that legacy layout.  Technical this is a misuse of SQLite by the 3rd-party
software, but we want to avoid unnecessary breakage.

FossilOrigin-Name: 34ab760689fd493eda482e856047708d74e769a01cc90b69da456d79ffe39aea

5 years agoFix typos in the sqlite3ext.h header file that prevent some newer APIs from
drh [Thu, 23 Jan 2020 15:00:18 +0000 (15:00 +0000)] 
Fix typos in the sqlite3ext.h header file that prevent some newer APIs from
being accessed from loadable extensions.

FossilOrigin-Name: 14331989fcaf6591336290ed1548e9c90f0f153e27f456f4c30c966f9c23aa6e

5 years agoFix variable declaration issue seen with MSVC.
mistachkin [Thu, 23 Jan 2020 00:08:25 +0000 (00:08 +0000)] 
Fix variable declaration issue seen with MSVC.

FossilOrigin-Name: 8a6fe3066cf0599fcf2960e8fb3ae39e4e7a61ec81e8ec71d0b5910aee2c16f6

5 years agoFix a NEVER() macro that can be true if compiled with
drh [Wed, 22 Jan 2020 23:08:19 +0000 (23:08 +0000)] 
Fix a NEVER() macro that can be true if compiled with
SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION.
Ticket [b985f0bd1636d9bc]

FossilOrigin-Name: 9f0f5d593a383ec2bebb6513ad566813f5b3dc6f052c61bcd76e8ac557bbb062

5 years agoVersion 3.31.0 version-3.31.0
drh [Wed, 22 Jan 2020 18:38:59 +0000 (18:38 +0000)] 
Version 3.31.0

FossilOrigin-Name: f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824

5 years agoUpdate test file exclusive.test so that it works with the "journaltest" permutation.
dan [Tue, 21 Jan 2020 16:31:26 +0000 (16:31 +0000)] 
Update test file exclusive.test so that it works with the "journaltest" permutation.

FossilOrigin-Name: 4daf94d83319231e42243625c804d5db2d14f10fa5ea1a1f358c3603c47b955b

5 years agoFix a problem with using views in SQLITE_OMIT_VIRTUAL_TABLE builds. Also some test...
dan [Tue, 21 Jan 2020 16:23:17 +0000 (16:23 +0000)] 
Fix a problem with using views in SQLITE_OMIT_VIRTUAL_TABLE builds. Also some test case fixes required for the same builds.

FossilOrigin-Name: 934ee8bdb481a5cbd3d9c5f53028073129d3bca4fee14fe4a49bbf9c0c9d74f7

5 years agoFix a case in fts3auto.test that fails for SQLITE_DISABLE_FTS4_DEFERRED builds.
dan [Tue, 21 Jan 2020 15:01:14 +0000 (15:01 +0000)] 
Fix a case in fts3auto.test that fails for SQLITE_DISABLE_FTS4_DEFERRED builds.

FossilOrigin-Name: d241055ead935f0e461a67f483788bcd59f7e8d65ade54b9c7c7c4fec9414102

5 years agoFix an assert() that could fail in SQLITE_MUTATION_TEST builds following an error...
dan [Tue, 21 Jan 2020 14:42:48 +0000 (14:42 +0000)] 
Fix an assert() that could fail in SQLITE_MUTATION_TEST builds following an error in a query that uses CTEs.

FossilOrigin-Name: c7e29458a73bbe73a1429477d0c01d5a7b870ab75d3cb08a703be21714e439b7

5 years agoFix a problem in the userauth extension causing it to occasionally set "PRAGMA count_...
dan [Tue, 21 Jan 2020 13:40:35 +0000 (13:40 +0000)] 
Fix a problem in the userauth extension causing it to occasionally set "PRAGMA count_changes" (and some others) to true.

FossilOrigin-Name: 3a62f64222ebd176c06e89b9fe5275b7b1f09df0afbae1c5c148a4e527e9d80b

5 years agoFix the series.c and spellfix.c extensions to use SQLITE_VTAB_INNOCUOUS
drh [Tue, 21 Jan 2020 12:29:02 +0000 (12:29 +0000)] 
Fix the series.c and spellfix.c extensions to use SQLITE_VTAB_INNOCUOUS
correctly.  Fix the documentation on sqlite3_vtab_config() to take into
account SQLITE_VTAB_INNOCUOUS and SQLITE_VTAB_DIRECTONLY.

FossilOrigin-Name: 9265cb7f026c0e959bd034d4cd94fe597744e0dd455d0a20736ee5f5bee880c8

5 years agoImprovements to the autoconf TEA Makefile for MSVC.
mistachkin [Tue, 21 Jan 2020 01:45:27 +0000 (01:45 +0000)] 
Improvements to the autoconf TEA Makefile for MSVC.

FossilOrigin-Name: cffcf12f03906debeac6a974534b4439a4952cc72767e3bcb8e6d91da944d69f

5 years agoIn the fuzzcheck test program, reduce the default expression depth limit
drh [Mon, 20 Jan 2020 14:42:09 +0000 (14:42 +0000)] 
In the fuzzcheck test program, reduce the default expression depth limit
from 1000 to 500 to avoid stack-overflow problems when running stress tests
using clang ASAN.

FossilOrigin-Name: 63d886f4ce3c770498b8bdad45b04143a3f63197d81793bde107450aba4a9c87

5 years agoEnhancement to the CLI to allow the ".parameter init" command to work
drh [Sun, 19 Jan 2020 20:37:26 +0000 (20:37 +0000)] 
Enhancement to the CLI to allow the ".parameter init" command to work
even if defensive mode is turned on.

FossilOrigin-Name: 4d46255096671ae7be33081e81bb25561304e069f459ffa7587f1f19381a1851

5 years agoDocumentation improvements.
drh [Sat, 18 Jan 2020 23:52:45 +0000 (23:52 +0000)] 
Documentation improvements.

FossilOrigin-Name: 535afe150939d06342fbbed4ca1b6a1472fde51ac9edd4b4b583b87d90f509c2

5 years agoIn the TCL interface, add the ability to change the
drh [Sat, 18 Jan 2020 22:20:14 +0000 (22:20 +0000)] 
In the TCL interface, add the ability to change the
SQLITE_DBCONFIG_TRUSTED_SCHEMA setting using the "db config" method.

FossilOrigin-Name: 1accfa8cf05856b03cecab7a2cd0c0337842a0003cfbec207b6f0acdd93e8f15

5 years agoAllow non-deterministic function in CHECK constraints. It turns out that
drh [Sat, 18 Jan 2020 21:34:31 +0000 (21:34 +0000)] 
Allow non-deterministic function in CHECK constraints.  It turns out that
PostgreSQL, MySQL, and SQLServer all allow this.  We should be the the
exception.  Ticket [830277d9db6c3ba1]

FossilOrigin-Name: 8c8ce526adb60b8061e55151599ca8b11f1ec2e968d3bacc73a2a249e9e95ee1

5 years agoDo not use memcpy() of zero bytes when initializing a pager. This avoids
drh [Sat, 18 Jan 2020 19:46:42 +0000 (19:46 +0000)] 
Do not use memcpy() of zero bytes when initializing a pager.  This avoids
a warning.

FossilOrigin-Name: cca437788e092b21ed1784dd94d4b1c7204ff1717538d276a10880d1345904bd

5 years agoDisable a redundant test case that uses a very large stack, and hence
drh [Sat, 18 Jan 2020 19:07:00 +0000 (19:07 +0000)] 
Disable a redundant test case that uses a very large stack, and hence
is unable to run with -fsanitize=undefined,address.

FossilOrigin-Name: 3c63f68e12af36e9fd9a3dd4daec9402e75e80bcd819d39c0215a427fd0d7803

5 years agoFix harmless compiler warning seen with MSVC.
mistachkin [Sat, 18 Jan 2020 19:02:20 +0000 (19:02 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: cd0437ba5b13593ebe4ec30d6236623183f8cfa30ca8a0612662eccb282a863e

5 years agoAdd extra front margin to the fake empty filename returned by
drh [Sat, 18 Jan 2020 14:50:06 +0000 (14:50 +0000)] 
Add extra front margin to the fake empty filename returned by
sqlite3PagerFilename() for an in-memory or TEMP database.

FossilOrigin-Name: fee945671a19a93287f9bfadc346f9821fb1311c7fc75b95a6a48d1419c840e7

5 years agoFix the VDBE so that it correctly handles the sequence of operations
drh [Sat, 18 Jan 2020 13:53:46 +0000 (13:53 +0000)] 
Fix the VDBE so that it correctly handles the sequence of operations
OP_OpenEphemeral, OP_OpenDup, OP_OpenEphemeral, and OP_OpenDup in that
order on the same cursor.

FossilOrigin-Name: a1be6ee0188911448c064e2c25fb0ca1daad50f3d50fb49a34430bd09736b4a9

5 years agoFix a typo in a comment. No code changes.
drh [Fri, 17 Jan 2020 23:27:41 +0000 (23:27 +0000)] 
Fix a typo in a comment.  No code changes.

FossilOrigin-Name: 4363f69c3ad5a9859471547cab713f1acabd5fce13872cc1ddaa972d6c1dfb35

5 years agoThe compress() function should not be deterministic since the same input can
drh [Fri, 17 Jan 2020 21:12:22 +0000 (21:12 +0000)] 
The compress() function should not be deterministic since the same input can
have multiple possible compressed outputs.  The uncompress() function, on the
other hand, is deterministic.

FossilOrigin-Name: 84f314902c48336849081c7e9fe2a52caf171b8215a1c6e80cded0700c447eb1

5 years agoFix #ifdefs so it compiles cleanly with all SQLITE_OMIT compile-time options.
drh [Fri, 17 Jan 2020 19:14:08 +0000 (19:14 +0000)] 
Fix #ifdefs so it compiles cleanly with all SQLITE_OMIT compile-time options.
Update compile-time option testing.

FossilOrigin-Name: 7584e4b649d57767aac3906da6b06549d5b772aaa69f469c623ae5da834d54d5

5 years agoImproved rounding in the 'unixepoch' feature of the date and time functions.
drh [Fri, 17 Jan 2020 16:47:07 +0000 (16:47 +0000)] 
Improved rounding in the 'unixepoch' feature of the date and time functions.

FossilOrigin-Name: c9abf1bd2d2496ced9ef4619cd997933cd58452e6ab527ba70746c9975104b6a

5 years agoUpdate test script instrfault.test to account for the fact that bound blob values...
dan [Fri, 17 Jan 2020 15:45:59 +0000 (15:45 +0000)] 
Update test script instrfault.test to account for the fact that bound blob values cast to text values are now intepreted using the text encoding of the database, instead of always as utf-8.

FossilOrigin-Name: 4d6cb28811c01599e34c0394fe5ed17d47f14893c860590c9b4660bef68eb294

5 years agoFix a case in "fuzz.test" that could fail, as non-deterministic functions may no...
dan [Fri, 17 Jan 2020 11:18:54 +0000 (11:18 +0000)] 
Fix a case in "fuzz.test" that could fail, as non-deterministic functions may no longer appear in CHECK constraints.

FossilOrigin-Name: a370871e21bd1028ac968ca4f48e6b5f75e647ac40d4342aeb0504a848452908

5 years agoNew testcase() macros in select.c, for coverage of the change from two
drh [Thu, 16 Jan 2020 17:53:24 +0000 (17:53 +0000)] 
New testcase() macros in select.c, for coverage of the change from two
check-ins ago.

FossilOrigin-Name: 52206488f315803df73f964774270ef4783923407a2567936f56b0a1a88b4400

5 years agoAdd the SQLITE_FCNTL_CKPT_DONE file-control for the use of custom VFSs.
dan [Thu, 16 Jan 2020 16:32:57 +0000 (16:32 +0000)] 
Add the SQLITE_FCNTL_CKPT_DONE file-control for the use of custom VFSs.

FossilOrigin-Name: 3cc39e5069c8a6a32ecc49c571593615c0f347cadcd3e0325b7f9a11ddc1f546

5 years agoDo not allow the constant-propagation optimization to apple to ON/USING clause
drh [Thu, 16 Jan 2020 16:12:07 +0000 (16:12 +0000)] 
Do not allow the constant-propagation optimization to apple to ON/USING clause
terms as it does not help and it might cause downstream problems.

FossilOrigin-Name: 1bc783da63d58b05c690468b569cb2787846357b63c1100d11777666c5787bf4

5 years agoFix an SQL syntax error in the comment on the omit-left-join optimization.
drh [Thu, 16 Jan 2020 12:25:14 +0000 (12:25 +0000)] 
Fix an SQL syntax error in the comment on the omit-left-join optimization.
No changes to code.

FossilOrigin-Name: 86b5e5a20e967af7ac444ff0a40c2e8b93b7e5c505eebf6d3753a341b05503a8

5 years agoClean up the definitions of the TERM_ constants in the code generator.
drh [Thu, 16 Jan 2020 11:51:09 +0000 (11:51 +0000)] 
Clean up the definitions of the TERM_ constants in the code generator.
Formatting only - no logic changes.

FossilOrigin-Name: af06f80a590e20f64fa2f630e85fa728c266ea4696b975cc5f2ab72a3b914379

5 years agoDo not allow the "PRAGMA encoding" statement to change the database
drh [Wed, 15 Jan 2020 16:20:16 +0000 (16:20 +0000)] 
Do not allow the "PRAGMA encoding" statement to change the database
encoding if TEMP content exists, or content in any other attached
database.  Formerly, encoding changes were allowed if just the main
database file was empty.  Ticket [a08879a4a476eea9].

FossilOrigin-Name: 03b003c988d27f3aa1b1e44972ee5a3c7e44ad667ec7f2b8a31d0411c66583d3

5 years agoFix the urifuncs.c extension (used for testing and debugging only) so that
drh [Tue, 14 Jan 2020 16:50:09 +0000 (16:50 +0000)] 
Fix the urifuncs.c extension (used for testing and debugging only) so that
the sqlite3_filename_database() SQL function and its siblings correctly handle
an invalid schema name passed in as the argument.

FossilOrigin-Name: 3d7434a9d85dae9135473d1c58c22ac01a282e654807aa10be9b39f127291594

5 years agoRemove an ALWAYS on a branch for improved database corruption detection
drh [Tue, 14 Jan 2020 16:39:54 +0000 (16:39 +0000)] 
Remove an ALWAYS on a branch for improved database corruption detection
in btree.c:freeSpace().  Test case found by dbsqlfuzz.

FossilOrigin-Name: 54bf04811951db6c894f272f870e3e41f8f5e05a25c1115efbbdbd0d8bba54be

5 years agoAdd the new noop_nd() debugging function to the noop.c extension.
drh [Tue, 14 Jan 2020 16:33:07 +0000 (16:33 +0000)] 
Add the new noop_nd() debugging function to the noop.c extension.

FossilOrigin-Name: 72911fb1b010ae093a161b9c0d21cbdedcbc1f924a55f12227fbe342bd978e08

5 years agoFor the showdb utility program, more accurate detection of when the database
drh [Tue, 14 Jan 2020 13:24:14 +0000 (13:24 +0000)] 
For the showdb utility program, more accurate detection of when the database
is in autovacuum mode for the "pgidx" subcommand.

FossilOrigin-Name: 9ce2192b81a81bb8928e3184664694ed2f863ce41c2777cdc35e6b61486aea46

5 years agoFix a minor typo on a comment in the CLI implementation.
drh [Tue, 14 Jan 2020 13:13:19 +0000 (13:13 +0000)] 
Fix a minor typo on a comment in the CLI implementation.

FossilOrigin-Name: db4fb3503c4e1e40d7bd140187014e8f0cc186c441a0c7462987c77e2c83136a

5 years agoImprovements to sqlite3_open_v2() documentation.
drh [Tue, 14 Jan 2020 00:52:56 +0000 (00:52 +0000)] 
Improvements to sqlite3_open_v2() documentation.

FossilOrigin-Name: 4c4fd62a092b8db6398c64a92c9ff35915eedcce1079a77aeda81811d94096c4

5 years agoMore documentation updates. No code changes.
drh [Mon, 13 Jan 2020 15:25:43 +0000 (15:25 +0000)] 
More documentation updates.  No code changes.

FossilOrigin-Name: a684d4ef08a48962c632b598242f5e34c9b2fa3ad6339023fbce8ac91582b5e3

5 years agoDocumentation updates. No changes to code.
drh [Mon, 13 Jan 2020 13:33:08 +0000 (13:33 +0000)] 
Documentation updates.  No changes to code.

FossilOrigin-Name: cc0e0aa3a7d534b806cdf63200b32ab3b7f0e08dde717f043a36d2f91c8a046c

5 years agoBetter than removing the incorrect assert() is to change it into a
drh [Sun, 12 Jan 2020 22:38:17 +0000 (22:38 +0000)] 
Better than removing the incorrect assert() is to change it into a
testcase() together with a comment indicating where an appropriate test case
can be found, and the ticket that provoked the change.
Ticket [614b25314c766238]

FossilOrigin-Name: 3e3c60d8124672ff72a57dfa2e51276316bcac8c8ae8a5739da358f26924b0fb

5 years agoChange the zipfile virtual table so that the xBestIndex method gives a
drh [Sun, 12 Jan 2020 22:25:58 +0000 (22:25 +0000)] 
Change the zipfile virtual table so that the xBestIndex method gives a
reasonable cost estimate even if no filename is specified.  The missing
filename error continues to be raised in the xFilter method.  Meanwhile,
the more reasonable cost estimate avoids unnecessary wierdness in the query
planner.

FossilOrigin-Name: 0e468aa6decc73be307596782a778a739ff1b5dc0eb10fc4bd6776e460f99f8b

5 years agoRemove an incorrect assert(). Fix for ticket [614b25314c766238]
drh [Sun, 12 Jan 2020 22:20:07 +0000 (22:20 +0000)] 
Remove an incorrect assert().  Fix for ticket [614b25314c766238]

FossilOrigin-Name: 6a999c5aa0d1d5569a5bda50d27e3a15c13e93e69d00db97c5294901522064a3