1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

19158 Commits

Author SHA1 Message Date
drh
f6a4ef144e Do not allow SQLITE_LIMIT_LENGTH to be set lower than 1 as an
SQLITE_LIMIT_LENGTH of 0 causes lots of unnecessary problems for
users of the sqlite3_str object.

FossilOrigin-Name: 8fd5b8ec4ab9b5554d27f25a4638d56e347eab78b60900f24b15a815d3731330
2021-12-06 15:40:24 +00:00
drh
38ed1ceb5a Do not allow certain dangerous ".testctrl" commands in safe mode.
FossilOrigin-Name: 080e72d119b836c49916201bf135445aa7d53cefe40a47437a93448c4d0f41cd
2021-12-06 15:24:36 +00:00
drh
39addd0a3f Fix SQLITE_TESTCTRL_IMPOSTER so that it is a harmless no-op if the schema
parameter is invalid.

FossilOrigin-Name: 2d9a45ab10aaad681e11d639195430c0988b6ca1b96db6bf0b31b889e88a5430
2021-12-06 15:08:30 +00:00
drh
5baaf40af1 Attempt to vary the size of Bloom filters based on an estimate of how many
keys the filter will hold.

FossilOrigin-Name: a7adcf69088cba4b86cc5731a45c9a5263af4355bc0a38f5225cab421c915f7f
2021-12-06 13:07:28 +00:00
drh
6ae49e67cc Run as many Bloom filters as possible before index lookups.
FossilOrigin-Name: 06f6fefd67086896bc49272c6319545ff6c6792f18babe23aced27b60b032119
2021-12-05 20:19:47 +00:00
drh
35685d3e5e Try to run all Bloom filters before any Seeks. This gives a small performance
gain on the Star-Schema Benchmark.

FossilOrigin-Name: 5be2470f8755ef454f813c880e659bdbf82f2396be9320cf3079cd4ca8e81a19
2021-12-05 00:45:55 +00:00
drh
fecbf0a179 Miscellaneous cleanup of the new Bloom-filter code.
FossilOrigin-Name: 201b6dd875b0ae2bbc9969b098e88abfc09e37b59e857decd41f2dcbeeb13e01
2021-12-04 21:11:18 +00:00
drh
067c60cfc9 Add VdbeCoverage() macros. Adjust the Bloom-filter hash function so that it
correctly deals with zero-blobs.

FossilOrigin-Name: 629ee2e3e3125bfd2af435c6713d49e46691213ad15db0a5e93a63a77f1130c2
2021-12-04 18:45:08 +00:00
drh
770dade262 Apply the Bloom filter only on those terms of an index that have equality
constraints.

FossilOrigin-Name: a70429596a3c6a413b03118b0d800521b3526d99dcf88a48acc3189b51518d82
2021-12-04 14:24:30 +00:00
drh
19ce9aafdb Add the "WITH BLOOM FILTER" clause to the EXPLAIN QUERY PLAN output for
cases were a Bloom filter is used.

FossilOrigin-Name: 8e078c0e404fe4b3661dd4a11a992a8914c99e2a144cecc417421cbd68fa08cc
2021-12-04 13:52:08 +00:00
drh
fa35f5c5a7 First attempt to use Bloom filters to optimize star-schema queries.
FossilOrigin-Name: 28161fba9bcde5ae4b36b22d766c881b795af111a3a323c90f6149d0fea9297d
2021-12-04 13:43:57 +00:00
drh
7439d3580c Merge the sqlite3WhereBegin() simplification from trunk.
FossilOrigin-Name: 41ba2dfdd3a18671fc78d60935a16fa50f36af3d6481eff2ca9fba88e7093997
2021-12-03 19:10:17 +00:00
drh
70b403b667 Factor the noop-join-elimination optimization out of the sqlite3WhereBegin()
routine and into a separate "no-inline" subroutine, in order to reduce the
complexity of sqlite3WhereBegin() and thereby encourage C compilers to
inline sqlite3WhereCodeOneLoopStart().

FossilOrigin-Name: 6225e9abcb0261fefca4a26530524ffc449f937f8ae1ece718af2c3c3d73d78d
2021-12-03 18:53:53 +00:00
drh
2b05905521 Merge recent trunk enhancements into the bloom-filter branch.
FossilOrigin-Name: 11d97fb8be6b5155f38df130d7e828edd0f381e32f651458939b1cb9cb973fff
2021-12-03 16:02:05 +00:00
drh
60a8e1b43c Fix exprAnalyze() after recent performance enhancements so that it is able
to handle IF_NULL_ROW opcode correctly, again.

FossilOrigin-Name: 8029e6bab508bf0b8ec1df00a829c5d4de2a84d66dc56b9ff03da879ceef7788
2021-12-03 15:48:42 +00:00
drh
11e4fdb948 Fix unreachable branches resulting from prior optimizations.
FossilOrigin-Name: f3d6853ee80be2dc6d7236d98b850beb0e1931a624d4f5b194c8db742cde7ec5
2021-12-03 14:57:05 +00:00
drh
fd4bf7746b Fix an over-length source code line in build.c. No logic changes.
FossilOrigin-Name: b9db5c5fc618a36d70ea2aced9c96094d665935b5c15a987013334f1bd79eb00
2021-12-03 14:43:49 +00:00
drh
2f0bc1d41b Performance optimization in the B-Tree cursor allocator btreeCursor(), making
it about 800K CPU cycles faster in speedtest1, and reducing the executable
size by about 100 bytes.

FossilOrigin-Name: 9df939716ace8cfe60340bbe83fc52d452ea40c29c856c588f9a1b8973282391
2021-12-03 13:42:41 +00:00
drh
65a3c8508d Optimizations to exprAnalyze() and sqlite3WhereExprUsage() save about 1.5
million CPU cycles for speedtest1, and result in a smaller binary.

FossilOrigin-Name: 1f2252e65dc5847c82246fab87dcad035bf594ba7c45362de87a009b7ebcf2d6
2021-12-02 18:15:16 +00:00
drh
daebb0f9a0 Move the TK_IS token so that it is adjacent to the TK_IN token, as this
allows the C compiler to optimize better, resulting in a slightly smaller
and faster executable.

FossilOrigin-Name: 8832fa9088414a8d285a457a4effad0b7d610a87ca73cfb5c5812e784649761e
2021-12-02 14:28:36 +00:00
dan
1872c5bd43 In the shell tool, avoid modifying internal data structures until after the arguments to ".open" have been parsed.
FossilOrigin-Name: fcc509d325dabe06275e7804183bb8b4ba6470a45b443bc8292eecd0974e6367
2021-12-02 14:16:30 +00:00
drh
cbb7746caa Remove an unnecessary branch from exprAnalyze(), resulting in a small
performance gain.

FossilOrigin-Name: 3312be1db3519074393573265459f6a1eeabce541a9ef4d93689529ea2b8f739
2021-12-02 13:45:10 +00:00
drh
cdd9050396 Small performance optimization in sqlite3WhereClauseClear().
FossilOrigin-Name: 080b35e62e5c6bb4ea162bc75232b81e54da5e3e01e762127e228400e8afef1d
2021-12-02 12:55:05 +00:00
drh
844a89b518 More small performance optimizations for sqlite3WhereGetMask().
FossilOrigin-Name: 3de2c557d915d1b4a9b0e540d5e80ffb243e7123d0ec65c5052f4d6f1cce56b2
2021-12-02 12:34:05 +00:00
drh
dae2a10934 Small performance optimization in sqlite3WhereGetMask().
FossilOrigin-Name: 7edec54ab045c0493fc5d27d47d7bf0e08d3b0b298f428646fd3f0ee24dfcade
2021-12-02 04:00:45 +00:00
drh
79ab384121 Small performance enhancement for whereScanInit().
FossilOrigin-Name: ed84e124c6097b756ca687ac64df7ee801d14b16c835f1a9e8b336f785157d85
2021-12-02 02:22:35 +00:00
drh
9b3bfa00cd Performance improvement in query planning.
FossilOrigin-Name: ca59533bbb7f21d7b39dee7999d3f36ac516f8c75b2203039beeb2852ada42d4
2021-12-02 01:30:16 +00:00
drh
879ac4d673 Merge trunk fixes into the bloom-filter branch.
FossilOrigin-Name: 0864bfbf079a98beaa484911edb17c3dc728e78eca231d4247b282fd824cc098
2021-12-01 21:07:05 +00:00
drh
3b26b2b56b Check for foreign key constraint errors prior to returning the results from
a RETURNING clause.  See [forum:/forumpost/793beaf322|forum post 793beaf322].

FossilOrigin-Name: a818ba2ed635b91e279dde44236fc7446a33db2b46c9409b67021248c01bf4e5
2021-12-01 19:17:14 +00:00
drh
2db144c33b Add a Bloom filter to the automatic-index mechanism.
FossilOrigin-Name: 50ac4de1d7cbb586ea7969e1ae80ea8b021e194edc2fa7db19374b4ee9369bee
2021-12-01 16:31:02 +00:00
drh
c1085ea412 In the automatic index generator logic, be more precise about when a
partial automatic index is allowed in order to capture more cases where it
is legal to use a partial automatic index.

FossilOrigin-Name: 664b461bb5063d98047fc2e51a3827235cd9f55ca2e23cb66e719eac53fb5437
2021-11-30 14:07:58 +00:00
drh
1312a9c908 Add the unixepoch() function and the 'auto' and 'julianday' modifiers.
FossilOrigin-Name: 559fdc0aa76f4c207f99f7b0cee42043b402dc388165817529d9963b115a798c
2021-11-29 17:23:27 +00:00
drh
6df8c0cd3b Following a prior error, an ALWAYS() in sqlite3ExprCanBeNull() might be false.
dbsqlfuzz 5dbec6678a20e7595a34dfdd869a3b9722b3ca43.

FossilOrigin-Name: 4e207401acce1bdc17025f2d55bd94234b435e286cd43e1eda03b6949a2a91d3
2021-11-28 19:54:38 +00:00
drh
14851b9a14 Fix a harmless comment typo.
FossilOrigin-Name: 7c567338ae4dd31097e9ae5c693b84369c35c5a52534797e8186b4be7297ba78
2021-11-27 12:03:51 +00:00
drh
913306a53a Improved defenses against integer overflow when computing the size of a
memory allocations.  No bugs were fixed here.  But perhaps future bugs will
be prevented.

FossilOrigin-Name: eb878c01f317f09e8ef6b1bd2ec8d6d5cd6ce0bdfe9da7fa7d92d2047cc9d9e4
2021-11-26 17:10:18 +00:00
drh
e574a9233c Fixes to internal comments. No changes to code or documentation.
FossilOrigin-Name: 1489b196ce82cddf7360aff6c89219ca25e666187f0f5ff6419ba3b504cdef8d
2021-11-26 15:08:55 +00:00
drh
7907d372bc Fix a compiler warning in the dbserialize method of the TCL interface.
FossilOrigin-Name: ba71d030fef4cd4251dc882acc6897dbf9aaba498652900c491b082add87404f
2021-11-23 12:59:25 +00:00
drh
9f9bdf9345 Fix the build for SQLITE_OMIT_CTE.
FossilOrigin-Name: d7ef96bae459f800241483fe8784552d18ee7f92f408f6453ac687de5530bbb9
2021-11-22 13:35:40 +00:00
drh
a51e60079f Small performance increase and size reduction for sqlite3ExprCompare().
This change also handles some corner cases without the need for ALWAYS().

FossilOrigin-Name: d814ba6effc7c5b021ff625b57371627f3ee326687c508da99f78bc164386b7e
2021-11-19 19:11:58 +00:00
dan
d9137e3be0 Fix a benign data race in os_unix.c that might trouble tsan and similar tools.
FossilOrigin-Name: 95806ac1dabe4598170061d903ae30f09bafac149ff6696963a7e056ac846cdb
2021-11-19 14:02:43 +00:00
drh
5e90794b67 Minor tweaks to the way auxiliary tools are built, to make it easier to
customize the builds without having to alter the code.

FossilOrigin-Name: 90b06b6f42918852cfb15258be462c6bed260c6a618b86fa9084bac72fa2f58f
2021-11-18 20:56:59 +00:00
drh
9cd0c3d4c5 Improve CSV quoting in the CLI using the strstr() function.
FossilOrigin-Name: b7927bf91049c903730a280484bbcdcdedc259a31fbcc3d3b0c7d046ec321633
2021-11-18 15:40:05 +00:00
drh
e41d30ffdd Fix an obscure problem associated with quoting of CSV output in the CLI.
FossilOrigin-Name: 38a9b660214c06aa6650c6bb11a429a8c74c09f1e0e5c18d691e36de4af7af71
2021-11-18 13:25:31 +00:00
dan
488b55856e Fix a problem causing an OOM within an ALTER TABLE ADD COLUMN command that adds a column with a CHECK constraint to go unreported.
FossilOrigin-Name: a33f5e93ecb7d84291f6fecc7b60f0c555034aa47e24584c63c78d8a94710d82
2021-11-16 13:36:50 +00:00
drh
9dc718856f Strengthen the sticky-CORRUPT idea of check-in [3feb0f1c3840904d] by
automatically changing the first COMMIT after an SQLITE_CORRUPT error into
a ROLLBACK.

FossilOrigin-Name: bd66ab8a1bc3c43a57c7caff5f54545b0feb0177f1f51492f30d308c123c43ba
2021-11-15 19:10:13 +00:00
drh
3ce76a0bbb Small performance optimization in sqlite3VdbeHalt().
FossilOrigin-Name: 9e1ecf438cb01d3d76950bcce1b3e4df29bedbb8176c8cede27e66f8e53e2098
2021-11-15 18:50:02 +00:00
dan
8745f8a3c3 Fix a problem causing the count(*) optimization to be misapplied in some cases where an aggregate sub-query uses a count() expression that is aggregated against the outer query.
FossilOrigin-Name: e30917278c0ec750b1756ddc5e32d65c55464531d6ef64d2e72a412dfe634f58
2021-11-15 14:11:23 +00:00
drh
5b001cc25d Improved context shown for the "ABORT-due-to-error" output line when using
"PRAGMA vdbe_debug=on" in an SQLITE_DEBUG build.

FossilOrigin-Name: c7776369bcd0dbeb418b14d5dc681a81ee426234cc3f4f79a3c899d7892e1560
2021-11-15 13:22:42 +00:00
drh
146121f5cb Improved handling of OOM while reallocating a column name to add type
information.  dbsqlfuzz 5a195b4233649e49e0aa34f1b743ca192d85b198

FossilOrigin-Name: 5995dd4de4997c43b43befc1281ef6378f33f781134c7f368299d64db2344f1d
2021-11-12 14:39:49 +00:00
drh
9135ebb7db Make sure the rowid value returned by the VUpdate opcode is always initialized.
FossilOrigin-Name: 150b5be5d5771485f521e3a58312596ecdcd35f3a0ae9d42d88bb99348a197c4
2021-11-11 23:52:44 +00:00