Commit Graph

124 Commits

Author SHA1 Message Date
drh
8f0634549c Add a test case to prevent a regression of the leak fixed in the previous
trunk check-in.

FossilOrigin-Name: f99ff655d09763c4a22d065041644ece793d84c82c644931e89ccf50c4f4564a
2023-10-07 08:15:47 +00:00
drh
3e053c50b4 Do not allow the same JSON parse to be input to both arguments to the
json_patch() routine.

FossilOrigin-Name: 8e781c6742792b3899ca60efc49c7eaee1df9f6b03d27c254b0e148b82946e19
2023-07-28 20:59:25 +00:00
drh
9a8330b550 New test cases added to fuzzdata8.db.
FossilOrigin-Name: be67bafccd79ba835ed7e287e09852ce83805da0797b164d0c8e44be05d9d28a
2023-02-09 12:47:15 +00:00
drh
87bdc152a1 Add about 150 new fuzzer cases to test/fuzzdata8.db.
FossilOrigin-Name: a8d8d9cd65e64e0a492a80c00050f54ab75de82651230049f65c9d2b78a164f2
2022-12-20 15:22:57 +00:00
drh
7bc6a818f0 Remove one of the NEVER() macros added by [5166acf3f0040459] because it
is reachable after all.

FossilOrigin-Name: bd8ae5febbb8d3122f1e2e09b9fcdd6ac20c075ae1cf60bcdbd36080f3736417
2022-09-30 22:40:57 +00:00
drh
1337a2291d New test cases in fuzzdata8.db
FossilOrigin-Name: aa367a3c974041323edb759855f0b83803439ceef2846da2d73eadd80efeaac4
2022-09-30 20:59:09 +00:00
drh
eba21cd4be Load recent dbsqlfuzz finds into test/fuzzdata8.db.
FossilOrigin-Name: b275ad250d8aa286829647967ab7e75fcd2b5674caab1a34eab59d8486a34cd5
2022-02-11 17:47:58 +00:00
drh
a2417ec75c New dbsqlfuzz cases added to test/fuzzdata8.db.
FossilOrigin-Name: d1fbf63330830c4b9549d0e67f6cdc19fe7a9dc3fcf509795fd1175499fddc82
2022-01-24 20:20:35 +00:00
drh
92704681a1 New test cases added to test/fuzzdata8.db
FossilOrigin-Name: 7046877006259a0073cca4ddb4541321d373c462eac9924be26b5ae224075732
2021-12-09 14:15:39 +00:00
drh
f9241a5fd0 Remove a NEVER() that was add yesterday. The fuzzer found a new test case
to make it happen.

FossilOrigin-Name: 83e6ac71073edfa0cd73788c30bdd5f09cb04c8a6a7d5123123dbcd354f430b8
2021-11-11 16:26:46 +00:00
drh
34e71830de Load new test cases into test/fuzzdata8.db
FossilOrigin-Name: 8b53ffe99df6f5443bd22a9d95433819eb44c7e8f044c2f3e9d52661741d5612
2021-11-10 15:23:00 +00:00
drh
1cd6042f90 Add recent dbsqlfuzz cases to test/fuzzdata8.db.
FossilOrigin-Name: 8c3f2536d2853acef05c4e8c07f301abb0687402c56ded5ff8614e79fb049423
2021-11-02 10:47:20 +00:00
drh
662bebb6bd Change fuzzcheck so that it accepts binary dbsql files.
FossilOrigin-Name: c87a2426b81f22bd21543aa2408625ae472d8fe6cbe6b04145937066e61123c9
2021-10-27 13:16:33 +00:00
drh
dc88b40285 Fix the previous check-in so that it works with virtual tables that add new
shadow tables the first time they are referenced.

FossilOrigin-Name: f73b499e539b9551a70deecec4fc10c3a4af3830324977861cd0558f9782a1d3
2021-10-21 19:48:14 +00:00
drh
8436f53ebe New tests added to test/fuzzdata8.db.
FossilOrigin-Name: e944d71760e3ee3de5dd518a04dad54d66ae4d40dac172b64d16c508471e30a1
2021-10-13 20:29:05 +00:00
drh
75231eae07 New test cases added to test/fuzzdata8.db
FossilOrigin-Name: 2e475fecadc6d9e9a0537435827f56a5c7345f69a9b713d7812da4c9a0f27a96
2021-10-11 09:48:59 +00:00
drh
76ec55fddb Load recent dbsqlfuzz cases into test/fuzzdata8.db.
FossilOrigin-Name: 7a8fcf6d2c8e3c8f10ff515c8c00c761d15a28eef8e0e31e09e22feb06c9443b
2021-09-25 20:28:39 +00:00
drh
2a6a72a81c Ensure that the db->init.azInit array is initialized at all times.
dbsqlfuzz 0ad6d441f9bf3dfc32626a9900bc1700495b16f9

FossilOrigin-Name: c7560c1329965ab57cd71393c044b110561b83641d08677bc51044df9e377882
2021-09-24 02:14:35 +00:00
drh
7f58117921 Back out changes [00286ca5d998d802] and [6844ede29e1dac93] (replacing the
associated branches with NEVER()) and add a single new test to
btreeOverwriteCell() that detects when an overflow pages is also mapped
into a b-tree page and raises and immediate SQLITE_CORRUPT error before
making any changes.
dbsqlfuzz 81791bd980fe6935ff2c7334ec8bef11c1c12b82 and others.

FossilOrigin-Name: 32210fa4ac4f06e1705ef808731c7be040a23f9a8630986440100c5d4e76dc07
2021-09-10 01:02:42 +00:00
drh
3acb3b7845 Remove a NEVER() in btree that is sometimes reachable.
dbsqlfuzz b9140023005430654c8fe544cf0a082ef8d561c1.

FossilOrigin-Name: 6844ede29e1dac93a392dfb1e7e676bb9d0a2e7bbec0a4a5804ffc2025a99b66
2021-09-09 19:19:02 +00:00
drh
30ad4a6932 Improved database corruption detection in the editPage() subroutine
of the btree rebalancer.
dbsqlfuzz f035b1b5a100a5f0cffb95c958b6c67d7c5eaf1f.

FossilOrigin-Name: 00286ca5d998d80214d5e8d501a3b305f432cda1c0ef67ca530e1219565909b7
2021-09-09 14:03:55 +00:00
drh
59bccb2637 New test cases added to fuzzdata8.db. No code changes.
FossilOrigin-Name: 51e5aadafe1a4ba6a0be7fc1732d1ec940cbc5e23723b76267c2abf887d713ac
2021-09-07 19:23:32 +00:00
drh
55b8b73e74 Fix ALTER TABLE DROP COLUMN so that it generates valid bytecode even when
operating on a corrupt database and using PRAGMA writable_schema=ON.
dbsqlfuzz 5f09e7bcc78b4954d06bf9f2400d7715f48d1fef

FossilOrigin-Name: b65f4f763979ee9e0b943c787609ea22d6f7e01d41dfc1e084ec50a085a3550c
2021-07-22 18:22:51 +00:00
drh
e46292a920 Improved rebustness in sqlite3ExprListDup() when it contains a vector assignment
from an UPDATE where the initial term is omitted.  This can happen during a
UNION ALL query flattening while processing a virtual table update in which
the first term of the vector is repeated.
[forum:/forumpost/16ca0e9f32|Forum post 16ca0e9f32].

FossilOrigin-Name: 2547cfe38f8fb35109b3fc5bdfada387fe4b2b8a304156b704ab7f03f1f71198
2021-07-05 02:40:29 +00:00
drh
4d2c20331a Load recent dbsqlfuzz cases into test/fuzzdata8.db.
FossilOrigin-Name: a766bba0eead47e9ff24b6afd152a7fbd331261e04dd76feb9510585a08c5786
2021-06-20 22:52:51 +00:00
drh
35e6cd09f2 Reapply two recent ALTER TABLE error checks that turned out to be necessary
after all.  dbsqlfuzz fc5a9deefda00dda914748985155a6d4c44174e5.

FossilOrigin-Name: 230fedd923c87741d20caf55f29e8464cc6df344536f9b89331e0a0059a926f7
2021-06-11 13:18:56 +00:00
drh
18f9be897d Remove two assert()s in FTS5 that checks for database corruption right before
actual code does the same check.
dbsqlfuzz 9680db8f5338cb9b6060eb3a02d984555d4472e3.

FossilOrigin-Name: f3f82967b2e9fd4168d86300138ac4bbcd6ffd7a3ff5ecf20acdc29e5356ac3b
2021-06-08 23:46:59 +00:00
drh
09c69fc1b3 Add recent dbsqlfuzz test cases to test/fuzzdata8.db.
FossilOrigin-Name: 162022003c2b4a393296939e2616bd3c7bbfd65b198ba6c9894e4234de2d3122
2021-06-07 14:21:03 +00:00
drh
b6b06bb339 New dbsqlfuzz cases added to test/fuzzdata8.db.
FossilOrigin-Name: 5bb5c9ec049488f95e47bbd9f1db9038ffabad3cfafa613acdaa790ab4034eee
2021-05-24 12:13:10 +00:00
drh
93ffb50fcd In the MULTI-INDEX OR query plan, code for sub-expressions can sometimes be
generated twice.  But for some subqueries, generating code off of the same
tree twice causes problems.  So now MULTI-INDEX OR makes a copy of the
sub-expressions it uses to avoid code-generating them more than once.
dbsqlfuzz 9ebd2140e7206ff724e665f172faea28af801635.

FossilOrigin-Name: 4a55f72542c8bcc80253aa77043314cecb29d73cb4f51aa80f7811e86cc8ef68
2021-05-18 19:10:10 +00:00
drh
5e26d07d62 Update test/fuzzdata8.db with recent dbsqlfuzz finds.
FossilOrigin-Name: bce2ea393a872b5b70ef3b9cedce3d406725dcc56d8800ee4f7ec29562cc3f9b
2021-04-29 10:48:50 +00:00
drh
d8bc250b91 New dbsqlfuzz cases added to test/fuzzdata8.db.
FossilOrigin-Name: 88d20500c516fe89ad1cd42f7366ca190c3790f911f11ab332b86b675f5f69ba
2021-04-26 22:30:49 +00:00
drh
113a33c539 Make window range queries more robust against corrupt database files.
dbsqlfuzz f22df3a7b2aab0937a415484514fc2f68a293c99.

FossilOrigin-Name: 506333742103c1f440db5da819a36f3b518f7b49e94a7b74419b02bbcadc5a78
2021-04-24 23:40:05 +00:00
drh
d84f10ed13 New dbsqlfuzz cases added to test/fuzzdata8.db.
FossilOrigin-Name: 8da88508932e475c8c6af1553268ff02e3e013b78ccc94b14532ec928fc62537
2021-04-23 11:50:23 +00:00
drh
7437c25b63 Add recent dbsqlfuzz test cases to test/fuzzdata8.db.
FossilOrigin-Name: 6fe50dcc239d2d1fc2a38aa705f4c75cbe26b3e48d098537306d96d6a4005659
2021-04-21 12:03:36 +00:00
drh
48a6aede46 Add new dbsqlfuzz cases to test/fuzzdata8.db.
FossilOrigin-Name: d18793e589a4ee7706e994a1f3d24ba7df190467d92fa6ac040258f4debc149d
2021-04-17 18:39:39 +00:00
drh
188ba3a979 Add new dbsqlfuzz-generated cases to test/fuzzdata8.db.
FossilOrigin-Name: 1ac0a056a07895cc4ae62d01cbba5525402be3af3b8f97fd1dfaba2236ef912b
2021-04-16 19:25:47 +00:00
drh
4ffaffe657 New test cases added to fuzzdata8.db.
FossilOrigin-Name: 039ad662dd899048da04238c05b8cf384323f6e8c1087b96428ea9e20726c8c0
2021-04-06 16:55:30 +00:00
drh
9ce612a66f Add a missing CORRUPT_DB to an assert in the OP_ResultRow opcode.
FossilOrigin-Name: 82f92d79e1901911b0ce57d0aa30d462847748159443c7db8af16e6b37e8212c
2021-04-05 22:30:56 +00:00
drh
319deefdb9 Fix an assert() in sqlite3BtreeLast() that needs an "|| CORRUPT_DB" term.
Dbsqlfuzz case b92b72e4de80b5140c30ab71372ca719b8feb618.

FossilOrigin-Name: ad718388a1f6e25ceba43a40160fac0d9d9d3f26888e98d7b9db478c0b1780be
2021-04-04 23:56:15 +00:00
drh
fad1ad0526 Fix a harmless assertion fault resulting from [6e6b3729e0549de0] that was
discovered by dbsqlfuzz.  Enhance .selecttrace output to show omitted
ORDER BY clauses.  New dbsqlfuzz test cases added.

FossilOrigin-Name: 27a0388ad616f80e8dcc986c247a5c23a8565dae9081b04ff85bac0d357e531b
2021-03-03 14:07:52 +00:00
drh
9e673ace5b Improved corrupt database detection in balance_nonroot().
FossilOrigin-Name: 5d54d9fd406381383afdf10612bfd590afc4142215d9bca09e227e3aa5baa102
2021-02-01 12:39:50 +00:00
drh
0a8b6a9f8f Enhance the sqlite3BtreeTransferRow() routine so that it does more careful
checks for corrupt database pages.

FossilOrigin-Name: 85952e71175dae73c4e587a3b80783825d91fe8567a819e072da651c1ff4131b
2020-12-16 21:09:45 +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
53218e2e2c Back out a NEVER() that turns out to be reachable.
FossilOrigin-Name: 8cf342d4e5eb67b17aee595d9d75f7798eccaebc1ec88e646d344d8d4ab64977
2020-07-31 23:34:53 +00:00
drh
bc2cf3b295 Early detection of freelist size corruption in incremental vacuum.
FossilOrigin-Name: f25a56c26e28abd44373230c6b5763aed35c9a7648abede8a53409dccc0bee1d
2020-07-14 12:40:53 +00:00
drh
a1085f0640 Improved detection of a corrupt database schema. Fix for a problem discovered
by dbsqlfuzz.

FossilOrigin-Name: 30735432bc33cb953b6d7d2a2de9eb378f9740e0e663f50c727c3f138cd43a2b
2020-07-11 16:42:28 +00:00
drh
d8d335d737 Fix a possible null pointer deref following OOM. Discovered by dbsqlfuzz.
FossilOrigin-Name: cc888878ea8d5bc754c69de523819d32d6d9853857e31d7287f9dbfd723428db
2020-06-26 04:34:28 +00:00
drh
dc8339eaac Add a test case covering the previous check-in to the test/fuzzdata8.db file.
FossilOrigin-Name: 95379da0e1ad5110648a5b3af24e7caab66a6f1ad6efdf374c83ae4ef1fed515
2020-06-16 14:12:43 +00:00
drh
0dc90d43e5 New test case added to test/fuzzdata8.db.
FossilOrigin-Name: 14a5cbddc887e23a684fabab1a213cce261bd6cffa0663d4f138b92d0b65b9c2
2020-06-12 15:45:02 +00:00