]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
3 years agoSome #defines somehow failed to get set correctly in the previous check-in. fix-warnings
drh [Mon, 4 Oct 2021 18:57:42 +0000 (18:57 +0000)] 
Some #defines somehow failed to get set correctly in the previous check-in.
Fixed here.

FossilOrigin-Name: 15bbdf9ac840a220f384411d3025ef22f949d310194b60bca8e6d6a759e6042e

3 years agoFix harmless static analyzer warnings in sessions, rtree, fts3 and fts5.
drh [Mon, 4 Oct 2021 18:21:14 +0000 (18:21 +0000)] 
Fix harmless static analyzer warnings in sessions, rtree, fts3 and fts5.
Add the -DSQLITE_OMIT_AUXILIARY_SAFETY_CHECKS compile-time option to cause
ALWAYS() and NEVER() macros to be omitted from the build.

FossilOrigin-Name: 1c67f957fc77e37ce8f0d447c41ca975e8e79a35d332739c24a633649b5b0387

3 years agoFix harmless static analyzer warnings in auxiliary build tools, mkkeywordhash.c
drh [Mon, 4 Oct 2021 16:14:51 +0000 (16:14 +0000)] 
Fix harmless static analyzer warnings in auxiliary build tools, mkkeywordhash.c
and lemon.c.  No changes to the SQLite core.

FossilOrigin-Name: f2f279b2cc1c8b3b162058c33956be4037cd519715ac0c4290f10c58d2528f0a

3 years agoFix harmless static analyzer warnings.
drh [Mon, 4 Oct 2021 15:08:49 +0000 (15:08 +0000)] 
Fix harmless static analyzer warnings.

FossilOrigin-Name: 1ebcde72e2046dffaa408d2a5a4a5bbf35fdf4b096e0e088dcffd9360effdaa7

3 years agoThe pragma_table_list virtual table should have only one "schema" column.
drh [Mon, 4 Oct 2021 13:30:22 +0000 (13:30 +0000)] 
The pragma_table_list virtual table should have only one "schema" column.

FossilOrigin-Name: 886feffaad6baac37dfaab489c2aecc4abf51a3a5bce1e8a94be7cc1d2a3c30c

3 years agoFix harmless static analyzer warnings.
drh [Mon, 4 Oct 2021 13:18:44 +0000 (13:18 +0000)] 
Fix harmless static analyzer warnings.

FossilOrigin-Name: 6604a085964121113e7b7f57537a0ba64ba058d0eb12bf0a3aeb6d1b7a29d516

3 years agoFix query plans created by whereShortCut() so that they always check
drh [Mon, 4 Oct 2021 11:10:15 +0000 (11:10 +0000)] 
Fix query plans created by whereShortCut() so that they always check
transitive constraints that drive an index.  The is analogous to the
[f1f9b5de3c59489b] check-in, just for whereShortCut() rather than the
full query planner. Fix for the issue described by
[forum:/forumpost/a65cacbf5e1c41ba|forum post a65cacbf5e1c41ba].

FossilOrigin-Name: 8b24c177061c38361588f419eda9b7943b72a0c6b2855b6f39272451b8a1b813

3 years agoIn CLI, ensure correct line-accumulation state whenever line(s) are dumped or process...
larrybr [Sun, 3 Oct 2021 22:03:59 +0000 (22:03 +0000)] 
In CLI, ensure correct line-accumulation state whenever line(s) are dumped or processed. And test this.

FossilOrigin-Name: be211a9c59234ef202e772fcaae18be43c44e1e00674f137cad2d903e00bfcab

3 years agoAdd the sqlite3ResultStrAccum() internal interface to simplify the
drh [Sun, 3 Oct 2021 00:12:43 +0000 (00:12 +0000)] 
Add the sqlite3ResultStrAccum() internal interface to simplify the
the implementation of functions that return strings.

FossilOrigin-Name: e548e9299d3fd6ce5b647cf0dd93ff8e917a5eda43076c6a02389c52640e2e50

3 years agoTry to fix a harmless static-analyzer warning in sqlite3BtreeTransferRow().
drh [Sat, 2 Oct 2021 18:22:24 +0000 (18:22 +0000)] 
Try to fix a harmless static-analyzer warning in sqlite3BtreeTransferRow().

FossilOrigin-Name: 5906a0152deded614d965e790a33c67832890828a4835451d65c06414ba71f8b

3 years agoFix a harmless static-analyzer warning in sqlite3ExprCode().
drh [Sat, 2 Oct 2021 17:46:24 +0000 (17:46 +0000)] 
Fix a harmless static-analyzer warning in sqlite3ExprCode().

FossilOrigin-Name: 918c22e82ae6e366ddd094d337ed73fd23878c51745045519ed700113832545c

3 years agoRemove an unnecessary static buffer from sqlite3VdbeExpandSql().
drh [Sat, 2 Oct 2021 17:34:28 +0000 (17:34 +0000)] 
Remove an unnecessary static buffer from sqlite3VdbeExpandSql().

FossilOrigin-Name: 953a33b7f739bb39f4a0efedcad2236c09fb798da4a519f8e1049aebe3bbf3ff

3 years agoMake the sqlite3_filename_xxxx() interfaces robust against NULL pointer
drh [Sat, 2 Oct 2021 17:12:58 +0000 (17:12 +0000)] 
Make the sqlite3_filename_xxxx() interfaces robust against NULL pointer
arguments, even though the documentation says the behavior is undefined
in that case.

FossilOrigin-Name: dd64c60bab4e2b44419db6882dfcc80b73d733ebe3bea64a7588c33fbc428234

3 years agoFix harmless compiler warnings
drh [Sat, 2 Oct 2021 16:39:16 +0000 (16:39 +0000)] 
Fix harmless compiler warnings

FossilOrigin-Name: bdb9dc8a025b509960d08cdf0ff784dd075c156860548d7908de7d97e030701c

3 years agoFix CLI line processing. (back to start state after meta-command executes)
larrybr [Sat, 2 Oct 2021 15:34:52 +0000 (15:34 +0000)] 
Fix CLI line processing. (back to start state after meta-command executes)

FossilOrigin-Name: 928c2a34986644d34bcb5e8a1b2720f31cf703383f4ce75381faefca6f356d04

3 years agoFix a problem with group_concat() when it is used as a window function with
drh [Fri, 1 Oct 2021 22:48:52 +0000 (22:48 +0000)] 
Fix a problem with group_concat() when it is used as a window function with
a sliding window, as described by
[forum:/forumpost/f3eb24a6c0|forum thread f3eb24a6c0].

FossilOrigin-Name: f47f7f78227830c065d9ce715b8456eab81a38d680f76bf4ff08f298d84f9c7a

3 years agoFix harmless compiler warnings.
drh [Fri, 1 Oct 2021 21:01:07 +0000 (21:01 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: 94b59691ee50a4666b25e36d1529fc52f714bbe94c3e8ccb35bf0a4ea11050db

3 years agoChange things so that SQLITE_OMIT_VIRTUALTABLE implies SQLITE_OMIT_ALTER_TABLE.
dan [Fri, 1 Oct 2021 20:39:50 +0000 (20:39 +0000)] 
Change things so that SQLITE_OMIT_VIRTUALTABLE implies SQLITE_OMIT_ALTER_TABLE.

FossilOrigin-Name: 2f7c946c5f25a858167f5193ca06e53310394c8cff15426ab8a1327a1ec835fd

3 years agoFix a potential write outside of array bounds in the --hexdb decoder of the
drh [Fri, 1 Oct 2021 17:06:44 +0000 (17:06 +0000)] 
Fix a potential write outside of array bounds in the --hexdb decoder of the
CLI when given corrupt input.

FossilOrigin-Name: c7fdd775bb5efd22a486510a32a2f278c4d5cda95acd3085a0f0dfc2ef749d6f

3 years agoFix a buffer overread in fts5 that could occur when processing an "ORDER BY rowid...
dan [Fri, 1 Oct 2021 15:05:19 +0000 (15:05 +0000)] 
Fix a buffer overread in fts5 that could occur when processing an "ORDER BY rowid DESC" query against corrupt database records.

FossilOrigin-Name: fe098a93340b8dac15752f1be4f681e2a591f7ae1a94b177f400ccd7ef638480

3 years agoRemove unreachable branches in the fixed group_concat() code. group_concat-fix-legacy
drh [Fri, 1 Oct 2021 02:45:48 +0000 (02:45 +0000)] 
Remove unreachable branches in the fixed group_concat() code.

FossilOrigin-Name: 8bd721c29e7a28cd75885dd80235e4e37aa0847229f769f49e01127f794fa63a

3 years agoMerge updates from trunk
drh [Fri, 1 Oct 2021 02:16:52 +0000 (02:16 +0000)] 
Merge updates from trunk

FossilOrigin-Name: 35351371c5e9602dec210ad0926ff8a1a269556ce1a166e81eb0543938e0c57e

3 years agoFixes to the version of "varsep" group_concat so that (1) it builds under
drh [Fri, 1 Oct 2021 00:25:06 +0000 (00:25 +0000)] 
Fixes to the version of "varsep" group_concat so that (1) it builds under
separate compilation and (2) omits tabs in source code and (3) runs faster
than trunk.  This variant of the group_concat_varsep branch might be preferred
over the tip because it preserves (undocumented) legacy behavior about the
position of separators relative to terms.

FossilOrigin-Name: 04399cf9645e04b171090ff8a3c27752929c10d2cd8778e26f8f3337aa902ab6

3 years agoFix a problem with view handling in SQLITE_OMIT_VIRTUAL_TABLE builds.
dan [Thu, 30 Sep 2021 18:42:52 +0000 (18:42 +0000)] 
Fix a problem with view handling in SQLITE_OMIT_VIRTUAL_TABLE builds.

FossilOrigin-Name: 6e791a24ce259ff6cc46a7c2188aea094a5021e154368f57019a0653c8a81217

3 years agoFix rtreedoc.test so that it works with SQLITE_DEFAULT_AUTOVACUUM=1 builds.
dan [Thu, 30 Sep 2021 17:39:21 +0000 (17:39 +0000)] 
Fix rtreedoc.test so that it works with SQLITE_DEFAULT_AUTOVACUUM=1 builds.

FossilOrigin-Name: a300adc21151fb70ab8573477fd89a10300ee678f068fe123f22ada2f1f876d2

3 years agoUpdate a test case in rtreedoc.test to account for the fact that release builds gener...
dan [Thu, 30 Sep 2021 10:47:10 +0000 (10:47 +0000)] 
Update a test case in rtreedoc.test to account for the fact that release builds generate fewer VM instructions than debug builds.

FossilOrigin-Name: 7d16b302826fec3606dbc6e20df0d2182f6946a2ed4076d2412d1df30c552ecb

3 years agoAdd NEVER() macros on branches that are not reachable since [a0df216f7c3f8963].
drh [Wed, 29 Sep 2021 20:17:19 +0000 (20:17 +0000)] 
Add NEVER() macros on branches that are not reachable since [a0df216f7c3f8963].

FossilOrigin-Name: 5d771f3554f3c98872cd0c9f12f415e685f26fcb923e3fb7f1a7a760c7a53255

3 years agoFix a typo in altertab3.test.
dan [Wed, 29 Sep 2021 19:18:53 +0000 (19:18 +0000)] 
Fix a typo in altertab3.test.

FossilOrigin-Name: 18d38b13104a9c3367ec205bfa17fbdc3d792ba68a369b1c6f046096ef6cc581

3 years agoHave the dbstat module arrange things internally so that there are 256 addressable...
dan [Wed, 29 Sep 2021 19:15:25 +0000 (19:15 +0000)] 
Have the dbstat module arrange things internally so that there are 256 addressable bytes following each page buffer. This way, small buffer overreads caused by corrupt database pages do not lead to undefined behaviour.

FossilOrigin-Name: c4c705abc60624bf9ba4c1c05286b902b965f7ba9fd776c4ef8bc1fb78a4ccde

3 years agoFix another problem with ALTER TABLE and vector UPDATE statements within triggers.
dan [Wed, 29 Sep 2021 18:33:26 +0000 (18:33 +0000)] 
Fix another problem with ALTER TABLE and vector UPDATE statements within triggers.

FossilOrigin-Name: a0df216f7c3f8963efba0b1ffee65d6a63309d846ffdcf2d2932cb4f1d4967b7

3 years agoAdd new test file rtreedoc3.test.
dan [Wed, 29 Sep 2021 16:38:02 +0000 (16:38 +0000)] 
Add new test file rtreedoc3.test.

FossilOrigin-Name: 54604869861cc5866d5de87785599ca56f75067f8cb7fe22e32912b3a037e37b

3 years agoSync w/trunk
larrybr [Wed, 29 Sep 2021 16:35:14 +0000 (16:35 +0000)] 
Sync w/trunk

FossilOrigin-Name: a4c18b2f0ce4a0f4d0c4f4c25dc69fbed4cb4876d2b69e3e5e0e756410892d74

3 years agoAdd extra tests for the group_concat() fix on this branch.
dan [Wed, 29 Sep 2021 14:14:16 +0000 (14:14 +0000)] 
Add extra tests for the group_concat() fix on this branch.

FossilOrigin-Name: 3d148615f9d9c6a3d63d8eb015f3d70f453a66de49b28e665831254387c700b9

3 years agoImproved testability of changes from check-in [255b0eeed113d83b].
drh [Wed, 29 Sep 2021 14:01:44 +0000 (14:01 +0000)] 
Improved testability of changes from check-in [255b0eeed113d83b].

FossilOrigin-Name: bbfd083c26086fb103fec88faa59a01e689e0b7fce38c09d8846bb472a0e6760

3 years agoFix an out-of-bounds read in fts5 that could occur when processing corrupt records.
dan [Wed, 29 Sep 2021 13:36:58 +0000 (13:36 +0000)] 
Fix an out-of-bounds read in fts5 that could occur when processing corrupt records.

FossilOrigin-Name: 9bbc01fb239b4aa752a56c584baa29655a3c845425d5c17d24a3939984d54fe2

3 years agoGet group_concat() to handle varying separator lengths when windowing
larrybr [Wed, 29 Sep 2021 00:32:13 +0000 (00:32 +0000)] 
Get group_concat() to handle varying separator lengths when windowing

FossilOrigin-Name: 98e0f2bf67cdee1da1edadeb54ff8564728b3f28fc821e46e8de201247c3fc87

3 years agoFix a potential ALTER TABLE problem with expressions like ( (<sub-select>) IN () ).
dan [Tue, 28 Sep 2021 10:44:54 +0000 (10:44 +0000)] 
Fix a potential ALTER TABLE problem with expressions like ( (<sub-select>) IN () ).

FossilOrigin-Name: df0d7e36dbf98ab5405d8366ce92fb85176d4388b47a57b0ca1aa1ba6ae5212e

3 years agoHave the dbstat virtual table take a copy of each page buffer that it traverses inste...
dan [Mon, 27 Sep 2021 17:11:20 +0000 (17:11 +0000)] 
Have the dbstat virtual table take a copy of each page buffer that it traverses instead of just a reference to the page-cache object. This avoids problems if an error causes transaction rollback while a dbstat cursor is open. dbsqlfuzz crash-417224040fee04f0f0e62b70265c518893b08769.

FossilOrigin-Name: 6ab25f8bd52d6412a9600143de364f6d8ad8e2c835315fafca6f54d5f38a49dc

3 years agoFix a problem in ALTER TABLE causing table or column references in sub-selects ton...
dan [Mon, 27 Sep 2021 15:44:03 +0000 (15:44 +0000)] 
Fix a problem in ALTER TABLE causing table or column references in sub-selects ton the RHS of a vector SET clause in an UPDATE within a trigger (i.e. "SET (a,b) = ( (SELECT...), <expr> )").

FossilOrigin-Name: 255b0eeed113d83b474efc5bc8fc790a270bc43ee598df4b2c378e1ad2d729b7

3 years agoLoad recent dbsqlfuzz cases into test/fuzzdata8.db.
drh [Sat, 25 Sep 2021 20:28:39 +0000 (20:28 +0000)] 
Load recent dbsqlfuzz cases into test/fuzzdata8.db.

FossilOrigin-Name: 7a8fcf6d2c8e3c8f10ff515c8c00c761d15a28eef8e0e31e09e22feb06c9443b

3 years agoFix a memory leak in rtree triggered by corrupt database records. dbsqlfuzz 397ad036a...
dan [Sat, 25 Sep 2021 20:19:16 +0000 (20:19 +0000)] 
Fix a memory leak in rtree triggered by corrupt database records. dbsqlfuzz 397ad036a9013d7318da30ef84947d2baaaa6d6c.

FossilOrigin-Name: 706322c2b5bb31e14c1120a94520b21fa623ff119e3890170e36b37d8bde721a

3 years agoFix a bad interaction between the pager cache and the dbstat module that could lead...
dan [Sat, 25 Sep 2021 18:21:01 +0000 (18:21 +0000)] 
Fix a bad interaction between the pager cache and the dbstat module that could lead to a malfunction following an OOM. dbsqlfuzz 9ed3e4e3816219d3509d711636c38542bf3f40b1.

FossilOrigin-Name: e03554a6a8c33d820922edccf605a2ce92055315bf22e464207ea8c0d81e3dd6

3 years agoAdd const to parameters on various internal interfaces.
drh [Sat, 25 Sep 2021 17:07:57 +0000 (17:07 +0000)] 
Add const to parameters on various internal interfaces.

FossilOrigin-Name: 70c221c5cf7b4d9ed34f16d045f262f99d16aa3db84f80cf0b03ee82ba28d075

3 years agoDbsqlfuzz (a097eaad43c3c845b236126df92fb49b25449b0c) found a way to reach the
drh [Fri, 24 Sep 2021 19:57:32 +0000 (19:57 +0000)] 
Dbsqlfuzz (a097eaad43c3c845b236126df92fb49b25449b0c) found a way to reach the
assert() that was added to sqlite3_declare_vtab() by [eb94f4a8174436b1].
This check-in fixes the problem.

FossilOrigin-Name: 857d26a68cf439e9cba4f8a3b326c69366fc486a876b76835538709ee39b8713

3 years agoAdd lots of new "const" on internal function parameters. There is opportunity
drh [Fri, 24 Sep 2021 16:14:47 +0000 (16:14 +0000)] 
Add lots of new "const" on internal function parameters.  There is opportunity
for many more - this is a work in progress.

FossilOrigin-Name: a3c71a673ddd1c299bdae550fb955077b77088329a8ca2895dfb23538b524a8e

3 years agoEnsure that sqlite_stat1 and sqlite_stat4 are ordinary tables (not views or
drh [Fri, 24 Sep 2021 12:59:33 +0000 (12:59 +0000)] 
Ensure that sqlite_stat1 and sqlite_stat4 are ordinary tables (not views or
virtual tables) before trying to load them
(dbsqlfuzz bc02a0cde82dee801a8d6f653d2831680f87dca1).  This prevents
sqlite3_declare_vtab() from running with db->init.busy turned on.  Even so,
enhance sqlite3_declare_vtab() to be able to deal with db->init.busy being on,
in case there are undiscovered paths to that state.
Each of these two changes are independently sufficient to prevent the problem
fixed by the previous check-in [c7560c1329965ab5] but there
is no harm in keeping that third layer of protection in place.

FossilOrigin-Name: eb94f4a8174436b1f0deed0a43618a20018387bb815be658314ca6b454c446fb

3 years agoEnsure that the db->init.azInit array is initialized at all times.
drh [Fri, 24 Sep 2021 02:14:35 +0000 (02:14 +0000)] 
Ensure that the db->init.azInit array is initialized at all times.
dbsqlfuzz 0ad6d441f9bf3dfc32626a9900bc1700495b16f9

FossilOrigin-Name: c7560c1329965ab57cd71393c044b110561b83641d08677bc51044df9e377882

3 years agoFix harmless compiler warnings.
drh [Wed, 22 Sep 2021 14:43:35 +0000 (14:43 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: d678ecca02698753d1b33e072566112e94ea36d0d3a8f4a24d2b09d131968d88

3 years agoFor shell.c.in, define CHAR_BITS to 8 on platforms that do not have that
drh [Wed, 22 Sep 2021 14:26:22 +0000 (14:26 +0000)] 
For shell.c.in, define CHAR_BITS to 8 on platforms that do not have that
value set by default.  This fixes the build on older machines.

FossilOrigin-Name: 96610cc8251ad4ff8d7f0536f20f4572a996bfa8d24bec8a7925a333e507da1e

3 years agoFix harmless compiler warnings in shell.c.in, and a compiler warning in
drh [Wed, 22 Sep 2021 13:43:16 +0000 (13:43 +0000)] 
Fix harmless compiler warnings in shell.c.in, and a compiler warning in
sqlite3expert.c which is a real error, though also harmless.

FossilOrigin-Name: 56da0e9c0321d1fd3c360722cd6284296f9ba459f6b37ab35c81ecabd18f12e3

3 years agoFix an incorrect assert() in rtree that was added recently
drh [Wed, 22 Sep 2021 13:07:10 +0000 (13:07 +0000)] 
Fix an incorrect assert() in rtree that was added recently
by [f7ad73c49507c943].  Change it to testcase().

FossilOrigin-Name: 3aa0bf3a098ee9a62c79f266f94e4d290056d0f3e91237944893d6bbb686861f

3 years agoEnhance the TCL-based test harness so that it is possible to list multiple
drh [Wed, 22 Sep 2021 10:57:30 +0000 (10:57 +0000)] 
Enhance the TCL-based test harness so that it is possible to list multiple
test modules on the "testfixture" command-line and have them all run.
For example: "<tt>./testfixture test/shell*.test</tt>"

FossilOrigin-Name: 45caf9b85fc75abe80e3d2704fc634e4b103647c912c3fbffb1847d8cb581b62

3 years agoUse sqlite3_snprintf() for the ".changes" output formatting in the shell
drh [Wed, 22 Sep 2021 10:28:50 +0000 (10:28 +0000)] 
Use sqlite3_snprintf() for the ".changes" output formatting in the shell
because it now uses %lld, and some older C compilers do not understand that
construct.

FossilOrigin-Name: 53dadf80672a4fe05341fe40873b6cfa73f6bc1e07cc41fcf10fe290c9156363

3 years agoFix .expert name collision bug reported at https://sqlite.org/forum/forumpost/05e6f32...
larrybr [Tue, 21 Sep 2021 20:03:05 +0000 (20:03 +0000)] 
Fix .expert name collision bug reported at https://sqlite.org/forum/forumpost/05e6f32984561f57?t=h

FossilOrigin-Name: 4a3f98ad0dd2a8c0370042611a041bed2bd8d9ca82d6706e2db349eb97aaf1f0

3 years agoSpeed and (slightly) simplify shell's input line early processing.
larrybr [Tue, 21 Sep 2021 19:19:28 +0000 (19:19 +0000)] 
Speed and (slightly) simplify shell's input line early processing.

FossilOrigin-Name: a1c7f7f8e1b46440234be96e813e4c2c28150413dd95dcab5d13b9c80a202edf

3 years agoAdd the "PRAGMA table_list" command with its corresponding eponymous
drh [Tue, 21 Sep 2021 17:26:23 +0000 (17:26 +0000)] 
Add the "PRAGMA table_list" command with its corresponding eponymous
table-valued function: "pragma_table_list".

FossilOrigin-Name: 2c0e7ae541e9ecb86aa58fa7e7057def8aac1b1af1af1aa80b8bf2d260f9a2f9

3 years agoAccomplish fileio standalone for Win32 with less intervention.
larrybr [Mon, 20 Sep 2021 21:42:39 +0000 (21:42 +0000)] 
Accomplish fileio standalone for Win32 with less intervention.

FossilOrigin-Name: af5dcc9c2a3a45d10b985f6b7ea18d39c75502ed10fa6496aad787dbe8c8c3fb

3 years agoAllow fileio extension to be a stand-alone DLL for Win32
larrybr [Mon, 20 Sep 2021 20:15:28 +0000 (20:15 +0000)] 
Allow fileio extension to be a stand-alone DLL for Win32

FossilOrigin-Name: d1cc3105b2baceb9f426fd6bc8d8317de3af09a0f02517715bd292c68e282fa1

3 years agoAdjust shell tests for *Nix and Windows test platform anomaly speedy_cli
larrybr [Sun, 19 Sep 2021 18:31:55 +0000 (18:31 +0000)] 
Adjust shell tests for *Nix and Windows test platform anomaly

FossilOrigin-Name: 577544c5a2f193e00e5ca55b7feae96568198019573b9b0b37e2bf4300d6d524

3 years agoSync w/trunk, further streamline shell's resumable prescan.
larrybr [Sat, 18 Sep 2021 21:35:22 +0000 (21:35 +0000)] 
Sync w/trunk, further streamline shell's resumable prescan.

FossilOrigin-Name: 9e00f9f7c03c192a3fb6b22851db0626515c59daac5ce6520229c42c838bf5b7

3 years agoFurther tests for legacy rtree geom callbacks.
dan [Sat, 18 Sep 2021 16:15:54 +0000 (16:15 +0000)] 
Further tests for legacy rtree geom callbacks.

FossilOrigin-Name: 99d6bb22e8735681443bfe67287aa15ce2c57d0d63e304abf8aa01fde50dd021

3 years agoShell's .read pipe now works for Windows too.
larrybr [Fri, 17 Sep 2021 21:12:47 +0000 (21:12 +0000)] 
Shell's .read pipe now works for Windows too.

FossilOrigin-Name: 929bcc4098549692c573779d65c4c28027b0a2f48ebbf5b3f038deee24374b67

3 years agoAdd tests for legacy geometry callbacks to rtreedoc2.test.
dan [Fri, 17 Sep 2021 20:43:27 +0000 (20:43 +0000)] 
Add tests for legacy geometry callbacks to rtreedoc2.test.

FossilOrigin-Name: 6ad00e52eda5bc4cb8e6fffbd7538bcd4c6b22f84b837a746eba6bf8c91eb55a

3 years agoMake the affinity() function available even if compiled without
drh [Fri, 17 Sep 2021 13:07:15 +0000 (13:07 +0000)] 
Make the affinity() function available even if compiled without
SQLITE_DEBUG.  Surround the implementation of all test-only SQL functions
with #ifndef SQLITE_UNTESTABLE.

FossilOrigin-Name: b7e00ef8059f6fb5658c6ad6f337cfdf065a5f1b1130452122282f3a69e98a93

3 years agoThe dbsqlfuzz fuzzer found a refutation for a recent ALWAYS() macro.
drh [Thu, 16 Sep 2021 22:23:36 +0000 (22:23 +0000)] 
The dbsqlfuzz fuzzer found a refutation for a recent ALWAYS() macro.

FossilOrigin-Name: ebfc18aaa6506ccac80f297a1792e726972bb39c0b5c8706faadeb8df94a45e9

3 years agoMinor changes to rtree.c so that we can get full branch coverage even when
drh [Thu, 16 Sep 2021 20:16:39 +0000 (20:16 +0000)] 
Minor changes to rtree.c so that we can get full branch coverage even when
it is compiled without geopoly.

FossilOrigin-Name: f05ae9b5864459493154037d2c902d203c4a43007b5d61bd4beb1eed56e06d13

3 years agoAdd tests to rtreedoc.test.
dan [Thu, 16 Sep 2021 19:50:54 +0000 (19:50 +0000)] 
Add tests to rtreedoc.test.

FossilOrigin-Name: b18c6ec46079520e0db8b42586ce9370a4038d0b4f719cfb98488037883e2537

3 years agoAdd a single new ALWAYS() to rtree.c, with justification.
drh [Thu, 16 Sep 2021 17:02:59 +0000 (17:02 +0000)] 
Add a single new ALWAYS() to rtree.c, with justification.

FossilOrigin-Name: 778e4499cdf2083d5431738099dedf0aade9271f661e09ca3278e0109bb1e720

3 years agoAdd a tag comment in rtree.c. No changes to code.
drh [Thu, 16 Sep 2021 16:41:59 +0000 (16:41 +0000)] 
Add a tag comment in rtree.c.  No changes to code.

FossilOrigin-Name: 213410fa9cceb4ce34bf590ba65648ebeb94cc8d0c29a8881222208097162a95

3 years agoAdd a reference counter to a structure used internally by the Tcl interface so that...
dan [Thu, 16 Sep 2021 14:17:14 +0000 (14:17 +0000)] 
Add a reference counter to a structure used internally by the Tcl interface so that it does not segfault if the database connection is closed from any of the various callback scripts that may be invoked.

FossilOrigin-Name: e54a33ce56432b23947583d34cf12fc64a55bbc49eb77c7f33cff5926df51070

3 years agoMark an unreachable branch in rtree.
drh [Thu, 16 Sep 2021 14:07:09 +0000 (14:07 +0000)] 
Mark an unreachable branch in rtree.

FossilOrigin-Name: e6c4afd5b365b8dea8c0742352a09029da0f9715dd2407d4ccf53f1e0a4ce625

3 years agoBack out a couple of ALWAYS() macros from [4fab9089868bbb05]. Test case
drh [Thu, 16 Sep 2021 13:52:28 +0000 (13:52 +0000)] 
Back out a couple of ALWAYS() macros from [4fab9089868bbb05].  Test case
added to TH3.

FossilOrigin-Name: d26963a530ccbe36a174823d2f0bd7e06c6fca4f38ecdd04cd700c4000cc3719

3 years agoFor ALTER TABLE RENAME COLUMN, do not try to filter virtual tables out of
drh [Thu, 16 Sep 2021 13:20:29 +0000 (13:20 +0000)] 
For ALTER TABLE RENAME COLUMN, do not try to filter virtual tables out of
calls to sqlite_rename_column().  Let the function filter them itself.
The WHERE clause can mistakenly let virtual tables through if the
sqlite_schema table is corrupt.  The sqlite_rename_column() function must
deal with them.  We might as well let it deal with them always.

FossilOrigin-Name: 7c82b43b7cdb825f431d3a778f8b34e32666ccb3b067f1f2533d3b3dcca7bdc9

3 years agoUnder SQLITE_DEBUG with PRAGMA vdbe_trace=ON, show an output line if the
drh [Thu, 16 Sep 2021 12:33:53 +0000 (12:33 +0000)] 
Under SQLITE_DEBUG with PRAGMA vdbe_trace=ON, show an output line if the
VDBE aborts for any reason.

FossilOrigin-Name: 7e3d6810039ca4563aa68dfa3671f570792a10f75c8eea68aa7dfd02d17702ca

3 years agoSimplify the routine that attempts to estimate the size of an rtree index
drh [Thu, 16 Sep 2021 07:32:24 +0000 (07:32 +0000)] 
Simplify the routine that attempts to estimate the size of an rtree index
by looking at the sqlite_stat1 entry for the %_rowid table.

FossilOrigin-Name: 06c329c17c2c2de8bc1ca7f3b0b929055675761a8be7a7e8b4a9fc5cca0d1679

3 years agoMark various unreachable branches in rtree.c with ALWAYS() or NEVER().
drh [Thu, 16 Sep 2021 05:39:07 +0000 (05:39 +0000)] 
Mark various unreachable branches in rtree.c with ALWAYS() or NEVER().

FossilOrigin-Name: 4fab9089868bbb05a192da09bc201f0a84c5b9bef39dcb063afc1d7658299fdd

3 years agoNew ALWAYS() and assert() to mark unreachable branches in rtree.c. tree-testing
drh [Thu, 16 Sep 2021 05:24:40 +0000 (05:24 +0000)] 
New ALWAYS() and assert() to mark unreachable branches in rtree.c.

FossilOrigin-Name: f7ad73c49507c9436adc7fe1b865f801eefcc7ea6b3ba35e83e63029beb03016

3 years agoIn rtree.c, remove an incorrect ALWAYS(). Add other ALWAYS() and NEVER().
drh [Wed, 15 Sep 2021 19:53:22 +0000 (19:53 +0000)] 
In rtree.c, remove an incorrect ALWAYS().  Add other ALWAYS() and NEVER().

FossilOrigin-Name: cbaac8878aac0623beb5af3bc79a5b1c0179213206fd658b8c4fcc3531889480

3 years agoAdd more ALWAYS() macros on unreachable branches in rtree.c
drh [Wed, 15 Sep 2021 19:13:24 +0000 (19:13 +0000)] 
Add more ALWAYS() macros on unreachable branches in rtree.c

FossilOrigin-Name: fbba89dac9591c56da81bd0808910fbc64640f3ccfd95845ecab4d3aea46ca61

3 years agoFix the xBestIndex method on rtree so that it correctly recognizes that
drh [Wed, 15 Sep 2021 16:20:15 +0000 (16:20 +0000)] 
Fix the xBestIndex method on rtree so that it correctly recognizes that
rowid=? works the same as id=?.

FossilOrigin-Name: c74c07cc86443057d34284ae31eb68470741592b0e61072fd5e120e82919169b

3 years agoAdd ALWAYS() macros on some unreachable branches in rtree.
drh [Wed, 15 Sep 2021 15:56:00 +0000 (15:56 +0000)] 
Add ALWAYS() macros on some unreachable branches in rtree.

FossilOrigin-Name: 9123f680ae3100f4c781ac4f5b8afac49bb5d4231b5931ad112b1b615f22f613

3 years agoFurther updates to rtreedoc.test.
dan [Wed, 15 Sep 2021 15:53:01 +0000 (15:53 +0000)] 
Further updates to rtreedoc.test.

FossilOrigin-Name: e66727837ddd5d1344c252323d52600b6138f5a2471f63d09b5a28ea2c22e595

3 years agoFix non-build for a test configuration
larrybr [Wed, 15 Sep 2021 14:48:02 +0000 (14:48 +0000)] 
Fix non-build for a test configuration

FossilOrigin-Name: c9a4ab059050a83d811149ff196ff16ea9e4c301627482800982b87cd30ddbbc

3 years agoSimplify some of the corrupt shadow-table detection logic in rtree.
drh [Wed, 15 Sep 2021 13:09:55 +0000 (13:09 +0000)] 
Simplify some of the corrupt shadow-table detection logic in rtree.

FossilOrigin-Name: 0c4f37aa475bd4bd17c20c02ab2d9f63d0a6a08b0e2bbfa559f7b972ece6f4fc

3 years agoSquelch needless narrowing warning.
larrybr [Wed, 15 Sep 2021 11:15:03 +0000 (11:15 +0000)] 
Squelch needless narrowing warning.

FossilOrigin-Name: 5540e6abc1a2a8540113ec9bfebe1fb78d6a044f45396dd1926b65ff17ff236b

3 years agoEnsure rtreedoc.test is not run for builds without the rtree extension.
dan [Wed, 15 Sep 2021 10:49:31 +0000 (10:49 +0000)] 
Ensure rtreedoc.test is not run for builds without the rtree extension.

FossilOrigin-Name: 42dff223470e9c096b8486ef232ac41b70d0875d8ae07630bfaaea1515ffa8d0

3 years agoAdd test cases to rtreedoc.test.
dan [Tue, 14 Sep 2021 20:07:58 +0000 (20:07 +0000)] 
Add test cases to rtreedoc.test.

FossilOrigin-Name: afe0ec4d589d87a07c0daf3fc4de884b82a8bceed593ba4e44caa1cf033a6715

3 years agoUpdate requirements marks to reflect recent documentation changes.
drh [Tue, 14 Sep 2021 18:57:30 +0000 (18:57 +0000)] 
Update requirements marks to reflect recent documentation changes.

FossilOrigin-Name: 08cab8921e670a0d1758b505fe8c7455f6194cec69d1b7b77de91688be1028a6

3 years agoAdd test cases to rtreedoc.test.
dan [Tue, 14 Sep 2021 14:16:36 +0000 (14:16 +0000)] 
Add test cases to rtreedoc.test.

FossilOrigin-Name: b62de1269f17fcc944ff404a20c4f705ffe99c44d6c54f42c29e69753aac8092

3 years agoMinor updates to rtreedoc.test.
dan [Tue, 14 Sep 2021 11:27:20 +0000 (11:27 +0000)] 
Minor updates to rtreedoc.test.

FossilOrigin-Name: b22c75e41ded29afd026b32b73b87f6427340a9ac1d46147db8edac20eb7beb5

3 years agoShell to .read any named character source file/device (again.)
larrybr [Mon, 13 Sep 2021 23:11:46 +0000 (23:11 +0000)] 
Shell to .read any named character source file/device (again.)

FossilOrigin-Name: c6fe4f8d639db25f0a339f4071f0ae34b90dcfec8dcc2c571f969e2614a38e05

3 years agoAdd test cases to rtreedoc.test.
dan [Mon, 13 Sep 2021 18:32:02 +0000 (18:32 +0000)] 
Add test cases to rtreedoc.test.

FossilOrigin-Name: 4ee99d315487a3aa09911191a74c6a12693784c5359243eb1396d8868566e80a

3 years agoAdd assert() statements to refute
drh [Mon, 13 Sep 2021 18:16:15 +0000 (18:16 +0000)] 
Add assert() statements to refute
[forum:/forumpost/9f4e7f58fbb66ddd|forum post 9f4e7f58fbb66ddd].

FossilOrigin-Name: 83a83475c5064ea62016a03e9173ecd2a1fec7f6296f1ee99896fa0a38b4196a

3 years agoAdd new test file rtreedoc.test.
dan [Mon, 13 Sep 2021 16:36:20 +0000 (16:36 +0000)] 
Add new test file rtreedoc.test.

FossilOrigin-Name: 8c4b1482eeb31856bce20eda1ce74959e19da11962f74d406a608747a92fe429

3 years agoFix an incorrect comment and possible integer overflow in pager
drh [Mon, 13 Sep 2021 13:53:13 +0000 (13:53 +0000)] 
Fix an incorrect comment and possible integer overflow in pager
resulting from check-in [23ca23894af352ea].  Problem reported by
[forum:/forumpost/e2ea1a3f61|forum post e2ea1a3f61].  Also change
the datatype of Pager.pageSize to i64 even though page size never
exceeds 65536, in order to help prevent future problems of this kind.

FossilOrigin-Name: f4a552ed9f4ab35520b634954c39748cc7bda535f426280b79da1b99f70599ac

3 years agoCLI prescanner made to match SQLite's rules for delimited identifiers. Tests begun.
larrybr [Sat, 11 Sep 2021 02:42:04 +0000 (02:42 +0000)] 
CLI prescanner made to match SQLite's rules for delimited identifiers. Tests begun.

FossilOrigin-Name: 15b105c520968855ad960d8929f80af9e9bedc155237af9af1956f7b546947f2

3 years agoMake replace.tcl useful with TCL 8.4
larrybr [Fri, 10 Sep 2021 22:00:43 +0000 (22:00 +0000)] 
Make replace.tcl useful with TCL 8.4

FossilOrigin-Name: 2dd61dd97b0326b59b0bc3c83b4d4b9acf811c5acae4d1003e7525ba7a26daf5

3 years agoMake CLI prescan handle goofy identifier delimiters too. Streamline code.
larrybr [Fri, 10 Sep 2021 19:45:22 +0000 (19:45 +0000)] 
Make CLI prescan handle goofy identifier delimiters too. Streamline code.

FossilOrigin-Name: 968aed690ba7240f8a256f5ba679cc971f432ff9af0ff99744824af79b952545

3 years agoFix (luckily harmless) typo in memdb.c per https://sqlite.org/forum/forumpost/15af887...
larrybr [Fri, 10 Sep 2021 18:35:59 +0000 (18:35 +0000)] 
Fix (luckily harmless) typo in memdb.c per https://sqlite.org/forum/forumpost/15af8872d5999df1

FossilOrigin-Name: d577030cdad165474b082afbe64782e2eb3290331b0e3045b1e85ee6fe011504

3 years agoWhen showHeader set at CLI invocation, do not auto-set it later.
larrybr [Fri, 10 Sep 2021 01:45:20 +0000 (01:45 +0000)] 
When showHeader set at CLI invocation, do not auto-set it later.

FossilOrigin-Name: 733b7d4f95a4e2f0df323974f323c40c2486b188d442e74306a4b580fd8a8bd8