Commit Graph

22322 Commits

Author SHA1 Message Date
dan
84b168ffa7 Change an fts5 assert() that can be triggered by a corrupt database to an if() condition.
FossilOrigin-Name: ea0a7f103a6f6a9e57d7377140ff9f372bf2b156f86f148291fb05a7030f2b36
2020-12-15 13:55:38 +00:00
drh
9f023ce539 Enhance UPSERT so that it allows multiple ON CONFLICT clauses and does
not require a conflict target for DO UPDATE.

FossilOrigin-Name: 6b01a24daab1e5bcb0768ebf994368d941b1dfc217bf6b661211d900331e68cf
2020-12-14 15:39:12 +00:00
dan
59964b4010 Fix an integer overflow problem in new VACUUM code.
FossilOrigin-Name: 59b4367fd852ba1bfefdff99a27b11657495a3f114ed6f85fdcf6c532f4a19fa
2020-12-14 15:25:14 +00:00
drh
1c19848386 Minor changes for test coverage.
FossilOrigin-Name: e5a8fa50f4e5e5c24664452eda4af80904f75e5123b8f84353347dbd505d416d
2020-12-14 13:52:03 +00:00
drh
250af6e0fb More test cases. No new problems discovered.
FossilOrigin-Name: f34dd67e2d0dfc9e3b5d49148fb0162853119c097cbc3fe961878875ba98d8e3
2020-12-12 00:43:52 +00:00
drh
255c1c159b New test cases with corresponding bug fixes.
FossilOrigin-Name: f22c21a94ca4cad0217f91c1a5a275bc348cb6ba0f3a54c927533bc8d8c96a90
2020-12-12 00:28:15 +00:00
drh
58b18a47df Begin adding test cases. Fix one bug found so far. More are pending.
FossilOrigin-Name: aadd67ddf2a191629b5356395f75e4556aac904a6e2f6b83742fa4f26e4253a4
2020-12-11 19:36:19 +00:00
dan
855aed19e2 Fix an assert() broken by recent changes to vacuum.
FossilOrigin-Name: dd058da85ca54ae70e26cb0bdc75ff42998d4a8b29a5e2dcac44ee0e45776a85
2020-12-11 19:01:24 +00:00
drh
d3e21a1098 Small performance tweaks.
FossilOrigin-Name: 5321d60c575ef8f888d1b315df02cf9ed96a3ffc61babbc1429aa73b2a61a190
2020-12-11 17:11:56 +00:00
drh
ed4c54699d Bug fixes so that legacy tests pass. New tests for new functionality have
not yet been added.

FossilOrigin-Name: aa76790e58cea9a2b707f5912fd66c76545e7417442553fc13c87f773a2fe1dd
2020-12-11 16:49:51 +00:00
dan
7710878333 Add an "#ifndef SQLITE_AMALGAMATION" block around the typedef for u64 in shathree.c.
FossilOrigin-Name: b411f29e1a6415f4a241777c45591b8389e746cd8b40d9b225e073bcb0a3bdbf
2020-12-11 16:03:19 +00:00
drh
d0a0538229 Fix the configure script on the autoconf distribution so that the
--disable-threadsafe option works.  See
[https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244459|FreeBSD bug 244459].

FossilOrigin-Name: e64ff2cce3c03ba27c3bf410948ece1424113e727870015eb3806b75d0d21f94
2020-12-11 14:34:58 +00:00
dan
69871baa15 Fix the expert extension so that it handles generated columns correctly.
FossilOrigin-Name: c2ae7ba6f8f4b10bd734051a0cfa8ed9675bd58c82ede4e9eadfd7cbcc03b82d
2020-12-11 14:22:44 +00:00
drh
61e280ad8a Logic is in place to handle multiple ON CONFLICT clauses, but it does not work.
Any use of ON CONFLICT will likely lead to memory faults.  This is an
incremental check-in to save my place.

FossilOrigin-Name: 155142314feb007d526f8f67723636fd50dc52d1cd4d3a67dd93b105c9d5c2be
2020-12-11 01:17:06 +00:00
drh
daf2761c62 Use an iterator for the index loop in sqlite3GenerateConstraintChecks().
The idea is that this iterator can be enhanced to traverse the indexes in
any order, as required by multi-index UPSERT.

FossilOrigin-Name: 64a4a91ecc5dcde3fa07d3cf038c74b9ede63d36628ecfb35203a9dfbbfe113c
2020-12-10 20:31:25 +00:00
dan
9257ddbf87 Remove a redundant branch added by [56a54258560].
FossilOrigin-Name: b4d6f6d728738710249ad74236c31a1872fdff7dadabd4c4a67d05826eb5df9e
2020-12-10 19:54:13 +00:00
dan
a64804b5e1 Changes to avoid loading large records into memory within VACUUM.
FossilOrigin-Name: 56a54258560fab715b83967634b2bd4c04be43cded112b46e85da9f99ee02f7c
2020-12-10 19:51:39 +00:00
dan
d2ffc9721e Fix minor issues with new code on this branch.
FossilOrigin-Name: f7fa76d0963e7b34026dc20c920bfbf7961033fe2b99503f6857157595f86823
2020-12-10 19:20:15 +00:00
dan
46a6b1a1be Merge trunk changes into this branch.
FossilOrigin-Name: 7337eed629b4537b8fc2dc87c3c71d0a664128a91fd00f3c5f18843505beee90
2020-12-10 18:07:01 +00:00
dan
7aae73588a Better integrate the changes on this branch with OP_Insert and OP_IdxInsert.
FossilOrigin-Name: 101cef14910d6e865a94bc870aed599321b893188062a9a61d70a9434992cf23
2020-12-10 18:06:24 +00:00
drh
70f3eda5be Add an optional function to the chsumvfs extension. When activated by
the SQLITE_CKSUMVFS_INIT_FUNCNAME macro, this function will invoke the
file-control that sets the number of reserved bytes to 8.  This can be
used to initialize a cksumvfs database file by programming languages
that do not have access to the sqlite3_file_control() interface.

FossilOrigin-Name: 01841fb4bf3d6c5fd5bcbc7d1338998c50f69f84ca475fba7cf764d636714678
2020-12-10 13:49:00 +00:00
drh
91f2717f22 The DO UPDATE code generator searches for the correct ON CONFLICT clause to
use.

FossilOrigin-Name: a47e35ee2d901baaa37e7229d190f934e1b0bd3510147cd4a2a49c4a1411416a
2020-12-10 12:49:26 +00:00
mistachkin
d97a4c008d Fix compilation issues with MSVC related to C99.
FossilOrigin-Name: c0de6c1fb2c486be1da01e5e4ca8c5634ba37822e418d57f272e018c3e3fc0a2
2020-12-09 23:35:51 +00:00
dan
cd1b2d0b54 Transfer large index or WITHOUT ROWID records between b-trees when vacuuming without loading them into memory.
FossilOrigin-Name: dfd4ca6891a893d0e9551689954d3e79114d5565f8a5264f96ad1d64fe1d6280
2020-12-09 20:33:51 +00:00
drh
e84ad92f17 For upsert, the constraint check code generator uses a copy of the index list
for the target table, which can potentially be reordered.

FossilOrigin-Name: 3194c00c2c6a32bdfd5acc9fda5b38ae131d20cd3b7aea8512a41b2e76808f6a
2020-12-09 20:30:47 +00:00
dan
1418b9daf6 Add tests for a 'delete' command on a contentless table where values that weren't actually inserted are NULL.
FossilOrigin-Name: 818c647cec7063b33b6c5de3e23599a1d61439fa6e9bf6c974b2522a5a9e1b44
2020-12-09 16:49:28 +00:00
dan
ebbf36878c Avoid loading large intkey rows when VACUUMing, even if the page-size is changing.
FossilOrigin-Name: 0d2c3776065dc94119899ae4164995193b82fca7ac31868f3141b729d0b65ab9
2020-12-09 16:32:11 +00:00
drh
5602777e8f Improved comments in sqliteInt.h. No changes to code.
FossilOrigin-Name: 8ccb8d1d55fa5aaf625c30f0e7c10aa403d79b5574dbdfa3fd0271a4e546f7e3
2020-12-09 13:11:02 +00:00
drh
20b86324a1 Initialize all terms in the ON CONFLICT clause stack.
FossilOrigin-Name: 5e683fd1cbde53f37cf8a2b1e981191e2b29e3376db554691767f33c37c7547e
2020-12-09 01:34:48 +00:00
dan
036e0675e6 Experimental changes to vacuum to avoid loading large records entirely into memory. Currently only works in limited cases only - for rowid tables when the page-size does not change.
FossilOrigin-Name: c90e063ca9ddcdd1e9f1a2e25a3f7d6e7ee798373ad8acf65b90536b0a124c0d
2020-12-08 20:19:07 +00:00
drh
2549e4cc2f Enhance UPSERT parsing to allow multiple ON CONFLICT clauses. Only the
very last clause may omit the conflict target, but the conflict target may
now be omitted for the DO UPDATE resolution.

FossilOrigin-Name: 2ca62f4c71df6544cb8039bdc80e3701d09697c38800534371f6d44532fcffae
2020-12-08 14:29:03 +00:00
drh
0dffe465f7 Fix a bad assert() in math1Func().
FossilOrigin-Name: 4b286129138d44e6f8e9b3450289941e01d20fdfb9d0b5d846031425e8ca6b49
2020-12-07 23:14:25 +00:00
drh
e2ce8c446f Fix to the --disable-math option to ./configure.
FossilOrigin-Name: 99ff6418492adcbaf2be728737735afa1c2997de5868395e69c53d08fc14491f
2020-12-07 21:19:17 +00:00
drh
63f8f98a63 Many more math functions. Semantics follows PG wherever possible.
FossilOrigin-Name: 6b93627b5d9819abf179a3e4a82e7afe17cbcafdabbd5f058de9ed114c9d477f
2020-12-07 21:13:06 +00:00
drh
f6e904bd92 Begin adding new SQL functions that depend on -lm: ceil(), ceiling(),
floor(), ln(), log(), and log10() so far.  More to follow.

FossilOrigin-Name: 4db5f2f7875f6df78630a7816fc018141a6eee2e295b44fc7627eb66d07881ea
2020-12-07 17:15:32 +00:00
drh
aeb6bc5628 Fix harmless compiler warnings associated with the recent FTS5 enhancements.
FossilOrigin-Name: 1db7c751912beb57a697ac8e85b9c29e30da7b6c89207e9828bf08e56c58242f
2020-12-04 17:05:16 +00:00
drh
0a2fb7960c Fix a bug in the ".eqp" command of the shell that was introduced by the
recent sqlite3SelectTrace/SQLITE_TESTCTRL_TRACEFLAGS changes.

FossilOrigin-Name: fd02dffceb0e21cd85c99d5481ab8567110d01c30ea701178547f32299944302
2020-12-04 16:58:20 +00:00
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