Commit Graph

22435 Commits

Author SHA1 Message Date
dan
b9ceb833f7 Ensure that fts5 function matchinfo() is registered before running tests that use it in fts5corrupt3.test.
FossilOrigin-Name: 932e05e093192991589e70c2cbcc8a57fb3dcc6df1c2673962bfd06ba5cfdd97
2020-12-04 16:49:25 +00:00
dan
ee8221859b Fix a test script problem in walvfs.test.
FossilOrigin-Name: 4c5076fbe42cc6447c47bfc202501f945f78bd716cbe8e33599c67b7d0956611
2020-12-04 16:26:25 +00:00
drh
7b0ab21016 Fix an incorrect datatype no the sqlite3WhereTrace variable in test1.c.
FossilOrigin-Name: 4e6dab30f6d6795ecec9d8c4489fa4d210a3002715ad89812d65a1a846c164b9
2020-12-04 16:25:59 +00:00
drh
0a3e80b051 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
2020-12-04 16:09:27 +00:00
drh
fda8e49207 Further changes to the trace variables to try to eliminate (harmless) compiler
warnings in all configurations.

FossilOrigin-Name: 3a4c98b989964e3e366fe9519e9b5ed935e893d5b69d92bc0388a14c7e7938e6
2020-12-04 16:04:45 +00:00
drh
c0622a4d03 Alternative implementation of ".selecttrace" and ".wheretrace" that uses
a test-control rather than global variables.

FossilOrigin-Name: d36d6f2923a2393c751c0ac7634433453be20df7567fd914e57cbb1ae15f68b2
2020-12-04 01:17:57 +00:00
dan
3190b88e75 When merging prefix lists in fts5, use 16-way merges instead of 2-way merges. This faster.
FossilOrigin-Name: 026a93508ec392ca5cd2578ae9eab64974f58beccda088e10d4cc951f237632f
2020-12-03 21:22:37 +00:00
drh
1de03abb03 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
2020-12-03 19:25:06 +00:00
drh
0b1e70c4ce Enhance the generate_series() table-valued function to support negative
step values.

FossilOrigin-Name: 9b60fc48706bb77b2d4fe27a7b5834a6dc229b4051a9285032da578e4f2849e6
2020-12-03 14:21:26 +00:00
mistachkin
4338000d47 Prevent potential segfault in the sqlite-expert idxPopulateStat1 context cleanup code.
FossilOrigin-Name: c24f13448b5a55f45b4d4786a878fa73fe3395b5724f3bc2eea22e5e2b074353
2020-12-02 20:07:49 +00:00
dan
64f1ef6abd 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
2020-12-02 19:08:15 +00:00
drh
f30bbcec90 Fix the ".open" command in the CLI so that it accepts command-line options
both before and after the filename.

FossilOrigin-Name: d330bf0c02e67f70f49496e4b1e484bb4e876622becc6a062b2aefbd585d0117
2020-12-02 18:27:48 +00:00
dan
0fa433b40c Improve performance for fts5 column filters that filter for more than one column. e.g. "{col1 col2 col3}:phrase".
FossilOrigin-Name: d8de2f236d43a88fac7550a0451951dd5a945eb304e32f82e662479cea7c2684
2020-12-02 16:23:05 +00:00
drh
bb497fe36d 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
2020-12-02 02:58:05 +00:00
drh
636f505864 Increase the version number to 3.35.0 to begin the next development cycle.
FossilOrigin-Name: edbabaa30823db7c7d169cb93722b5f74bc711359984fb7e139ca9d10fe7dae4
2020-12-02 00:22:09 +00:00
drh
c52a1e9f35 Slightly faster tokenization of non-keyword identifiers.
FossilOrigin-Name: 55fa22bd403cc8f0973efea898a7cfa3a32b57c7e2a7a4c30c3f2c72d5396f07
2020-12-02 00:20:00 +00:00
drh
f461bab265 Add the --lookaside SIZE COUNT command-line option to the dbfuzz2 testing tool.
FossilOrigin-Name: 2466960c0ba02ef9c325e9a5f8603db518e7529547f614c225fef430421e1643
2020-12-01 23:18:13 +00:00
drh
384f5c26f4 Version 3.34.0
FossilOrigin-Name: a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b
2020-12-01 16:14:00 +00:00
dan
9f4fb42730 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
2020-11-30 18:52:08 +00:00
dan
aeb4e6eebd 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
2020-11-30 18:43:40 +00:00
drh
56a5747e63 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
2020-11-30 14:20:17 +00:00
drh
d1032f952c 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
2020-11-27 20:56:16 +00:00
dan
cad760d16e Fix a compiler warning in fts5_aux.c.
FossilOrigin-Name: 8edb983bc87898eff2cd2e7e672a32a47c71b2be9d818513d339e95560d45b2b
2020-11-27 19:40:13 +00:00
dan
6d19bf9460 Add missing cast to fts5 bm25() code.
FossilOrigin-Name: 6ff9673847c0b4174d9435e93d19af0ee7406b1a12edeb6edec98697e1646824
2020-11-27 16:15:55 +00:00
dan
3181706895 Remove a redundant "if( rc==SQLITE_OK )" from the fts5 bm25() code.
FossilOrigin-Name: d85f4f27f58adcc75fc7d59e63af95b2a338052d8748a11f22ec1e48d1aff4cc
2020-11-27 16:08:15 +00:00
dan
66efc393c5 Move an "if( rc==SQLITE_OK )" to outside a loop body in the fts5 bm25() code.
FossilOrigin-Name: 14a4dcf3474566d072007a37d214c892397c21dd3b7f8b55ad0e5edfb7130dd6
2020-11-27 16:05:31 +00:00
dan
1c5b23f170 Fix a case in the FTS5 integrity check where a corrupt database could cause a buffer overread.
FossilOrigin-Name: a32b4f650d2d543bd2773cbc8655c1679a20b35ac9ec4d08c7754ddf6d972acb
2020-11-27 15:28:26 +00:00
dan
ec8962869a Update mkunicode.tcl to match the change erroneously made to machine generated file fts5_unicode2.c in [b7b7bde9].
FossilOrigin-Name: 326d579d777fdede6bc64f9525248767f4730de4e50260b0387e614a9d006416
2020-11-26 20:13:54 +00:00
drh
68b4034450 Update a requirement mark in the e_expr.test script.
FossilOrigin-Name: bb174a074b5833181900d396edda955254ea1768750a0ab3b6d714530b1fe13f
2020-11-25 18:44:20 +00:00
drh
d36f588f31 Fix harmless compiler warnings about unused function parameters.
FossilOrigin-Name: 25d067c270966d9506db8bedf280883e32b69050b14bdbbeda4bb2d9a362619c
2020-11-25 16:28:04 +00:00
drh
3ef2cb5991 Fix a potential NULL pointer dereference in the geopoly_overlap() routine
of the GeoPoly extension.

FossilOrigin-Name: b5665712e667a20d42a2e892d9d540f4273609eabd56f8178e1d5664280821f3
2020-11-25 15:29:08 +00:00
drh
f82d78e9c2 Fix the shell1.test test script so that it works on windows.
FossilOrigin-Name: 9bd15b07e58b1811c2a368ec76059ac683a2c35b163ef4bba01ccb8b7ca7288d
2020-11-25 14:50:42 +00:00
drh
b7c46aa8c9 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
2020-11-25 13:59:47 +00:00
drh
f862b55a56 Fix a typo in the sqlite3_txn_state() documentation.
FossilOrigin-Name: 5b4325295b2f17b7a4eaa2d3a30d06a24801992b3aa17c7d57e015f9f395fb95
2020-11-24 23:40:48 +00:00
drh
4989a530a1 Add the new sqlite3_txn_state() interface to the set of routines accessible
by run-time loadables extensions.

FossilOrigin-Name: db25f1dc8eb8b8bd45912e9b457d4cc32687bc4f709ce1878e9b4ccedbb18af9
2020-11-24 21:19:23 +00:00
drh
a7fc1686e4 Fix a harmless typo in a comment.
FossilOrigin-Name: b2a201f1b5dc2fc94b360df4807c108fac47db2399edd8763efbdd66b71ffe5f
2020-11-24 19:55:49 +00:00
dan
f5c3a75b63 Fix a bug in OOM handling code introduced by [6a28713d].
FossilOrigin-Name: 8a786ce99491401dd7660e54f1a1ba3b2300cecbe180b1a31e549ff5f5b77bdc
2020-11-24 17:55:34 +00:00
dan
2e3cb1382f 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
2020-11-24 16:44:09 +00:00
drh
ef5b2d27b7 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
2020-11-24 13:14:15 +00:00
drh
de9873bb0a Syntactic changes to work around a bug in gcov 9.3.0. No changes to the
generated code for release builds.

FossilOrigin-Name: 4f1573b146193e5d552981a9d1d11e50da4da4a843f790e4af1cf0cc19a0b020
2020-11-23 21:05:29 +00:00
drh
d46beb06aa In os_unix.c, put ALWAYS() on unreachable branches associated with pathname
normalization.

FossilOrigin-Name: b45a08e3c7edfa76b699d3e29f28daa5bd08039668ec57121e4e85edf36150f1
2020-11-23 17:36:06 +00:00
dan
39acaec16c Fix a test script problem causing crash8.test to fail when run with leak-sanitizer.
FossilOrigin-Name: 2c437f7a2c87129d00c71fa569315b68e0ba9514041d93503350c9ae9f080f17
2020-11-23 15:30:16 +00:00
drh
1335ec7df7 Allow "substring()" as an alias for "substr()" for compatibility with other
SQL engines.

FossilOrigin-Name: aa2ee5754c9f8378c4d490ca756a6415042904477727f0d86e9c0190b5e8b275
2020-11-23 14:50:43 +00:00
dan
6a5e21149b Add file doc/vdbesort-memory.md, containing notes on the way vdbesort.c uses heap memory.
FossilOrigin-Name: 07f53899a929cce93f17c0332819610c9517c7e54e00092af20efd746cf84438
2020-11-20 14:16:41 +00:00
drh
6fc74a4454 The xFullPathname method of the unix VFS now normalizes the filenames by
omitting surplus "/", "/./" and "/../" strings.

FossilOrigin-Name: c38dec6f52c01614c1bee8356daf0fcd9f708d029116e9bff51e06719a730dde
2020-11-19 21:12:08 +00:00
drh
e5dc4a2097 More test case changes so that shared-cache mode tests all work
with normalized database names.

FossilOrigin-Name: 6f0d5f0949130a4688319adf05d37c5ccd683ca9ad2dacb7ce433a5fe18ac3c3
2020-11-19 21:01:11 +00:00
drh
f4097026ef Fix the tkt3793 test case so that work even when filenames are normalized.
FossilOrigin-Name: e85d32ac6c82d39f5dc9b28f881d5d72f5e5a7e16df12c19315bfa8edea1b0b4
2020-11-19 20:07:24 +00:00
drh
5dc18e33ae 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
2020-11-19 19:43:46 +00:00
drh
02e4b7d7df 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
2020-11-18 23:44:41 +00:00
drh
f56a4bfcd1 Improvements to the mechanism that attempts to report SQLITE_CORRUPT if
pread() says that the underlying filesystem is corrupt.

FossilOrigin-Name: b887c7504e7edeba758f3c1203c6cc56eef499fe05e7e6c6d82939bf7d78c57f
2020-11-18 21:50:05 +00:00
dan
8ea11095c9 Update cksumvfs.c so that if SQLITE_AMALGAMATION is defined, SQLITE_CKSUMVFS_STATIC is implied.
FossilOrigin-Name: 184e9d782dfbad8011b5b0043b3fd8e5a369ed7076e37e14b301483ce5ffe5db
2020-11-18 20:55:01 +00:00
dan
c30b78f6f3 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
2020-11-18 18:36:43 +00:00
dan
8bb3961d40 Fix a problem causing sqlite3_carray_bind() to return an undefined value.
FossilOrigin-Name: 083203a549d3cf26991d8626b308ff1e9e44be6abb72ab3d38e5fd53c99aed7f
2020-11-18 14:30:53 +00:00
dan
5011bb8dd2 Update test code to fix a problem with SQLITE_OMIT_VIRTUAL_TABLE builds.
FossilOrigin-Name: 29c779a07bf6ede1ec2cdb4695d801a5c113ab4b12d6cd22bcee8d2adb06891e
2020-11-18 14:12:20 +00:00
drh
5a07d10fd1 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
2020-11-18 12:48:48 +00:00
drh
32881bebbe Claw back most of the performance lost in the previous commit.
FossilOrigin-Name: df8ce2675b070fcdc338918e7652a26ffc90439fe399ceac206fadf8a93a681f
2020-11-17 21:26:13 +00:00
dan
aff1a57f4d Fix trivial memory leaks in the shell and sqldiff programs.
FossilOrigin-Name: 272793e5edc47e431be77d589718a001f2696869e3e15f1371a1890645a995a7
2020-11-17 21:09:56 +00:00
dan
12c9994659 Fix test file busy2.test so that it works with the "inmemory_journal" permutation.
FossilOrigin-Name: b192fdddb63ac56fd6725032af110a069baac52347c0012c130bf34f3cbe69e4
2020-11-17 18:25:48 +00:00
drh
ea847f1b94 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
2020-11-17 14:41:37 +00:00
drh
7f42dcd901 Enhance the unix VFS so that it removes extra "/", "/./" and "/../" from
the database filename.

FossilOrigin-Name: 7ba89d3e5c68d970ed26c2ec6e6e34bae535c2cc0b22a022d20ac9ff4527b8ab
2020-11-16 18:45:21 +00:00
drh
ea2487200f 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
2020-11-14 20:03:34 +00:00
drh
b035b87ef8 Improved diagnostics output with ".wheretrace 0x800". No changes to
non-debug builds.

FossilOrigin-Name: 772ae83c61c87a9004a614d8ec120ba843286bff1edbd20b987fd592ced84d79
2020-11-12 18:16:01 +00:00
drh
75e6bbbeca Fix a typo in a comment. No changes to code.
FossilOrigin-Name: 572f1ed59d29e74f810c74ef9e72ebc94c2d3e04befc03a1f88034f04a9c60a8
2020-11-11 19:11:44 +00:00
drh
235667a858 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
2020-11-08 20:44:30 +00:00
drh
78043e891a Add ALWAYS() to conditionals associated with SHM locking that are always true.
FossilOrigin-Name: b599e89076d60afede7d2b3503b9338ca863d0c2d25799afe4080a6186386ea9
2020-11-06 16:48:55 +00:00
drh
4e451aad54 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
2020-11-05 19:13:44 +00:00
drh
114cb01796 Remove unused variable from speedtest1.c
FossilOrigin-Name: c0a18565e614021b74646de7efd11d3d46894ef9132fb26787ab0269dc6a647c
2020-11-05 14:50:21 +00:00
drh
6d5ab2a1d6 Fix an another OSS-Fuzz discovered assertion fault due to ALTER TABLE and
strange triggers.

FossilOrigin-Name: 6646d7898ca1d2f71ec906d9613fbfc5c59c6cf05f053529e6e32ab826d1cb78
2020-11-02 00:40:05 +00:00
drh
2fa7818571 Add the -tabs command-line option to the CLI.
FossilOrigin-Name: 7d01e84dc49074e6364267eea9fd20d46a457d2498121a0f218fbf482692392d
2020-10-31 18:58:37 +00:00
dan
7a39faecc2 Update the ALTER TABLE command to correctly handle UPDATE ... FROM statements within trigger programs.
FossilOrigin-Name: 3e6af890406b58da1c4aebec4d483be7ab0fdb589ef7a4c4e987d6bde18d6b97
2020-10-31 16:33:01 +00:00
drh
ed7974dee5 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
2020-10-26 18:14:12 +00:00
dan
19f7bd3b07 Ensure that the table argument passed to Tcl_GetIndexFromObjStruct() in the sessions module test code is declared "static".
FossilOrigin-Name: 80eba105d6d1b49ba8ca2ad4e14ddec2de0bdc2f6686c2f8a1c1d24fc1fe846f
2020-10-26 16:22:31 +00:00
dan
d1d43efa4f Prevent fts5 tokenizer unicode61 from considering '\0' to be a token characters, even if other characters of class "Cc" are.
FossilOrigin-Name: b7b7bde9b7a03665e3691c6d51118965f216d2dfb1617f138b9f9e60e418ed2f
2020-10-26 13:24:36 +00:00
drh
beb22d086b 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
2020-10-22 18:50:30 +00:00
drh
461ff3594b Test case updates.
FossilOrigin-Name: 27c681c9c6672ad7098d8ff2c41e76d3e9e55866b6327ed85e73f63bd623ceed
2020-10-22 18:16:17 +00:00
drh
403869680b 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
2020-10-22 15:47:48 +00:00
drh
672f07c642 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
2020-10-20 14:40:53 +00:00
drh
1a56fce614 Fix an assert() inside of debug-only code that can fail following an OOM.
FossilOrigin-Name: 79da254f41a0d7d5fdc57f0cc40b3560bfcf7f79eed24a9fada1b6b4ca3adb5a
2020-10-20 12:37:51 +00:00
drh
94d6f3f836 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
2020-10-19 20:49:54 +00:00
drh
787f6d418d Enhance recursive common table expressions to support two or more
recursive terms.

FossilOrigin-Name: 77e64647ec429c6e0d884abbd00dabebe738f89544a4984d6fd7a702b928ccfd
2020-10-19 12:35:08 +00:00
drh
07d7a8dca9 New test cases for recursive CTEs with multiple recursive terms.
FossilOrigin-Name: cd5182bd6f5969ba0812275f471224908296960358013327cebbe0c52b820f04
2020-10-19 01:44:43 +00:00
drh
340558540e 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
2020-10-19 01:23:48 +00:00
mistachkin
a00a016740 Fix harmless compiler warnings.
FossilOrigin-Name: 7f8802bb7be61fdf7c7a591945d533d848bc46d2989f7739dd9ad89e1b6a9c65
2020-10-18 18:35:34 +00:00
drh
ff01ee34c9 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
2020-10-17 22:13:16 +00:00
drh
e93986a93b Fix an incorrect printf() in debugging logic in where.c.
Problem reported [forum:/info/80a9c47769772207|by forum post 80a9c47769772207].

FossilOrigin-Name: 883da4dadc88809192e4ed2f753f8883471fb43aa330bc58b017c66e1acedc6c
2020-10-17 19:09:04 +00:00
drh
71cb422055 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
2020-10-15 17:59:38 +00:00
drh
f8c4c3a09f 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
2020-10-15 14:37:27 +00:00
mistachkin
d5157e01b8 Enhancements to TclKit batch tool for MSVC.
FossilOrigin-Name: 2a8a4552112be6e39e3475e9a8579582b5157086d3efd37971463c0e3958068d
2020-10-14 21:31:20 +00:00
mistachkin
05881886a6 Fix typo in a documentation comment.
FossilOrigin-Name: 462adc7d6b14de3862c2a3e57dba7efaf2ba9c104e1c127a5801a7b892059872
2020-10-14 21:30:56 +00:00
drh
7207be402d Enhanced documentation for sqlite3_vtab_nochange() to make it clear that
it is an optimization and that virtual table implementations should be
prepared for it to always return false.

FossilOrigin-Name: 3e2643619d122616663688533977d6c60d45a269b4e2bdc330fd3ee5d39f2e03
2020-10-14 15:46:29 +00:00
dan
f6b0464e36 Fix some fts5 problems with signed integer overflow causing segfaults in -ftrapv builds.
FossilOrigin-Name: 7e17c2f4b7dc9b563d0b4da949bb134dc7c4fc9c86ce03891432a884ca6409d5
2020-10-12 18:09:16 +00:00
drh
c6712647c6 Improved quoting of the table name argument for the ".import" command
of the CLI.  See [forum:34591fefbe|forum post 34591fefbe].

FossilOrigin-Name: ce97b56d63d6e03b909e049a0a62251d98c7bf643448193a28b42a5871899387
2020-10-12 17:57:29 +00:00
drh
c196219dd4 Add options --data-only and --nosys to the ".dump" command in the CLI.
FossilOrigin-Name: 57123b14a71027c21cb5eee089fcbc9330d07bf9091b01aecc4f9e3b9e4f7b09
2020-10-12 16:54:28 +00:00
dan
936a30598e Fix ALTER TABLE so that it can run even if the schema contains unknown collation sequences.
FossilOrigin-Name: bc4bb9433fed519386511796cce475d74100b8ed707cdbffd8cbdf683b0faf35
2020-10-12 15:27:50 +00:00
drh
bbb29ecfb4 Add the --nosys option to the .schema command in the CLI.
FossilOrigin-Name: b72ee694532c0c5d2285dd580154546eb592fd6892cad9ad7a49e98737adb974
2020-10-12 14:56:47 +00:00
dan
4d906f1b5a Fix UPDATE FROM statements on virtual tables that are declared WITHOUT ROWID.
FossilOrigin-Name: bcb0bc6a7b7006f07adb7266b1fecca39bf85a0adea6d78a341623a3546f2c2a
2020-10-12 14:29:11 +00:00
drh
1ca037f41e Fix BEGIN IMMEDIATE and BEGIN EXCLUSIVE so that they work even if one or
more of the database files in the connection are read-only.  Test cases
for this are in TH3.

FossilOrigin-Name: 2fa08c3963f008d4723c3f4f4496abcb6d4b575c85ba4a911a6aed5730b5948b
2020-10-12 13:24:00 +00:00
drh
0897c3c056 In the CSV extension, use SQLITE_TRANSIENT rather than SQLITE_STATIC on
return values that can in fact change.

FossilOrigin-Name: 54b54f02c66c5aeaa3504c52a04614e2fb4d7260da8367840d5ea5a71cdc2fda
2020-10-07 11:24:45 +00:00
dan
f46be6a1b9 Allow fts5 trigram tables created with detail=column or detail=none to optimize LIKE and GLOB queries. Allow case-insensitive tables to optimize GLOB as well as LIKE.
FossilOrigin-Name: 64782463be62b72b5cd0bfaa7c9b69aa487d807c5fe0e65a272080b7739fd21b
2020-10-05 16:41:56 +00:00
dan
a344ad47f3 Do not apply affinities when creating entries for automatic indexes on views. Fix for [95302bdb].
FossilOrigin-Name: df12f097224ebc9473d9e2a8933bd7efed6490d09af2c012c9b59a7892369b7f
2020-10-03 19:16:36 +00:00
dan
12a6a1eaf9 Fix a segfault caused by running "column LIKE NULL" against an fts5 table using the trigram tokenizer. Fix for [e33ee62575fc22].
FossilOrigin-Name: 6e72a08de764077f2bba6f7e3b99ea29001941671a971f2ccf7ceeb9c682fb1a
2020-10-03 17:06:02 +00:00
dan
95dca8d0cf FTS5 does not handle tokens that contain embedded nul characters. Prevent the trigram tokenizer from returning such tokens. Fix for [2ba5930b2].
FossilOrigin-Name: b1d048748c054575425a4bebf0c5d09962f9329d5ce6a978cf54e508b238584c
2020-10-03 14:36:06 +00:00
dan
7093a3be03 Fix some test code so that testfixture can build with SQLITE_OMIT_WAL defined.
FossilOrigin-Name: dd009cd7aec3598e930806907601f4f0f9b0021ea99fa6c5e29e88f1246066ed
2020-10-02 15:15:18 +00:00
drh
7d14ffe4e1 Additional corner-case fixes for the in-scan-vs-index or OP_SeekScan
optimization.

FossilOrigin-Name: ad5ab24ebd557e7af1d92ab3fbcb3747c04da5ad4ed779fb6391dc94042687dd
2020-10-02 13:48:57 +00:00
drh
64208b50ce Remove an incorrect assert() from the OP_SeekScan opcode.
FossilOrigin-Name: c0400f8c0bcb85ba39004feff753eae2f8e82065539e52b5788febd7644c417b
2020-10-02 12:49:06 +00:00
drh
9bb612f2c8 Fix a faulty assert() statement. Add new test cases.
FossilOrigin-Name: 80ecdb3da4558bb08ee3ec6edbde906ad5b3b8182e672b5ba0d5dfa8041cee0a
2020-10-02 12:42:51 +00:00
drh
04e70ce07d For the OP_SeekScan optimization, the OP_IdxGT does not necessarily come
right after the OP_SeekGE.   So use the P2 operand of OP_SeekScan to point
to the first instruction after OP_IdxGT.  Problem found by dbsqlfuzz.

FossilOrigin-Name: 091d71939411bf2079098f09ddc0525f11f380119fd27114e2b3eec9a8ac0db4
2020-10-02 11:55:07 +00:00
drh
4ad1a1c74c Disable the OP_SeekScan opcode of the in-scan-vs-index optimization when
in PRAGMA reverse_unordered_selects mode, as the OP_SeekScan only works
with forwards scans.  Thanks to OSSFuzz for pointing out the problem to
us.

FossilOrigin-Name: c75c3a3b756635bfdab44e4b56a337e4a88af3a8803cd3e9a67abf3d0d3450dc
2020-10-02 02:02:18 +00:00
dan
d7d406e81c Add experimental "trigram" tokenizer to fts5.
FossilOrigin-Name: c4e8ec7907de7cb9e610ef9f4930caf5c046618151fb4f61d5716b9fa3f31423
2020-10-01 17:24:36 +00:00
dan
a22c1c84cc Add the -trigram option to the fts5txt2db.tcl script.
FossilOrigin-Name: a394dd260252e7b7dcbc90fd321dfd40d9375f0598ea52b01001c568cbdbafce
2020-10-01 17:15:12 +00:00
dan
ccf578d435 Add tests for the trigram tokenizer. Fix minor issues.
FossilOrigin-Name: 897ced99b44085012aa44d3264940dcbd4c77b295a894a1b58fb2c03a0f7fee8
2020-10-01 16:10:22 +00:00
drh
deaa61072d Fix the OP_SeekScan opcode so that its variable names do not cause problems
for the test/vdbe-compress.tcl script.

FossilOrigin-Name: 7a78274a072324b94d6f79e5b7a198b2fa9321ff5d6a528b51f57d3ee95c765b
2020-10-01 15:46:21 +00:00
drh
644f43c0f7 Remove a debugging printf() accidentally left in the previous check-in.
FossilOrigin-Name: e9d1efa597fb073dc4bc4286e03059a350ed05d3e6476cd3247e6cde626f458b
2020-10-01 14:38:39 +00:00
drh
67306cb3b4 The IN-early-out optimization does not work for virtual tables. Do
not try to use it there.  Fix for ticket [2d5a3163563d559f].  Test
cases in TH3.

FossilOrigin-Name: dbec6910d9648f4907373c818a5cb347a2e487784208751ccecfacca752ff99d
2020-10-01 14:36:15 +00:00
dan
33a99fad08 Add experimental unicode-aware trigram tokenizer to fts5. And support for LIKE and GLOB optimizations for fts5 tables that use said tokenizer.
FossilOrigin-Name: 0d7810c1aea93c0a3da1ccc4911dbce8a1b6e1dbfe1ab7e800289a0c783b5985
2020-09-30 20:35:37 +00:00
drh
fad4dd0fd1 Improved query optimization for multi-column indexes where the second or
later columns are constrained by an IN operator and the earlier index columns
limit the search to a small number of rows.  Use the new OP_SeekScan opcode
which does scanning of the relevant range of the index but gives up and
falls back to doing a seek if the number of rows scanned grows to large,
in order to guard against pathological cases where the estimated number
of rows to be scanned is far too small.

FossilOrigin-Name: 4a43430fd23f88352c33b29c4c105b72f6dc821f94bf362040c41a1648c402e5
2020-09-30 18:06:51 +00:00
drh
4f65b3bbfb For the OP_SeekScan opcode, adjust the number of steps run before giving
up based on the estimated number of comparisons needed to perform a seek.

FossilOrigin-Name: dc4172e6b8e1f62dc7329a3adb2223f290bc4c8055c265e88182ef432f4bcf10
2020-09-30 18:03:22 +00:00
drh
395a60dad4 Back out the incorrect optimization of check-in [e51ecadcbdef5ce6] as
ticket [5c4e7aa793943803] reports a case where the optimization does not
work.

FossilOrigin-Name: 7395e96b8cc370c8ac2657fb805915b0992a15d80f8bf256d277b423fec64675
2020-09-30 17:32:22 +00:00
drh
af3711536b In the query flattener when substituting expression Y in place of expression X,
if X is marked has having come from an ON or USING clause of a LEFT JOIN, then
be sure that all subexpressions of Y, not just the root node of Y, are
similarly marked.  Otherwise, if Y is an AND operator, it will be split up
during WHERE clause analysis and the subexpressions will not get the special
treatment needed by LEFT JOIN ON/USING clauses.
Fix for ticket [66e4b0e271c47145].

FossilOrigin-Name: 69f9eb7343a416c5ab426c8e1b9f0ae576544b4ccc5d87f5481c8ff884f696e1
2020-09-30 15:36:03 +00:00
shearer
1e6c58dee2 Better understanding of savepoint code
FossilOrigin-Name: ce6d8d621505f25e4fd43e7cf27445e1a2ddd58d79108d63499c2ae30cc9f610
2020-09-30 09:17:53 +00:00
drh
a957e22fa4 Add an sqlite3FaultSim() call to btreeNext() to make it easier to
simulate I/O errors in calls to sqlite3BtreeNext(), and in OP_SeekScan.

FossilOrigin-Name: 29cca775d3f5411624f0a8d55d34a038a24f1009d25b097315adb64e70c4b299
2020-09-30 00:48:45 +00:00
drh
f287d00108 In the OP_SeekScan opcode, changes to pOp must occur after the call
to VdbeBranchTaken() so that the VdbeBranchTaken() attributes the branch
to the correct opcode.

FossilOrigin-Name: 61fbe7aa7cc0e8fe3e6b1c5aec277183d8cd7c86b1e835c38e0b37a9b8063343
2020-09-30 00:10:22 +00:00
drh
a54e1b1fc8 The OP_SeekScan opcode is a no-op if the cursor is not pointing to a valid
row upon entry.

FossilOrigin-Name: 4afc96b5fe80bd192a23e0230edc207e641931c3bf48296b1a385c786386f1b7
2020-09-29 23:52:25 +00:00
drh
0b2949c36e Coverage testing of the OP_SeekScan opcode. Fix a problem that comes up when
OP_SeekScan reaches the end of the table.

FossilOrigin-Name: 9e57e758a6a33f54d28a546b4eebfb5cfacef30dc4e0207e43bb9d2c06fc3439
2020-09-29 20:22:19 +00:00
drh
dfbaae7572 Improved comments on the new OP_SeekScan opcode.
FossilOrigin-Name: 6110fdd5bb7b4ae5c065404c802ae726362ef084966b73cffe58c4bfb98689d2
2020-09-29 17:29:11 +00:00
drh
c40076a8cf Improved performance by manually in-lining the sqlite3VdbeIdxKeyCompare()
routine for the OP_IdxGT opcode and its kin.

FossilOrigin-Name: 2206a2c848a122ee220c89427f9be0460cba0706f58852139d7b37184ce29a29
2020-09-29 16:05:09 +00:00
drh
46f0f4e56d Typo fix to repair the early-out optimization. Also avoid unnecessary
OP_SeekHit opcodes.

FossilOrigin-Name: 8fd7d8dfcd515aa6b65d6eb27b033d3b3a31db467b9100cc13c62bc60113019e
2020-09-29 15:32:54 +00:00
drh
f761d937c2 The OP_SeekScan opcode works, but using it requires disabling the
IN-earlyout optimization because the OP_IfNoHope opcode might move the
cursor.

FossilOrigin-Name: f3c36b840c9a29c0add28039db216f4207a308e5057fc76e3f0004024a8267ac
2020-09-29 01:48:46 +00:00
drh
68cf0ace3d Revisiting the IN-scan optimization to try to fix it for the corner case
where the statistics deceive the query planner into using a scan when
an indexed lookup would be better.  This check-in changes the code
generation to do the IN-scan using a new OP_SeekScan opcode.  That new
opcode is designed to abandon the scan and fall back to a seek if
it doesn't find a match quickly enough.  For this work-in-progress check-in, 
OP_SeekScan is still a no-op and OP_SeekGE still ends up doing all the work.

FossilOrigin-Name: d720b6981eeb0ffdb14494ca63eca298ee724ae4ad4863c7c7cbfdad7fa52519
2020-09-28 19:51:54 +00:00
drh
75fa266341 Small performance improvement and size reduction by reducing the size of
the WhereTerm object.

FossilOrigin-Name: 43f7ddad800acf40917c5cc3d926640dbec17c34d5f1cbbb74bd80f44eeed0a5
2020-09-28 15:49:43 +00:00
drh
f573b4fb94 Avoid the possibility of integer overflow on the --pagecache option to
the CLI. See [forum:10a2892377|forum post 10a2892377]

FossilOrigin-Name: d3d13df31a97648f952beb2e1a783f947a80ec843227985ad9ebd14452d2f654
2020-09-28 13:34:05 +00:00
mistachkin
273ee15121 Fix harmless compiler warning seen with MSVC.
FossilOrigin-Name: 4591ee03d7a1ef3f0f6ad0629493fdb7a1c0ddb3277a9e87aa244cb0ca770593
2020-09-21 20:18:44 +00:00
dan
7548ab20e6 In fts5 integrity checks, do not compare the contents of the index against an external content table unless specifically requested.
FossilOrigin-Name: 782163693f37aeb65209bebbaeb6659a36881b8c4b4bec778b366658488bf966
2020-09-21 14:53:21 +00:00
drh
9ca41fbfa9 Remove a new assert() that the compiler finds is always true at compile-time,
to avoid a compiler warning.

FossilOrigin-Name: 8bbaee238593741da107b92b254cb5f0cf8b6bcc760bf2b25d20e46c8edee2a9
2020-09-20 13:33:28 +00:00
drh
79d9af960b Attempt to silence harmless static analyzer warnings in Lemon and in the
Lemon-generated parser.

FossilOrigin-Name: de8ce22a46c90afa5475cd24c28b7a82b26410dc72d662af2f9d9e5e528e0eec
2020-09-20 12:10:28 +00:00
dan
68cffa65fb Fix a typo in the documentation comment for sqlite3_preupdate_hook().
FossilOrigin-Name: 4542d194e2fef5e21e1c3679914bd9e21fab31cfb111cf640524fb3514a8afa3
2020-09-17 21:11:25 +00:00
dan
39c7125a97 Fix a problem in sqlite-expert causing it to ignore equality constraints on the second or subsequent columns of a multi-column PRIMARY KEY.
FossilOrigin-Name: c666c85a433fbc83edef4dbfb0399672e570f5d7979ab61cb39ff5488595d822
2020-09-17 17:01:16 +00:00
dan
f2e151aeab Fix a problem in fts5 causing the in-memory hash table to be flushed more often than necessary.
FossilOrigin-Name: 9a55601d072bcd1ac0f6f1633216c7c8b3ff3e037451e2cfd285cbe19b60b9fc
2020-09-17 15:16:50 +00:00
dan
3acd3fb9d8 Fix a "jump depends on unitialized value" valgrind/asan error in fts5.
FossilOrigin-Name: 66f94d623c16b4527e42f0519e32ec78eaf9ee6fd61ee7d0eb657cc59a8f7d68
2020-09-17 14:16:02 +00:00
drh
f2fa084cf1 Earlier detection of corruption in the rtreecheck() SQL function to prevent
a (harmless) read of an uninitialized value.

FossilOrigin-Name: e2074b24788149562b15022ccd2784d6649f08ebc41410e3bfb2401baf0892e2
2020-09-17 11:56:04 +00:00
drh
bc2e95140b Prevent use-after-free of the u.vtab.idxStr string following an OOM
while generating the OP_VFilter opcode.

FossilOrigin-Name: 751fe4edb2d4602e652523c2759de3f4fffd29d5c66cae68caf45b30fd8b750a
2020-09-17 11:32:14 +00:00
drh
f1ea425560 DISTINCT may not be ignored inside a UNION ALL common table expression.
Fix for ticket [c51489c3b8f919c5]

FossilOrigin-Name: 7d2b590d3abd66a7e6ae9046198eb669e0fd2f223f7691281e9ad795a12b8903
2020-09-17 00:46:09 +00:00
drh
d96e3821e4 Fix a pair of assert()s in "PRAGMA foreign_key_check" that might have given
a false-positive following an OOM.

FossilOrigin-Name: 9ea3039b538ffd0f348c8fbc9452af1fbf899a1f668af9a2404bdd0f8dd21351
2020-09-16 19:48:23 +00:00
drh
18ef40e563 Fix harmless compiler warnings in Lemon.
FossilOrigin-Name: 6c94ba4b1c16b676978808dcb24f63c2f22915af5dcfe9f635c037011affcf4b
2020-09-16 16:55:56 +00:00
dan
b5a69238b4 Fix a buffer overread found by OSSFuzz that could occur if a WITHOUT ROWID table with many columns was NATURAL JOINed against itself.
FossilOrigin-Name: 3d35fa0be866213274fc09250225b345f6b08a9b4ec373d53d95e627e24512be
2020-09-15 20:48:30 +00:00
drh
ddcfe92105 Do not invoke usleep() for more than 999999 microseconds.
FossilOrigin-Name: 1f5ed852f25515bbc0a7aaf236fdef40fa7e31805eee1249277fde4e68f95130
2020-09-15 12:29:35 +00:00
dan
86f477edaa Catch fts5 index corruption caused by issuing 'delete' commands with incorrect data earlier in some cases. Also fix a couple of test script problems.
FossilOrigin-Name: b79f19edfd33c2a75f936c352668e14e81f35acf4f07edc27a21f941a7304b38
2020-09-11 15:01:49 +00:00
drh
94acc2ef42 Try again to fix the typo in the sqlite3_txn_state() documentation.
FossilOrigin-Name: 6d1ab0403c2855b595f5d294305f41f56a7a93503f2a58d1b1d12431d480704e
2020-09-10 15:09:11 +00:00
drh
4fb8452875 Fix typo in the documentation for the new sqlite3_txn_state() interface.
FossilOrigin-Name: 23f7d01758cbcf22bd34e78fb8284c7af18f3059a03c4ff6ab3e556ca11fce19
2020-09-10 14:54:57 +00:00
drh
786142a994 If an amalgamation is created using SQLITE_ENABLE_UPDATE_DELETE_LIMIT,
ensure that it can still be compiled without that option by setting the
SQLITE_UDL_CAPABLE_PARSER flag in the preamble.

FossilOrigin-Name: 5b905d7d7714d1d2c433ff58f5d6917d6d27302d44ca347aa740e768f1354b16
2020-09-10 12:41:46 +00:00
dan
ebd2ecdda7 Fix another (harmless in practice) tsan error in shared-cache mode.
FossilOrigin-Name: 5a74fa3f0a64f462c8add9beae231a9bbdd19e54d07b54f08726cb1411fc8d3a
2020-09-07 11:14:27 +00:00
drh
8ab0809473 Remove an artifical limitation on the length of columns in the "box"
output mode of the command-line shell.

FossilOrigin-Name: 783fa887c9ed1a7d72c310df1dd9de91c016061b05fdeec87fbb2a7eb0b952ea
2020-09-06 17:40:38 +00:00
drh
2b75d3beb0 Fix a bug in Fossil that might cause it to crash if there is
a multi-terminal token with a space following the "|" separator.
This does not affect SQLite.

FossilOrigin-Name: 430c5d1da57af452f236cc862139d84ab97b6020f6d327dae5268c58e6e83a87
2020-09-05 06:21:54 +00:00
dan
78f04753ae Fix a tsan error that could occur when using shared-cache mode.
FossilOrigin-Name: de80bc87300257cc49d98e2d22e914211f213dce912f320c8b37b3883c73923c
2020-09-04 19:10:43 +00:00
dan
2b06b0769e Ensure that the busy-handler count is reset at the end of each sqlite3_file_control() and sqlite3_prepare() (and _v2() and _v3()).
FossilOrigin-Name: 5dd05940617fb05ee2faf212b15afc3a8e9695318eccb76761b37359fea681d1
2020-09-04 17:30:59 +00:00
mistachkin
52cfe0312a Fix harmless compiler warning.
FossilOrigin-Name: a711e8cd2c7b64e06241736ecef478ac64ddbe7b58e0933b6febba63f7fb06e1
2020-09-01 19:02:52 +00:00
drh
512aa78ca2 In the Lemon output, add a prefix comment that explains that the output file
is automatically generated and shows the name of the source file.

FossilOrigin-Name: d34caf3bb63d0512ea116a8c8c8343b76aa39441bd4b3e98231747a705b91d54
2020-09-01 12:26:55 +00:00
drh
60c71b02ca Lemon updates: (1) include the #defines for all tokens in the generated C
file, so that the C-file can be stand-alone.  (2) If the grammar begins with
a %include {...} directive on line one, make that directive the header for
the generated C file.  (3) Enhance the lemon.html documentation.

FossilOrigin-Name: 84d54eb35716174195ee7e5ac846f47308e5dbb0056e8ff568daa133860bab74
2020-09-01 11:20:03 +00:00
drh
fa17e134b2 Improvements to the IN-early-out optimization so that it works more
efficiently when there are two or more indexed IN clauses on a single table.

FossilOrigin-Name: 35505c68c1945c35babd2496e02bc4907a15c8e7b8d77f05f230bd0e9d4891d7
2020-09-01 01:52:03 +00:00
drh
d321b6f4ad Fix a harmless compiler warning.
FossilOrigin-Name: 3ca0b7d54d73d07cd6b32e650a809174bb1cd66ce5ecdb36f65b70899ea05824
2020-09-01 00:26:21 +00:00
drh
37ccfcfeb9 New test-control that returns the number of calls to
sqlite3BtreeMovetoUnpacked() on the main database and then resets the
counter.  This only works for SQLITE_DEBUG builds.

FossilOrigin-Name: dca5b91926431768babac28a6faf7674a5014db95caba727995b470e92b3182a
2020-08-31 18:49:04 +00:00
drh
c51ceeb049 Fix the documentation for the OP_IdxGT family of opcodes to show that the
P5 operand is not used.

FossilOrigin-Name: 62f7d2a61259f296ffdcb3b3ee1a13925c4563ac8ed669f8a8a63fc7bc3a0a37
2020-08-31 12:29:03 +00:00
dan
acd3c8a995 Fix a sanitizer warning in zipfile.c.
FossilOrigin-Name: ded1a75b3cf39834d38a385f38ae969b296f6c9409856b7eea08645e861b1ac2
2020-08-29 19:00:19 +00:00
dan
d49c0c83ef Improve performance of wal-mode locking on unix in cases where there are hundreds of connections to a single database within the same process.
FossilOrigin-Name: a1c19eea8f141b89a0921da0724096feb21a772ef6654f164e2c36ebf9f7871e
2020-08-29 15:15:07 +00:00
dan
6acdee6765 Fix handling of an xShmLock(SHARED, UNLOCK) call when the caller does not hold any lock on the specified slot, but another connection in the same process holds an EXCLUSIVE.
FossilOrigin-Name: 3eb365027b885e1f61965efd53a3643b6ff441ae01e79038a091314516a50dd4
2020-08-28 20:01:06 +00:00
dan
8337da6678 Modify the unixShmLock() function to avoid iterating through the (possibly large) set of connections to the same database file.
FossilOrigin-Name: e0faddf0dfc3a40b6b94408296dd781dd0264ecc9f2129ce4405438433fb00e0
2020-08-28 19:27:15 +00:00
mistachkin
72c38d87bf Add the miscellaneous 'series' extension to the shell.
FossilOrigin-Name: fc0856dccfab273d50457052fa3c6da768d0eb2504ad04d9540da4e3222fc829
2020-08-28 18:47:39 +00:00
drh
7b8524168e Update Lemon documentation. Patches from sgbeal.
FossilOrigin-Name: f5dc83442bf010bc4083e083b3a1acbb9918b7e685ca676dd899a0e09df196bc
2020-08-28 13:10:00 +00:00
drh
e2678b93af Fix a couple of unreachable branches.
FossilOrigin-Name: f2d26f2b11317abd4f993faa1a4df7afcd1a2d4e448ecc69ca05e9ebf102cd62
2020-08-28 12:58:21 +00:00
dan
832aa023c6 Add fts5 test to confirm that for a table with columns a, b, c and d, "{a b}" and "-{c d}" are handled similarly.
FossilOrigin-Name: 1a04920998368e56276fd0b100be8343609c6ff8a731cf8e26a0490f9c6dabdf
2020-08-28 11:19:49 +00:00
drh
04cd60e18c Remove a (harmless) redundant variable from the CLI implementation.
FossilOrigin-Name: 3f7bbb840de0a9b1ca89288805cb151aea6fcb82efda9ba39f51abf1b17c070b
2020-08-27 20:55:54 +00:00
drh
92e21ef079 Include the original text of the CHECK constraint in the error message for
anonymous CHECK constraints.

FossilOrigin-Name: 5ce34a955bb36d77edc9951cb7ac2ef9c876d7d3ff5852af682f558e248f428c
2020-08-27 18:36:30 +00:00
drh
359941bd33 Apple the same fix for ticket [9eda2697f5cc1aba] to text-to-integer
conversions that was done for floating point conversions by
check-in [1c76f1d8ec0937a2].

FossilOrigin-Name: aafb7a21041090e529491b0ce30c3902420be0551b1b2c55840a5fbb9105fb7d
2020-08-27 16:28:30 +00:00
dan
ca3ee7e18a Do not attempt to run test script analyze3.test as part of the "prepare" permutation.
FossilOrigin-Name: f7f13cb1bc699c034a3f5f7a2431c8055cb79e2a14d5e70e1fc5dd6dec00fb26
2020-08-27 14:53:47 +00:00
drh
60081a0382 Enhance the ".databases" command in the CLI so that it shows the result
of sqlite3_db_readonly() and sqlite3_txn_state() for each database file.

FossilOrigin-Name: 0ffd16d23dd3b6467cce31af506c70fde44c3796d386c2a03896e43a6d683e60
2020-08-26 19:07:18 +00:00
drh
30497f4169 If the argument to the ".read" command in the CLI begins with "|" then
run the remainder of the argument as a command and read input from the
output of that command.

FossilOrigin-Name: 6c716f4b556ea8f9c9f15cffd81cb970488eadf1d5da2ba6b366d3bdeb36e492
2020-08-26 10:50:48 +00:00
drh
99744fa4ab Add support for the sqlite3_txn_state() interface.
FossilOrigin-Name: ad195e3dd89d0f33b50070c18fb8f43c4eb24162515dfdd7c04d9e7d96b902a2
2020-08-25 19:09:07 +00:00
drh
58d6f633ba Reduce the N in the logN term for the sorting cost associated with computing
DISTINCT by B-Tree by half, under the assumption that the DISTINCT will
eliminate about half the rows of output.  This is really a wild guess.  But
we do not have any better way of estimating what the row-count reduction due
to DISTINCT will actually be.

FossilOrigin-Name: 8787417ec1da8071d84c6ff0d7a90b5fd458ab6baba871327f36bc4e1bceca61
2020-08-24 23:44:27 +00:00
dan
599456f0ab Correctly handle expressions like "x IS (not) true/false" within the rhs of IN() expressions. Fix for [f3ff1472].
FossilOrigin-Name: 493a25949b9a6d0be82169b597133e491d8be4f4147b6eae135b06c1d810abd3
2020-08-24 10:52:52 +00:00
dan
6c3b4b07d1 Fix a crash that could occur in SQLITE_MAX_EXPR_DEPTH=0 builds when processing SQL containing syntax errors.
FossilOrigin-Name: 5f58dd3a19605b6f49b4364fa29892502eff35f12a7693a8694100e1844711ea
2020-08-20 16:25:26 +00:00
dan
7b14b990d0 Avoid a buffer overrun in test code that could occur if certain test functions were passed a hex-string containing an odd number of digits.
FossilOrigin-Name: 3c5e63c22ffbfeb66eb6ee38912d29fad6f2bd4d74b6a25e89bd36bf40eaa661
2020-08-20 11:03:33 +00:00
drh
14f38b3d0a Try to make SQLite easier to compiler for Mac Catalyst. See
[https://sqlite.org/forum/forumpost/803387a1c5|forum post 803387a1c5].

FossilOrigin-Name: e1595a20d71e61957944cc2b634578968cda8fba08a1f1e75edba20dc9c6080b
2020-08-19 23:51:54 +00:00
drh
46fe138d98 Do not skip over TK_IF_NULL_ROW operators when bypassing TK_COLLATE operators.
Fix to check-in [ac31edd3eeafcef4] which was itself a fix for ticket
[45f4bf4eb4ffd788].

FossilOrigin-Name: 871f2ddcfbb9196dbd851a350e3471ee6d242d86bbd755201f7e2406fce3ac55
2020-08-19 23:32:06 +00:00
dan
1d42e619ac Update releasetest_data.tcl so that the "Fast-One" configuration runs bigmmap.test as part of release testing.
FossilOrigin-Name: a0aa35aaa5694a96638a7c7b1cd69c7523750cbe95831a13c1ee5a6d48256b76
2020-08-19 15:24:19 +00:00
dan
fce445b8fa Fix a problem in test file bigmmap.test.
FossilOrigin-Name: d8e47382160e98be646ce3ba568578493088d1bb11d513ded3e00b576fb07f06
2020-08-19 15:21:52 +00:00
drh
9191c702fc Fix the -quote option on the CLI to set the correct column separator.
FossilOrigin-Name: c778f8295c3c9b6cd6107b33fd7664ae75c97840fc974c9f971755a523f185c4
2020-08-17 09:11:21 +00:00
drh
1d8f892a31 Optimization to sqlite3BeginWriteOperation().
FossilOrigin-Name: 2173d4c6e3addc75964508f2fc8e42755376b3bc285286fa90df4831a6fa280b
2020-08-16 00:30:44 +00:00
drh
45d827cb6a Optimization of the sqlite3SrcListDelete() routine.
FossilOrigin-Name: 1b4acd1ac4a8d24f8804c6d0770f5b0022f569d51742b6954b26e525f04d38ca
2020-08-15 23:48:22 +00:00
drh
289a0c849b Remove more unnecessary sqlite3GetVdbe() calls, replacing them with assert()s.
FossilOrigin-Name: b7dc932197665f0ebde3ffb8f0785c22da07ce307cfd5f0eab69e86e4b38fcde
2020-08-15 22:23:00 +00:00
drh
f0b41745c5 Avoid unnecessary calls to the sqlite3GetVdbe() routine. Add assert()
statements to prove each call is unnecessary.

FossilOrigin-Name: 86d3790caf92e9cb7a9aaaa110f309b4b6945ac30cfd53fc3e5aa1ec3075ada5
2020-08-15 21:55:14 +00:00
drh
398221e2ad Omit the unnecessary not-NULL check on the upper bound of a forward index
range scan.  The subsequent OP_IdxGT will always catch the NULL.  Similarly,
omit the not-NULL check on the lower bound of a reverse index range scan,
as the SeekLE opcode will disallow the NULL.

FossilOrigin-Name: e51ecadcbdef5ce6e41d68412aee70aa4a1416c850358a6fa7e9a1ab443e719d
2020-08-15 19:58:59 +00:00
drh
861889e4f8 When doing an UPDATE or DELETE using a multi-column index where only a few
of the earlier columns of the index are useful for the index lookup,
postpone doing the main table seek until after all WHERE clause constraints
have been evaluated, in case those constraints can be covered by unused
later terms of the index, thus avoiding unnecessary main table seeks.

FossilOrigin-Name: 7fee0b1075d622835dc6828c061be516102da9e2809f52d9ab7c4bbef7dfb871
2020-08-14 21:51:02 +00:00
drh
a3d6d6a93f Update the version number to 3.34.0 for the next development cycle.
FossilOrigin-Name: 70f34f3df5358d36c8578afbc05756450c46da36b8dce339ed87fc0b9d4057cb
2020-08-14 21:37:32 +00:00
drh
f8556d0106 Optimizations to the logic that converts main table accesses into equivalent
index accesses.  Code is now slightly smaller and faster than trunk.

FossilOrigin-Name: 611b640442025e57b8e161f8ddac1f19bd3be9a3d5266f4cef287595c3ed9257
2020-08-14 21:32:16 +00:00
drh
68c0c71065 For UPDATE and DELETE, use OP_DeferredSeek always. If the seek must later
be resolved, add the OP_FinishSeek opcode after all WHERE clause terms have
been processed.  This obviates the need for the WHERE_SEEK_TABLE and
WHERE_SEEK_UNIQ_TABLE flags to sqlite3WhereBegin() and the ensuing
complication, and it allows the covering index optimization to be used
further into WHERE clause processing.

FossilOrigin-Name: a495f60d315e34b1a1bc5fb1336e05047add52c8fb2710b577c97b10a5e734f6
2020-08-14 20:04:26 +00:00
drh
5e6d90fe15 Experimental change to try to get some DELETE operations to access values
using the index rather than the main table, so as to avoid unnecessary
main table seeks.

FossilOrigin-Name: 2f7cb6ab39e54fd6eb3a280d3022c3d4f4ed92e83af7226e63e0199a96397a6b
2020-08-14 17:39:31 +00:00
dan
e0404386f2 Fix an inconsequential memory leak in sqldiff. Update the "Sanitize" case in wapptest.tcl to use -fsanitize=address,undefined, and to run more tests.
FossilOrigin-Name: 613fb5c2525be77e48bad0a74e8b7bf53489365060fb9c7713a0caddb1820c71
2020-08-14 16:14:40 +00:00
drh
ef215fbf3b Version 3.33.0
FossilOrigin-Name: fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f
2020-08-14 13:23:32 +00:00
dan
96e337df6b Fix "make test" handling of environment variable QUICKTEST_OMIT so that it can be used to exclude test files in other than the main test directory.
FossilOrigin-Name: b050976079ba4a22d4dfeadb81f40cf71da6588c95bf2b634d88b416de5accd7
2020-08-13 17:27:57 +00:00
drh
a3e6495970 Improvement on the previous fix.
FossilOrigin-Name: f6cffa2d50bfebe5b025f412b7a49b7fdafb798aaf1ddc80e6656ccd1f012a7f
2020-08-12 16:19:12 +00:00