Commit Graph

2973 Commits

Author SHA1 Message Date
dan
fb8e71c584 Fix a case in the fts3 offsets() function where a corrupt database record could lead to dereferencing an uninitialized pointer.
FossilOrigin-Name: 7b7d31a6153b1505288eb3e849d0d9ef9e88e961c7b2f918ef5582fd77990f6d
2021-10-20 11:40:34 +00:00
drh
134f544ab2 Fix a harmless scan-build warning in FTS5.
FossilOrigin-Name: 0bf42bb5611dc3f672cb898b8be245fd25f7a3862c1e0734effd18d75e812f22
2021-10-16 19:50:03 +00:00
dan
f7ff755651 Fix an assert() in fts5 that could fail with a corrupt database.
FossilOrigin-Name: e99979855de937ed5ee0994b180054501400bf8776fb70acd31786d2ba1ad49a
2021-10-16 13:59:08 +00:00
drh
285f2ef4ad Protect the JsonNode.u union using nearby assert()s and branches.
FossilOrigin-Name: 7b8ea2298927fd34f27b3345add3ce751ed728387fe3d9207b601ba6449d5af9
2021-10-15 16:15:04 +00:00
dan
33cf194218 Fix a signed integer overflow in fts5 leading to a segfault that could occur when processing corrupt records.
FossilOrigin-Name: 69a3ff0cc159cdf84a5367eaf708882ddeda4fa65c96a5b546ae4a0114f02cb7
2021-10-14 21:13:02 +00:00
dan
dee0359ddb Fix a use-after-free in fts3 that could follow an optimize() in the middle of a SELECT statement when the hash table is non-empty.
FossilOrigin-Name: 8124b2ceb71447157283b16f9a7fa6e250003b9ddf1c1b45f91db64aed79b5da
2021-10-12 11:30:07 +00:00
drh
13ca72d011 Fix harmless compiler warnings, mostly caused by prior efforts to get static
analyzers to run without warnings.

FossilOrigin-Name: cddd3b382a118bb16be3a602ae711fe2c2a7d1c673dd30dd3977b67ee555e666
2021-10-05 18:59:05 +00:00
drh
d7ace22d8c Fix more harmless static-analyzer warnings. As of this check-in, no warnings
are generated by scan-build for clang-6 or clang-10.

FossilOrigin-Name: a7835bead85b1b18a8affd9835240b0baf9c7af887196bbdcc3f5d58055042fc
2021-10-05 18:33:38 +00:00
drh
7a3b4451a1 Fixes for harmless static-analyzer warnings. This also makes the code easier
for humans to understand.

FossilOrigin-Name: 36177a62feeb4fa93ab6e3c6f4dbe1ddcf63bb02f93284abab979da0261b218e
2021-10-05 17:41:12 +00:00
drh
6a726fa175 Fix separate compilation of json1.c, which was apparently broken by
check-in [32f33f356931242b].

FossilOrigin-Name: 0c7ece6792d30bdb314e2a6e61d0c051c3619a2d749f8b1df7dc2b1f521388bf
2021-10-05 15:30:52 +00:00
drh
640574f61a Small change to FTS5 to help static analyzers understand that it is not
dereferencing a NULL pointer.

FossilOrigin-Name: 0d853df1b19a0270b2cb0ebdf5df8067572f19ab9a82d047cb047f3f9e850348
2021-10-05 13:00:50 +00:00
drh
8a0c42765d Ensure that geopoly does not invoke sqlite3_result_error_nomem() with a
NULL pointer.

FossilOrigin-Name: 2483310d15022b47109b44c86e100f5894be7a45a0568dfef6aea80e6c518654
2021-10-05 12:34:54 +00:00
drh
7d4c94bc0f Fix harmless static-analyzer warnings.
FossilOrigin-Name: 32f33f356931242b59c01b5df7e180941231e3d9c91577ad33aa4a01e9d59092
2021-10-04 22:34:38 +00:00
drh
922c54206f Some #defines somehow failed to get set correctly in the previous check-in.
Fixed here.

FossilOrigin-Name: 15bbdf9ac840a220f384411d3025ef22f949d310194b60bca8e6d6a759e6042e
2021-10-04 18:57:42 +00:00
drh
11a9ad5669 Fix harmless static analyzer warnings in sessions, rtree, fts3 and fts5.
Add the -DSQLITE_OMIT_AUXILIARY_SAFETY_CHECKS compile-time option to cause
ALWAYS() and NEVER() macros to be omitted from the build.

FossilOrigin-Name: 1c67f957fc77e37ce8f0d447c41ca975e8e79a35d332739c24a633649b5b0387
2021-10-04 18:21:14 +00:00
drh
c59ffa8c1e Fix harmless static analyzer warnings.
FossilOrigin-Name: 1ebcde72e2046dffaa408d2a5a4a5bbf35fdf4b096e0e088dcffd9360effdaa7
2021-10-04 15:08:49 +00:00
drh
aa6fe5bf10 Fix harmless static analyzer warnings.
FossilOrigin-Name: 6604a085964121113e7b7f57537a0ba64ba058d0eb12bf0a3aeb6d1b7a29d516
2021-10-04 13:18:44 +00:00
drh
76fc88fe0f Fix harmless compiler warnings
FossilOrigin-Name: bdb9dc8a025b509960d08cdf0ff784dd075c156860548d7908de7d97e030701c
2021-10-02 16:39:16 +00:00
drh
e85e1da07b Fix harmless compiler warnings.
FossilOrigin-Name: 94b59691ee50a4666b25e36d1529fc52f714bbe94c3e8ccb35bf0a4ea11050db
2021-10-01 21:01:07 +00:00
dan
37f3ac8faa Change things so that SQLITE_OMIT_VIRTUALTABLE implies SQLITE_OMIT_ALTER_TABLE.
FossilOrigin-Name: 2f7c946c5f25a858167f5193ca06e53310394c8cff15426ab8a1327a1ec835fd
2021-10-01 20:39:50 +00:00
dan
adfb203a7d Fix a buffer overread in fts5 that could occur when processing an "ORDER BY rowid DESC" query against corrupt database records.
FossilOrigin-Name: fe098a93340b8dac15752f1be4f681e2a591f7ae1a94b177f400ccd7ef638480
2021-10-01 15:05:19 +00:00
dan
09e2626eaa Fix rtreedoc.test so that it works with SQLITE_DEFAULT_AUTOVACUUM=1 builds.
FossilOrigin-Name: a300adc21151fb70ab8573477fd89a10300ee678f068fe123f22ada2f1f876d2
2021-09-30 17:39:21 +00:00
dan
91f621531d Update a test case in rtreedoc.test to account for the fact that release builds generate fewer VM instructions than debug builds.
FossilOrigin-Name: 7d16b302826fec3606dbc6e20df0d2182f6946a2ed4076d2412d1df30c552ecb
2021-09-30 10:47:10 +00:00
dan
eda0001d89 Add new test file rtreedoc3.test.
FossilOrigin-Name: 54604869861cc5866d5de87785599ca56f75067f8cb7fe22e32912b3a037e37b
2021-09-29 16:38:02 +00:00
dan
415540ddaa Fix an out-of-bounds read in fts5 that could occur when processing corrupt records.
FossilOrigin-Name: 9bbc01fb239b4aa752a56c584baa29655a3c845425d5c17d24a3939984d54fe2
2021-09-29 13:36:58 +00:00
dan
4b67c655af Fix a memory leak in rtree triggered by corrupt database records. dbsqlfuzz 397ad036a9013d7318da30ef84947d2baaaa6d6c.
FossilOrigin-Name: 706322c2b5bb31e14c1120a94520b21fa623ff119e3890170e36b37d8bde721a
2021-09-25 20:19:16 +00:00
drh
dd31c033c6 Fix harmless compiler warnings.
FossilOrigin-Name: d678ecca02698753d1b33e072566112e94ea36d0d3a8f4a24d2b09d131968d88
2021-09-22 14:43:35 +00:00
drh
fd7abcd15b Fix harmless compiler warnings in shell.c.in, and a compiler warning in
sqlite3expert.c which is a real error, though also harmless.

FossilOrigin-Name: 56da0e9c0321d1fd3c360722cd6284296f9ba459f6b37ab35c81ecabd18f12e3
2021-09-22 13:43:16 +00:00
drh
c2f61c18d1 Fix an incorrect assert() in rtree that was added recently
by [f7ad73c49507c943].  Change it to testcase().

FossilOrigin-Name: 3aa0bf3a098ee9a62c79f266f94e4d290056d0f3e91237944893d6bbb686861f
2021-09-22 13:07:10 +00:00
larrybr
b565bee66b Fix .expert name collision bug reported at https://sqlite.org/forum/forumpost/05e6f32984561f57?t=h
FossilOrigin-Name: 4a3f98ad0dd2a8c0370042611a041bed2bd8d9ca82d6706e2db349eb97aaf1f0
2021-09-21 20:03:05 +00:00
drh
2e50f67073 Add the "PRAGMA table_list" command with its corresponding eponymous
table-valued function: "pragma_table_list".

FossilOrigin-Name: 2c0e7ae541e9ecb86aa58fa7e7057def8aac1b1af1af1aa80b8bf2d260f9a2f9
2021-09-21 17:26:23 +00:00
larrybr
b3e4423137 Accomplish fileio standalone for Win32 with less intervention.
FossilOrigin-Name: af5dcc9c2a3a45d10b985f6b7ea18d39c75502ed10fa6496aad787dbe8c8c3fb
2021-09-20 21:42:39 +00:00
larrybr
3d99743423 Allow fileio extension to be a stand-alone DLL for Win32
FossilOrigin-Name: d1cc3105b2baceb9f426fd6bc8d8317de3af09a0f02517715bd292c68e282fa1
2021-09-20 20:15:28 +00:00
dan
5488e0827a Further tests for legacy rtree geom callbacks.
FossilOrigin-Name: 99d6bb22e8735681443bfe67287aa15ce2c57d0d63e304abf8aa01fde50dd021
2021-09-18 16:15:54 +00:00
dan
01ed72f2c5 Add tests for legacy geometry callbacks to rtreedoc2.test.
FossilOrigin-Name: 6ad00e52eda5bc4cb8e6fffbd7538bcd4c6b22f84b837a746eba6bf8c91eb55a
2021-09-17 20:43:27 +00:00
drh
89b1715415 The dbsqlfuzz fuzzer found a refutation for a recent ALWAYS() macro.
FossilOrigin-Name: ebfc18aaa6506ccac80f297a1792e726972bb39c0b5c8706faadeb8df94a45e9
2021-09-16 22:23:36 +00:00
drh
8e4616c280 Minor changes to rtree.c so that we can get full branch coverage even when
it is compiled without geopoly.

FossilOrigin-Name: f05ae9b5864459493154037d2c902d203c4a43007b5d61bd4beb1eed56e06d13
2021-09-16 20:16:39 +00:00
dan
72fb42d570 Add tests to rtreedoc.test.
FossilOrigin-Name: b18c6ec46079520e0db8b42586ce9370a4038d0b4f719cfb98488037883e2537
2021-09-16 19:50:54 +00:00
drh
051c9ba1be Add a single new ALWAYS() to rtree.c, with justification.
FossilOrigin-Name: 778e4499cdf2083d5431738099dedf0aade9271f661e09ca3278e0109bb1e720
2021-09-16 17:02:59 +00:00
drh
495f78d851 Add a tag comment in rtree.c. No changes to code.
FossilOrigin-Name: 213410fa9cceb4ce34bf590ba65648ebeb94cc8d0c29a8881222208097162a95
2021-09-16 16:41:59 +00:00
drh
eb56e29053 Mark an unreachable branch in rtree.
FossilOrigin-Name: e6c4afd5b365b8dea8c0742352a09029da0f9715dd2407d4ccf53f1e0a4ce625
2021-09-16 14:07:09 +00:00
drh
86b262ecfa Back out a couple of ALWAYS() macros from [4fab9089868bbb05]. Test case
added to TH3.

FossilOrigin-Name: d26963a530ccbe36a174823d2f0bd7e06c6fca4f38ecdd04cd700c4000cc3719
2021-09-16 13:52:28 +00:00
drh
162f153579 Simplify the routine that attempts to estimate the size of an rtree index
by looking at the sqlite_stat1 entry for the %_rowid table.

FossilOrigin-Name: 06c329c17c2c2de8bc1ca7f3b0b929055675761a8be7a7e8b4a9fc5cca0d1679
2021-09-16 07:32:24 +00:00
drh
c464ec6710 New ALWAYS() and assert() to mark unreachable branches in rtree.c.
FossilOrigin-Name: f7ad73c49507c9436adc7fe1b865f801eefcc7ea6b3ba35e83e63029beb03016
2021-09-16 05:24:40 +00:00
drh
5f9c7ba9d8 In rtree.c, remove an incorrect ALWAYS(). Add other ALWAYS() and NEVER().
FossilOrigin-Name: cbaac8878aac0623beb5af3bc79a5b1c0179213206fd658b8c4fcc3531889480
2021-09-15 19:53:22 +00:00
drh
750f2331c4 Add more ALWAYS() macros on unreachable branches in rtree.c
FossilOrigin-Name: fbba89dac9591c56da81bd0808910fbc64640f3ccfd95845ecab4d3aea46ca61
2021-09-15 19:13:24 +00:00
drh
8038cb99b0 Fix the xBestIndex method on rtree so that it correctly recognizes that
rowid=? works the same as id=?.

FossilOrigin-Name: c74c07cc86443057d34284ae31eb68470741592b0e61072fd5e120e82919169b
2021-09-15 16:20:15 +00:00
drh
04bd2c837b Add ALWAYS() macros on some unreachable branches in rtree.
FossilOrigin-Name: 9123f680ae3100f4c781ac4f5b8afac49bb5d4231b5931ad112b1b615f22f613
2021-09-15 15:56:00 +00:00
dan
f02c324bc1 Further updates to rtreedoc.test.
FossilOrigin-Name: e66727837ddd5d1344c252323d52600b6138f5a2471f63d09b5a28ea2c22e595
2021-09-15 15:53:01 +00:00
drh
83569e2e9e Simplify some of the corrupt shadow-table detection logic in rtree.
FossilOrigin-Name: 0c4f37aa475bd4bd17c20c02ab2d9f63d0a6a08b0e2bbfa559f7b972ece6f4fc
2021-09-15 13:09:55 +00:00