]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
4 years agoIncorporate the 3.34.1 patches into the reuse-schema branch. reuse-schema-3.34
drh [Wed, 20 Jan 2021 15:10:48 +0000 (15:10 +0000)] 
Incorporate the 3.34.1 patches into the reuse-schema branch.

FossilOrigin-Name: cc0e582854be11c29186d535130344c5486deb124ec4135a50ee1de21ea44a1d

4 years agoVersion 3.34.1 branch-3.34 patch version-3.34.1
drh [Wed, 20 Jan 2021 14:10:07 +0000 (14:10 +0000)] 
Version 3.34.1

FossilOrigin-Name: 10e20c0b43500cfb9bbc0eaa061c57514f715d87238f4d835880cd846b9ebd1f

4 years agoFix an issue with sha3_query() when the first argument contains blank
drh [Tue, 19 Jan 2021 20:38:13 +0000 (20:38 +0000)] 
Fix an issue with sha3_query() when the first argument contains blank
SQL statements.

FossilOrigin-Name: a1a7a5f238fcfdcd56faba063e381258c9e2944d9b02b31d402a4207a607fc1c

4 years agoBump the version number to 3.34.1.
drh [Tue, 19 Jan 2021 20:17:46 +0000 (20:17 +0000)] 
Bump the version number to 3.34.1.

FossilOrigin-Name: cea7d0f8a3d9b3f5caae63ad555de25b53c577fc8e004127ec18cc7f0c6f1714

4 years agoFix a problem handling sub-queries with both a correlated WHERE clause and a "HAVING...
drh [Tue, 19 Jan 2021 20:09:44 +0000 (20:09 +0000)] 
Fix a problem handling sub-queries with both a correlated WHERE clause and a "HAVING 0" clause where the parent query is itself an aggregate.
The problem was apparently introduced by check-in [6e6b3729e0549de0]

FossilOrigin-Name: 30a4c323650cc9498a6dacd1760dd5170d7cc7848c4e96ff6bd64da365f96366

4 years agoPrevent potential segfault in the sqlite-expert idxPopulateStat1 context cleanup...
drh [Tue, 19 Jan 2021 20:04:37 +0000 (20:04 +0000)] 
Prevent potential segfault in the sqlite-expert idxPopulateStat1 context cleanup code.

FossilOrigin-Name: 69e31d52b2a7bde1ed72bc7b927ff451139fbc76504e750324e6368ad26b11b1

4 years agoFix a typo in the sqlite3_free_filename() documentation.
drh [Wed, 16 Dec 2020 13:20:15 +0000 (13:20 +0000)] 
Fix a typo in the sqlite3_free_filename() documentation.

FossilOrigin-Name: 7316ee19c590854545019a56799968143109929049424a8cc1dcf9624f98a544

4 years agoUpdate this branch with latest trunk changes.
dan [Fri, 4 Dec 2020 18:47:28 +0000 (18:47 +0000)] 
Update this branch with latest trunk changes.

FossilOrigin-Name: 846e8444f761a4f3e3e0fb89e87b329799a6e8dd32ac7580dc20eb6ff9ed0d36

4 years agoFix harmless compiler warnings associated with the recent FTS5 enhancements.
drh [Fri, 4 Dec 2020 17:05:16 +0000 (17:05 +0000)] 
Fix harmless compiler warnings associated with the recent FTS5 enhancements.

FossilOrigin-Name: 1db7c751912beb57a697ac8e85b9c29e30da7b6c89207e9828bf08e56c58242f

4 years agoFix a bug in the ".eqp" command of the shell that was introduced by the
drh [Fri, 4 Dec 2020 16:58:20 +0000 (16:58 +0000)] 
Fix a bug in the ".eqp" command of the shell that was introduced by the
recent sqlite3SelectTrace/SQLITE_TESTCTRL_TRACEFLAGS changes.

FossilOrigin-Name: fd02dffceb0e21cd85c99d5481ab8567110d01c30ea701178547f32299944302

4 years agoEnsure that fts5 function matchinfo() is registered before running tests that use...
dan [Fri, 4 Dec 2020 16:49:25 +0000 (16:49 +0000)] 
Ensure that fts5 function matchinfo() is registered before running tests that use it in fts5corrupt3.test.

FossilOrigin-Name: 932e05e093192991589e70c2cbcc8a57fb3dcc6df1c2673962bfd06ba5cfdd97

4 years agoFix a test script problem in walvfs.test.
dan [Fri, 4 Dec 2020 16:26:25 +0000 (16:26 +0000)] 
Fix a test script problem in walvfs.test.

FossilOrigin-Name: 4c5076fbe42cc6447c47bfc202501f945f78bd716cbe8e33599c67b7d0956611

4 years agoFix an incorrect datatype no the sqlite3WhereTrace variable in test1.c.
drh [Fri, 4 Dec 2020 16:25:59 +0000 (16:25 +0000)] 
Fix an incorrect datatype no the sqlite3WhereTrace variable in test1.c.

FossilOrigin-Name: 4e6dab30f6d6795ecec9d8c4489fa4d210a3002715ad89812d65a1a846c164b9

4 years agoEliminate the sqlite3_unsupported_selecttrace global variable by creating
drh [Fri, 4 Dec 2020 16:09:27 +0000 (16:09 +0000)] 
Eliminate the sqlite3_unsupported_selecttrace global variable by creating
a new test-control to control SELECT tracing.  Note that SELECT tracing is
only available on debug builds.

FossilOrigin-Name: fb07c4e3c7ad3493c274cbfcf0dffdedcca18c0d90de04459134511d4e2a5277

4 years agoFurther changes to the trace variables to try to eliminate (harmless) compiler traceflags-test-control
drh [Fri, 4 Dec 2020 16:04:45 +0000 (16:04 +0000)] 
Further changes to the trace variables to try to eliminate (harmless) compiler
warnings in all configurations.

FossilOrigin-Name: 3a4c98b989964e3e366fe9519e9b5ed935e893d5b69d92bc0388a14c7e7938e6

4 years agoAlternative implementation of ".selecttrace" and ".wheretrace" that uses
drh [Fri, 4 Dec 2020 01:17:57 +0000 (01:17 +0000)] 
Alternative implementation of ".selecttrace" and ".wheretrace" that uses
a test-control rather than global variables.

FossilOrigin-Name: d36d6f2923a2393c751c0ac7634433453be20df7567fd914e57cbb1ae15f68b2

4 years agoWhen merging prefix lists in fts5, use 16-way merges instead of 2-way merges. This...
dan [Thu, 3 Dec 2020 21:22:37 +0000 (21:22 +0000)] 
When merging prefix lists in fts5, use 16-way merges instead of 2-way merges. This faster.

FossilOrigin-Name: 026a93508ec392ca5cd2578ae9eab64974f58beccda088e10d4cc951f237632f

4 years agoDo not simulate OOM faults on the SQLITE_FCNTL_CKPT_START and
drh [Thu, 3 Dec 2020 19:25:06 +0000 (19:25 +0000)] 
Do not simulate OOM faults on the SQLITE_FCNTL_CKPT_START and
SQLITE_FCNTL_CKPT_DONE file-controls, as those are write-only and
the return value is always ignored.

FossilOrigin-Name: 62a2d394835276fabc0f1df2302605a700b2244775bf2e35e86529df8e40a0da

4 years agoEnhance the generate_series() table-valued function to support negative
drh [Thu, 3 Dec 2020 14:21:26 +0000 (14:21 +0000)] 
Enhance the generate_series() table-valued function to support negative
step values.

FossilOrigin-Name: 9b60fc48706bb77b2d4fe27a7b5834a6dc229b4051a9285032da578e4f2849e6

4 years agoPrevent potential segfault in the sqlite-expert idxPopulateStat1 context cleanup...
mistachkin [Wed, 2 Dec 2020 20:07:49 +0000 (20:07 +0000)] 
Prevent potential segfault in the sqlite-expert idxPopulateStat1 context cleanup code.

FossilOrigin-Name: c24f13448b5a55f45b4d4786a878fa73fe3395b5724f3bc2eea22e5e2b074353

4 years agoAllow a search for an N character prefix in fts5 to use a prefix index of size N...
dan [Wed, 2 Dec 2020 19:08:15 +0000 (19:08 +0000)] 
Allow a search for an N character prefix in fts5 to use a prefix index of size N+1, if no prefix index of size N exists.

FossilOrigin-Name: 78a7801d8fc9e58a62e5168e35b52b7440340549123fc6a537e2abd571f6fe7b

4 years agoFix the ".open" command in the CLI so that it accepts command-line options
drh [Wed, 2 Dec 2020 18:27:48 +0000 (18:27 +0000)] 
Fix the ".open" command in the CLI so that it accepts command-line options
both before and after the filename.

FossilOrigin-Name: d330bf0c02e67f70f49496e4b1e484bb4e876622becc6a062b2aefbd585d0117

4 years agoImprove performance for fts5 column filters that filter for more than one column...
dan [Wed, 2 Dec 2020 16:23:05 +0000 (16:23 +0000)] 
Improve performance for fts5 column filters that filter for more than one column. e.g. "{col1 col2 col3}:phrase".

FossilOrigin-Name: d8de2f236d43a88fac7550a0451951dd5a945eb304e32f82e662479cea7c2684

4 years agoParameterize the hash function in mkkeywordhash.c. This was an attempt to
drh [Wed, 2 Dec 2020 02:58:05 +0000 (02:58 +0000)] 
Parameterize the hash function in mkkeywordhash.c.  This was an attempt to
find a better hash function, which turned out to not be successful.

FossilOrigin-Name: 2195d731f51a18f917c4299d8f4c7ee7c139c2527f62869d6da171a6d1d89ea6

4 years agoIncrease the version number to 3.35.0 to begin the next development cycle.
drh [Wed, 2 Dec 2020 00:22:09 +0000 (00:22 +0000)] 
Increase the version number to 3.35.0 to begin the next development cycle.

FossilOrigin-Name: edbabaa30823db7c7d169cb93722b5f74bc711359984fb7e139ca9d10fe7dae4

4 years agoSlightly faster tokenization of non-keyword identifiers.
drh [Wed, 2 Dec 2020 00:20:00 +0000 (00:20 +0000)] 
Slightly faster tokenization of non-keyword identifiers.

FossilOrigin-Name: 55fa22bd403cc8f0973efea898a7cfa3a32b57c7e2a7a4c30c3f2c72d5396f07

4 years agoAdd the --lookaside SIZE COUNT command-line option to the dbfuzz2 testing tool.
drh [Tue, 1 Dec 2020 23:18:13 +0000 (23:18 +0000)] 
Add the --lookaside SIZE COUNT command-line option to the dbfuzz2 testing tool.

FossilOrigin-Name: 2466960c0ba02ef9c325e9a5f8603db518e7529547f614c225fef430421e1643

4 years agoMerge the 3.34.0 release into the reuse-schema branch.
drh [Tue, 1 Dec 2020 16:36:04 +0000 (16:36 +0000)] 
Merge the 3.34.0 release into the reuse-schema branch.

FossilOrigin-Name: 73b5f614cd6603d6cf9605ac4ccb510a2560fca70a8a3f3f930cf2a4e853c301

4 years agoVersion 3.34.0 version-3.34.0
drh [Tue, 1 Dec 2020 16:14:00 +0000 (16:14 +0000)] 
Version 3.34.0

FossilOrigin-Name: a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b

4 years agoUpdate the tea/win/makefile.vc file that ships as part of the autoconf package to...
dan [Mon, 30 Nov 2020 18:52:08 +0000 (18:52 +0000)] 
Update the tea/win/makefile.vc file that ships as part of the autoconf package to use "sqlite3" instead of "tclsqlite3" for the installed dll filename.

FossilOrigin-Name: 23212b1a054f05773a9f69f9802035eea6a9d759a2a09e22f46d1046c058b417

4 years agoUpdate the tea/win/makefile.vc file that ships as part of the autoconf package to... win-tea-fix
dan [Mon, 30 Nov 2020 18:43:40 +0000 (18:43 +0000)] 
Update the tea/win/makefile.vc file that ships as part of the autoconf package to use "sqlite3" instead of "tclsqlite3" for the installed dll filename.

FossilOrigin-Name: 93d4d9dc05bb86c08a12d56b3ce68ec39b69e57951a936fb3b326812c051c3b4

4 years agoDo not reuse the obsolete SQLITE_TESTCTRL_PRNG_RESET value for
drh [Mon, 30 Nov 2020 14:20:17 +0000 (14:20 +0000)] 
Do not reuse the obsolete SQLITE_TESTCTRL_PRNG_RESET value for
SQLITE_TESTCTRL_SEEK_COUNT.  Give SEEK_COUNT its own unique value.
This avoids incompatibility with legacy test code.

FossilOrigin-Name: fdba0b129091d607dc0c1aa52f8631a208dbff22476a298bd5428e672593ed18

4 years agoImprove the speed of the tokenizer by recognizing that tokens starting faster-tokenizer
drh [Fri, 27 Nov 2020 20:56:16 +0000 (20:56 +0000)] 
Improve the speed of the tokenizer by recognizing that tokens starting
with letters "_", "Y", or "Z" can never be SQL keywords and must be ordinary
identifiers.

FossilOrigin-Name: 16e281ed6219cc229dec7e3f1b40da2304dc270a74fd6ef78d04a088e30e7026

4 years agoFix a compiler warning in fts5_aux.c.
dan [Fri, 27 Nov 2020 19:40:13 +0000 (19:40 +0000)] 
Fix a compiler warning in fts5_aux.c.

FossilOrigin-Name: 8edb983bc87898eff2cd2e7e672a32a47c71b2be9d818513d339e95560d45b2b

4 years agoAdd missing cast to fts5 bm25() code.
dan [Fri, 27 Nov 2020 16:15:55 +0000 (16:15 +0000)] 
Add missing cast to fts5 bm25() code.

FossilOrigin-Name: 6ff9673847c0b4174d9435e93d19af0ee7406b1a12edeb6edec98697e1646824

4 years agoRemove a redundant "if( rc==SQLITE_OK )" from the fts5 bm25() code.
dan [Fri, 27 Nov 2020 16:08:15 +0000 (16:08 +0000)] 
Remove a redundant "if( rc==SQLITE_OK )" from the fts5 bm25() code.

FossilOrigin-Name: d85f4f27f58adcc75fc7d59e63af95b2a338052d8748a11f22ec1e48d1aff4cc

4 years agoMove an "if( rc==SQLITE_OK )" to outside a loop body in the fts5 bm25() code.
dan [Fri, 27 Nov 2020 16:05:31 +0000 (16:05 +0000)] 
Move an "if( rc==SQLITE_OK )" to outside a loop body in the fts5 bm25() code.

FossilOrigin-Name: 14a4dcf3474566d072007a37d214c892397c21dd3b7f8b55ad0e5edfb7130dd6

4 years agoFix a case in the FTS5 integrity check where a corrupt database could cause a buffer...
dan [Fri, 27 Nov 2020 15:28:26 +0000 (15:28 +0000)] 
Fix a case in the FTS5 integrity check where a corrupt database could cause a buffer overread.

FossilOrigin-Name: a32b4f650d2d543bd2773cbc8655c1679a20b35ac9ec4d08c7754ddf6d972acb

4 years agoUpdate mkunicode.tcl to match the change erroneously made to machine generated file...
dan [Thu, 26 Nov 2020 20:13:54 +0000 (20:13 +0000)] 
Update mkunicode.tcl to match the change erroneously made to machine generated file fts5_unicode2.c in [b7b7bde9].

FossilOrigin-Name: 326d579d777fdede6bc64f9525248767f4730de4e50260b0387e614a9d006416

4 years agoMerge trunk changes into this branch.
dan [Wed, 25 Nov 2020 20:29:45 +0000 (20:29 +0000)] 
Merge trunk changes into this branch.

FossilOrigin-Name: f4b7c10057a50c5b1f38d4e35ec684ad9d6e21278675fec98961e1fa408ded52

4 years agoUpdate a requirement mark in the e_expr.test script.
drh [Wed, 25 Nov 2020 18:44:20 +0000 (18:44 +0000)] 
Update a requirement mark in the e_expr.test script.

FossilOrigin-Name: bb174a074b5833181900d396edda955254ea1768750a0ab3b6d714530b1fe13f

4 years agoFix harmless compiler warnings about unused function parameters.
drh [Wed, 25 Nov 2020 16:28:04 +0000 (16:28 +0000)] 
Fix harmless compiler warnings about unused function parameters.

FossilOrigin-Name: 25d067c270966d9506db8bedf280883e32b69050b14bdbbeda4bb2d9a362619c

4 years agoFix a potential NULL pointer dereference in the geopoly_overlap() routine
drh [Wed, 25 Nov 2020 15:29:08 +0000 (15:29 +0000)] 
Fix a potential NULL pointer dereference in the geopoly_overlap() routine
of the GeoPoly extension.

FossilOrigin-Name: b5665712e667a20d42a2e892d9d540f4273609eabd56f8178e1d5664280821f3

4 years agoFix the shell1.test test script so that it works on windows.
drh [Wed, 25 Nov 2020 14:50:42 +0000 (14:50 +0000)] 
Fix the shell1.test test script so that it works on windows.

FossilOrigin-Name: 9bd15b07e58b1811c2a368ec76059ac683a2c35b163ef4bba01ccb8b7ca7288d

4 years agoChange the -init option to the command-line shell to honor the -bail option.
drh [Wed, 25 Nov 2020 13:59:47 +0000 (13:59 +0000)] 
Change the -init option to the command-line shell to honor the -bail option.
Also change it to report an error if the filename mentioned cannot be
opened.

FossilOrigin-Name: a29f54bd2c032374d7235bb1f9d4c04c094611bbc7d274b7b92722b5b802050c

4 years agoFix a typo in the sqlite3_txn_state() documentation.
drh [Tue, 24 Nov 2020 23:40:48 +0000 (23:40 +0000)] 
Fix a typo in the sqlite3_txn_state() documentation.

FossilOrigin-Name: 5b4325295b2f17b7a4eaa2d3a30d06a24801992b3aa17c7d57e015f9f395fb95

4 years agoAdd the new sqlite3_txn_state() interface to the set of routines accessible
drh [Tue, 24 Nov 2020 21:19:23 +0000 (21:19 +0000)] 
Add the new sqlite3_txn_state() interface to the set of routines accessible
by run-time loadables extensions.

FossilOrigin-Name: db25f1dc8eb8b8bd45912e9b457d4cc32687bc4f709ce1878e9b4ccedbb18af9

4 years agoFix a harmless typo in a comment.
drh [Tue, 24 Nov 2020 19:55:49 +0000 (19:55 +0000)] 
Fix a harmless typo in a comment.

FossilOrigin-Name: b2a201f1b5dc2fc94b360df4807c108fac47db2399edd8763efbdd66b71ffe5f

4 years agoFix a bug in OOM handling code introduced by [6a28713d].
dan [Tue, 24 Nov 2020 17:55:34 +0000 (17:55 +0000)] 
Fix a bug in OOM handling code introduced by [6a28713d].

FossilOrigin-Name: 8a786ce99491401dd7660e54f1a1ba3b2300cecbe180b1a31e549ff5f5b77bdc

4 years agoEnsure that super-journal and other journal filenames passed by SQLite to an sqlite3_...
dan [Tue, 24 Nov 2020 16:44:09 +0000 (16:44 +0000)] 
Ensure that super-journal and other journal filenames passed by SQLite to an sqlite3_vfs.xOpen() implementation may be safely passed to sqlite3_uri_parameter() and similar functions.

FossilOrigin-Name: 6a28713d59cde0882c3508160347c2ea18c7c4e9bfd1b053103af2d5e12a144c

4 years agoRemove the VERSION_NUMBER macro from configure.ac as it has been unused
drh [Tue, 24 Nov 2020 13:14:15 +0000 (13:14 +0000)] 
Remove the VERSION_NUMBER macro from configure.ac as it has been unused
since 2009 check-in [7f4810747b086498].  See also
[forum:/forumpost/bb2c634fcd|forum post bb2c634fcd].

FossilOrigin-Name: 5466dd55d4aa15fd96f00b6e205dfb868879357a476df7ffd29b97bb570629a5

4 years agoSyntactic changes to work around a bug in gcov 9.3.0. No changes to the
drh [Mon, 23 Nov 2020 21:05:29 +0000 (21:05 +0000)] 
Syntactic changes to work around a bug in gcov 9.3.0.  No changes to the
generated code for release builds.

FossilOrigin-Name: 4f1573b146193e5d552981a9d1d11e50da4da4a843f790e4af1cf0cc19a0b020

4 years agoIn os_unix.c, put ALWAYS() on unreachable branches associated with pathname
drh [Mon, 23 Nov 2020 17:36:06 +0000 (17:36 +0000)] 
In os_unix.c, put ALWAYS() on unreachable branches associated with pathname
normalization.

FossilOrigin-Name: b45a08e3c7edfa76b699d3e29f28daa5bd08039668ec57121e4e85edf36150f1

4 years agoFix a test script problem causing crash8.test to fail when run with leak-sanitizer.
dan [Mon, 23 Nov 2020 15:30:16 +0000 (15:30 +0000)] 
Fix a test script problem causing crash8.test to fail when run with leak-sanitizer.

FossilOrigin-Name: 2c437f7a2c87129d00c71fa569315b68e0ba9514041d93503350c9ae9f080f17

4 years agoAllow "substring()" as an alias for "substr()" for compatibility with other
drh [Mon, 23 Nov 2020 14:50:43 +0000 (14:50 +0000)] 
Allow "substring()" as an alias for "substr()" for compatibility with other
SQL engines.

FossilOrigin-Name: aa2ee5754c9f8378c4d490ca756a6415042904477727f0d86e9c0190b5e8b275

4 years agoAdd file doc/vdbesort-memory.md, containing notes on the way vdbesort.c uses heap...
dan [Fri, 20 Nov 2020 14:16:41 +0000 (14:16 +0000)] 
Add file doc/vdbesort-memory.md, containing notes on the way vdbesort.c uses heap memory.

FossilOrigin-Name: 07f53899a929cce93f17c0332819610c9517c7e54e00092af20efd746cf84438

4 years agoThe xFullPathname method of the unix VFS now normalizes the filenames by
drh [Thu, 19 Nov 2020 21:12:08 +0000 (21:12 +0000)] 
The xFullPathname method of the unix VFS now normalizes the filenames by
omitting surplus "/", "/./" and "/../" strings.

FossilOrigin-Name: c38dec6f52c01614c1bee8356daf0fcd9f708d029116e9bff51e06719a730dde

4 years agoMore test case changes so that shared-cache mode tests all work stronger-nofollow
drh [Thu, 19 Nov 2020 21:01:11 +0000 (21:01 +0000)] 
More test case changes so that shared-cache mode tests all work
with normalized database names.

FossilOrigin-Name: 6f0d5f0949130a4688319adf05d37c5ccd683ca9ad2dacb7ce433a5fe18ac3c3

4 years agoFix the tkt3793 test case so that work even when filenames are normalized.
drh [Thu, 19 Nov 2020 20:07:24 +0000 (20:07 +0000)] 
Fix the tkt3793 test case so that work even when filenames are normalized.

FossilOrigin-Name: e85d32ac6c82d39f5dc9b28f881d5d72f5e5a7e16df12c19315bfa8edea1b0b4

4 years agoUse an ephemeral table rather than a RowSet to remember rowids in the
drh [Thu, 19 Nov 2020 19:43:46 +0000 (19:43 +0000)] 
Use an ephemeral table rather than a RowSet to remember rowids in the
two-pass UPDATE algorithm, as this uses much less memory for large UPDATEs.

FossilOrigin-Name: 842c432772e6cd8464cdb7bfdb38789adeea9aa9e0486d4034cc9841f085f517

4 years agoIf a read() or pread() indicates that the database file is unreadable due to
drh [Wed, 18 Nov 2020 23:44:41 +0000 (23:44 +0000)] 
If a read() or pread() indicates that the database file is unreadable due to
filesystem damage, then it returns SQLITE_IOERR_CORRUPTFS which is then
converted into SQLITE_CORRUPT before being returned to the application.

FossilOrigin-Name: 849e4e14fd06eda512381f5f8aa65f75ad0a955e835da7c63526a53cf5e8f4dc

4 years agoImprovements to the mechanism that attempts to report SQLITE_CORRUPT if detect-corrupt-fs
drh [Wed, 18 Nov 2020 21:50:05 +0000 (21:50 +0000)] 
Improvements to the mechanism that attempts to report SQLITE_CORRUPT if
pread() says that the underlying filesystem is corrupt.

FossilOrigin-Name: b887c7504e7edeba758f3c1203c6cc56eef499fe05e7e6c6d82939bf7d78c57f

4 years agoMerge trunk changes into this branch.
dan [Wed, 18 Nov 2020 21:15:42 +0000 (21:15 +0000)] 
Merge trunk changes into this branch.

FossilOrigin-Name: 6004de525d90e5a32742349db9a7c818e1ae2d3bf3f57aff9058a3cb8f6f0fff

4 years agoUpdate cksumvfs.c so that if SQLITE_AMALGAMATION is defined, SQLITE_CKSUMVFS_STATIC...
dan [Wed, 18 Nov 2020 20:55:01 +0000 (20:55 +0000)] 
Update cksumvfs.c so that if SQLITE_AMALGAMATION is defined, SQLITE_CKSUMVFS_STATIC is implied.

FossilOrigin-Name: 184e9d782dfbad8011b5b0043b3fd8e5a369ed7076e37e14b301483ce5ffe5db

4 years agoAdd test infrastructure for cksumvfs. And update cksumvfs so that it works in concert...
dan [Wed, 18 Nov 2020 18:36:43 +0000 (18:36 +0000)] 
Add test infrastructure for cksumvfs. And update cksumvfs so that it works in concert with version 2 VFSs. No changes to core SQLite.

FossilOrigin-Name: 43d4801df5dc4625f6829ed8246758493842b2416ba609ee0423ef63155cece2

4 years agoFix a problem causing sqlite3_carray_bind() to return an undefined value.
dan [Wed, 18 Nov 2020 14:30:53 +0000 (14:30 +0000)] 
Fix a problem causing sqlite3_carray_bind() to return an undefined value.

FossilOrigin-Name: 083203a549d3cf26991d8626b308ff1e9e44be6abb72ab3d38e5fd53c99aed7f

4 years agoUpdate test code to fix a problem with SQLITE_OMIT_VIRTUAL_TABLE builds.
dan [Wed, 18 Nov 2020 14:12:20 +0000 (14:12 +0000)] 
Update test code to fix a problem with SQLITE_OMIT_VIRTUAL_TABLE builds.

FossilOrigin-Name: 29c779a07bf6ede1ec2cdb4695d801a5c113ab4b12d6cd22bcee8d2adb06891e

4 years agoOn unix, for certain error codes of read()/pread() return
drh [Wed, 18 Nov 2020 12:48:48 +0000 (12:48 +0000)] 
On unix, for certain error codes of read()/pread() return
SQLITE_IOERR_CORRUPTFS instead of SQLITE_IOERR_READ.  And then convert this
error into SQLITE_CORRUPT prior to returning back to the application.

FossilOrigin-Name: 9538ea8447e7b07c05197d6ff2208d3e97b45798736c85b63e8f0c7a3a98c1f3

4 years agoClaw back most of the performance lost in the previous commit. lowmem-update-exp
drh [Tue, 17 Nov 2020 21:26:13 +0000 (21:26 +0000)] 
Claw back most of the performance lost in the previous commit.

FossilOrigin-Name: df8ce2675b070fcdc338918e7652a26ffc90439fe399ceac206fadf8a93a681f

4 years agoFix trivial memory leaks in the shell and sqldiff programs.
dan [Tue, 17 Nov 2020 21:09:56 +0000 (21:09 +0000)] 
Fix trivial memory leaks in the shell and sqldiff programs.

FossilOrigin-Name: 272793e5edc47e431be77d589718a001f2696869e3e15f1371a1890645a995a7

4 years agoFix test file busy2.test so that it works with the "inmemory_journal" permutation.
dan [Tue, 17 Nov 2020 18:25:48 +0000 (18:25 +0000)] 
Fix test file busy2.test so that it works with the "inmemory_journal" permutation.

FossilOrigin-Name: b192fdddb63ac56fd6725032af110a069baac52347c0012c130bf34f3cbe69e4

4 years agoAdd a single-argument form to the CARRAY table-valued function, with
drh [Tue, 17 Nov 2020 14:41:37 +0000 (14:41 +0000)] 
Add a single-argument form to the CARRAY table-valued function, with
content bound using the sqlite3_carray_bind() interface that is included
with the extension.

FossilOrigin-Name: 7b229cb1202be203a87b8f47d284313f357deb1e6dfeb94bba7b46744c33512e

4 years agoEnhance the unix VFS so that it removes extra "/", "/./" and "/../" from
drh [Mon, 16 Nov 2020 18:45:21 +0000 (18:45 +0000)] 
Enhance the unix VFS so that it removes extra "/", "/./" and "/../" from
the database filename.

FossilOrigin-Name: 7ba89d3e5c68d970ed26c2ec6e6e34bae535c2cc0b22a022d20ac9ff4527b8ab

4 years agoModify UPDATE so that two-pass updates on a rowid table use an ephemeral
drh [Sat, 14 Nov 2020 20:03:34 +0000 (20:03 +0000)] 
Modify UPDATE so that two-pass updates on a rowid table use an ephemeral
table to store rowids rather than a RowSet.  This uses less memory, though
it is slower.

FossilOrigin-Name: 4673096dd8c5ed7aed098ff518a6d01d35c40fad991b89fddd91c19a727a4308

4 years agoImproved diagnostics output with ".wheretrace 0x800". No changes to
drh [Thu, 12 Nov 2020 18:16:01 +0000 (18:16 +0000)] 
Improved diagnostics output with ".wheretrace 0x800".  No changes to
non-debug builds.

FossilOrigin-Name: 772ae83c61c87a9004a614d8ec120ba843286bff1edbd20b987fd592ced84d79

4 years agoFix a typo in a comment. No changes to code.
drh [Wed, 11 Nov 2020 19:11:44 +0000 (19:11 +0000)] 
Fix a typo in a comment.  No changes to code.

FossilOrigin-Name: 572f1ed59d29e74f810c74ef9e72ebc94c2d3e04befc03a1f88034f04a9c60a8

4 years agoUse NEVER and ALWAYS macros to confirm that the return value from
drh [Sun, 8 Nov 2020 20:44:30 +0000 (20:44 +0000)] 
Use NEVER and ALWAYS macros to confirm that the return value from
sqlite3ExprSkipCollateAndLikely() is never NULL in some of its use cases.

FossilOrigin-Name: 76d2eb86e109fc3cbdba2e8175c22ed7660b59bb9315f6c55c565587f33ad43b

4 years agoAdd ALWAYS() to conditionals associated with SHM locking that are always true.
drh [Fri, 6 Nov 2020 16:48:55 +0000 (16:48 +0000)] 
Add ALWAYS() to conditionals associated with SHM locking that are always true.

FossilOrigin-Name: b599e89076d60afede7d2b3503b9338ca863d0c2d25799afe4080a6186386ea9

4 years agoSuppress errors associated with TEMP triggers that reference objects in
drh [Thu, 5 Nov 2020 19:13:44 +0000 (19:13 +0000)] 
Suppress errors associated with TEMP triggers that reference objects in
non-TEMP databases.  This is a continuation of the fix for ticket #3810
shown in check-in [ba1afc040171810d]
from [/timeline?c=trunk:200908061743|2009-08-06], based on a bug report in
[forum:/forumpost/157dc791df|forum post 157dc791df]

FossilOrigin-Name: 991ca9b26bacd8f6b64498057fe28f2068466a220f372fd365b6685f583f0e92

4 years agoRemove unused variable from speedtest1.c
drh [Thu, 5 Nov 2020 14:50:21 +0000 (14:50 +0000)] 
Remove unused variable from speedtest1.c

FossilOrigin-Name: c0a18565e614021b74646de7efd11d3d46894ef9132fb26787ab0269dc6a647c

4 years agoFix an another OSS-Fuzz discovered assertion fault due to ALTER TABLE and
drh [Mon, 2 Nov 2020 00:40:05 +0000 (00:40 +0000)] 
Fix an another OSS-Fuzz discovered assertion fault due to ALTER TABLE and
strange triggers.

FossilOrigin-Name: 6646d7898ca1d2f71ec906d9613fbfc5c59c6cf05f053529e6e32ab826d1cb78

4 years agoAdd the -tabs command-line option to the CLI.
drh [Sat, 31 Oct 2020 18:58:37 +0000 (18:58 +0000)] 
Add the -tabs command-line option to the CLI.

FossilOrigin-Name: 7d01e84dc49074e6364267eea9fd20d46a457d2498121a0f218fbf482692392d

4 years agoUpdate the ALTER TABLE command to correctly handle UPDATE ... FROM statements within...
dan [Sat, 31 Oct 2020 16:33:01 +0000 (16:33 +0000)] 
Update the ALTER TABLE command to correctly handle UPDATE ... FROM statements within trigger programs.

FossilOrigin-Name: 3e6af890406b58da1c4aebec4d483be7ab0fdb589ef7a4c4e987d6bde18d6b97

4 years agoAlways create a statement journal when using the OP_ParseSchema opcode,
drh [Mon, 26 Oct 2020 18:14:12 +0000 (18:14 +0000)] 
Always create a statement journal when using the OP_ParseSchema opcode,
as you never know when it might fail.  See the discussion on
[forum:/forumpost/daa2c728cc|forum post daa2c728cc].

FossilOrigin-Name: aa512f72cf5adfece6299db17bd122aeff0cdee2a25f83f60e2ebb05e99c9591

4 years agoEnsure that the table argument passed to Tcl_GetIndexFromObjStruct() in the sessions...
dan [Mon, 26 Oct 2020 16:22:31 +0000 (16:22 +0000)] 
Ensure that the table argument passed to Tcl_GetIndexFromObjStruct() in the sessions module test code is declared "static".

FossilOrigin-Name: 80eba105d6d1b49ba8ca2ad4e14ddec2de0bdc2f6686c2f8a1c1d24fc1fe846f

4 years agoPrevent fts5 tokenizer unicode61 from considering '\0' to be a token characters,...
dan [Mon, 26 Oct 2020 13:24:36 +0000 (13:24 +0000)] 
Prevent fts5 tokenizer unicode61 from considering '\0' to be a token characters, even if other characters of class "Cc" are.

FossilOrigin-Name: b7b7bde9b7a03665e3691c6d51118965f216d2dfb1617f138b9f9e60e418ed2f

4 years agoMinor tweaks to query planning weights so that when STAT4 is enabled
drh [Thu, 22 Oct 2020 18:50:30 +0000 (18:50 +0000)] 
Minor tweaks to query planning weights so that when STAT4 is enabled
and functioning, a full table scan is more likely to be selected if
that seems like the fastest solution.  Only do this when STAT4 info
is available because an error has a large potential downside.

FossilOrigin-Name: 0e7e113d9f2c929c1f8a85e2cfad8e2e60f0e8770212b5e5320fb2a2c42911f8

4 years agoTest case updates. avoid-bad-indexes
drh [Thu, 22 Oct 2020 18:16:17 +0000 (18:16 +0000)] 
Test case updates.

FossilOrigin-Name: 27c681c9c6672ad7098d8ff2c41e76d3e9e55866b6327ed85e73f63bd623ceed

4 years agoSometimes it makes sense to do a full table scan rather than try to use
drh [Thu, 22 Oct 2020 15:47:48 +0000 (15:47 +0000)] 
Sometimes it makes sense to do a full table scan rather than try to use
an index when most of the rows will be selected.  This branch is trying to
tune the query planner to make that happen more often.

FossilOrigin-Name: 0f42099ad65855c94af8472f3a6fddac7fc2a82e8fdfcc06a298eb6683a28688

4 years agoFix the sqlite3_hard_heap_limit() so that it works with sqlite3_realloc64()
drh [Tue, 20 Oct 2020 14:40:53 +0000 (14:40 +0000)] 
Fix the sqlite3_hard_heap_limit() so that it works with sqlite3_realloc64()
in addition to sqlite3_malloc64().  Improvements to OOM processing and
debugging aids in the fuzzcheck utility.

FossilOrigin-Name: 602d7369166d406a26834aa47d71d565a17d377d32e41f308821a50b41f91896

4 years agoFix an assert() inside of debug-only code that can fail following an OOM.
drh [Tue, 20 Oct 2020 12:37:51 +0000 (12:37 +0000)] 
Fix an assert() inside of debug-only code that can fail following an OOM.

FossilOrigin-Name: 79da254f41a0d7d5fdc57f0cc40b3560bfcf7f79eed24a9fada1b6b4ca3adb5a

4 years agoFix an incorrect table ref-count in the new recursive CTE logic that might
drh [Mon, 19 Oct 2020 20:49:54 +0000 (20:49 +0000)] 
Fix an incorrect table ref-count in the new recursive CTE logic that might
result in a reference to freed memory following a syntax error.

FossilOrigin-Name: 75a0288871ccb2a69a636cbb328fe19045a0d0ef96a193ecd118b9a196784d2d

4 years agoEnhance recursive common table expressions to support two or more
drh [Mon, 19 Oct 2020 12:35:08 +0000 (12:35 +0000)] 
Enhance recursive common table expressions to support two or more
recursive terms.

FossilOrigin-Name: 77e64647ec429c6e0d884abbd00dabebe738f89544a4984d6fd7a702b928ccfd

4 years agoNew test cases for recursive CTEs with multiple recursive terms. cte-enhancement
drh [Mon, 19 Oct 2020 01:44:43 +0000 (01:44 +0000)] 
New test cases for recursive CTEs with multiple recursive terms.

FossilOrigin-Name: cd5182bd6f5969ba0812275f471224908296960358013327cebbe0c52b820f04

4 years agoAllow multiple recursive terms in the compound SELECT of a recursive CTE.
drh [Mon, 19 Oct 2020 01:23:48 +0000 (01:23 +0000)] 
Allow multiple recursive terms in the compound SELECT of a recursive CTE.
This facilitates writing a query to find find the connected components of
an undirected graph.

FossilOrigin-Name: 5481fa8c79c34f434e99ab633ff3d0942a309a74fb0cf38e3d3617b51d5d21dd

4 years agoFix harmless compiler warnings.
mistachkin [Sun, 18 Oct 2020 18:35:34 +0000 (18:35 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: 7f8802bb7be61fdf7c7a591945d533d848bc46d2989f7739dd9ad89e1b6a9c65

4 years agoFix the SQLITE_DESERIALIZE_FREEONCLOSE flag so that it works as it is
drh [Sat, 17 Oct 2020 22:13:16 +0000 (22:13 +0000)] 
Fix the SQLITE_DESERIALIZE_FREEONCLOSE flag so that it works as it is
documented to work.
See [forum:/forumpost/ba1dff667a|forum post ba1dff667a]

FossilOrigin-Name: d6fac8a1d3efeb2c4f03dae437b5b314765c93770a70603803a8039291dbcabb

4 years agoFix an incorrect printf() in debugging logic in where.c.
drh [Sat, 17 Oct 2020 19:09:04 +0000 (19:09 +0000)] 
Fix an incorrect printf() in debugging logic in where.c.
Problem reported [forum:/info/80a9c47769772207|by forum post 80a9c47769772207].

FossilOrigin-Name: 883da4dadc88809192e4ed2f753f8883471fb43aa330bc58b017c66e1acedc6c

4 years agoMinor fixes to the cksumvfs documentation in the header comment of the source
drh [Thu, 15 Oct 2020 17:59:38 +0000 (17:59 +0000)] 
Minor fixes to the cksumvfs documentation in the header comment of the source
file.  Enhance speedtest1.c so that it can more easily do performance
comparisons of cksumvfs.

FossilOrigin-Name: ed3bb818f58b75c087f2875331ec944397b6c61a5b14d8af4b9ec6f376bd1872

4 years agoThe windows VFS accepts query parameter "exclusive=true" to cause it to
drh [Thu, 15 Oct 2020 14:37:27 +0000 (14:37 +0000)] 
The windows VFS accepts query parameter "exclusive=true" to cause it to
take a mandatory file lock, preventing other applications from even
reading the file.

FossilOrigin-Name: 05b573fdb27abec7d75aa1375325d45043cfd674f5b346fb341f001d7e04d160