Commit Graph

110 Commits

Author SHA1 Message Date
drh
0d201598a5 Enhancements to the "randomjson.c" extension. Automatically load that extension
into fuzzcheck.

FossilOrigin-Name: 70620405ab01d6a5d38bafa9ae175fd6e4eabaf2efb7854734278dafd7b05c99
2023-12-17 20:41:48 +00:00
drh
7445659559 Activate JSON_SELFCHECK within fuzzcheck.
FossilOrigin-Name: 4d14e733bb521aed65e98533969d2303738232ae87dab70fdf7962e6513195f5
2023-12-11 19:21:06 +00:00
drh
3404b452a4 Fix another UBSAN inaccuracy in fuzzcheck.
FossilOrigin-Name: a6fb9de8f87261194e6034376f62b1cac30b764f106dd3adcf728e020f8a4fd5
2023-08-21 14:40:19 +00:00
drh
114ad2f86f Address minor inaccuracies in fuzzcheck and RTREE found by UBSAN.
FossilOrigin-Name: a64e6c2fd8ef1d2d7f14aa9265629853298bbc480c2683c79dfd24847a61b68b
2023-08-21 14:28:47 +00:00
drh
f0eabde9a4 Enhance the CLI and the fuzzcheck utility programs to report whether they
are compiled as 32-bit or 64-bit for things like the --version option.

FossilOrigin-Name: ec7eeb055bfb0e5a4467d8a45fa53d84bb8ae80ca0474b687e2783e971648008
2023-08-18 12:15:44 +00:00
drh
6bbc5b3730 Enhance fuzzcheck so that it understand the sqlite3_db_config() and
optimization settings from unused bits in the database header, which
dbsqlfuzz is now using.

FossilOrigin-Name: 918708c6dea5bffab4bb1c15d655ac7356bae97b84def905479dfcf491db6c5f
2023-06-10 10:37:49 +00:00
drh
307db965c6 Add the --wait command-line option to fuzzcheck.
FossilOrigin-Name: 5a479a2c7637a018d1828d9d37973bf3d36a2fc4cd5b752bca61a41cd0920d39
2023-05-15 10:55:04 +00:00
drh
5b6ba9b250 Improvements to query invariant testing such that it uses the new
SQLITE_DBCONFIG_REVERSE_SCANORDER opcode to sqlite3_db_config() to make more
accurate judgements about when a query is ambiguous, and hence when query
invariant testing is approprate.

FossilOrigin-Name: be9ab292cd14889b1c9648b47138260b33fe5be282ff2d90653b1387885a7d02
2023-03-06 23:38:44 +00:00
drh
f1f4f090c7 Activate SQLITE_DBCONFIG_STMT_SCANSTATUS in fuzzcheck.
FossilOrigin-Name: 4fe1419ac3161ea8735241b04913593170c636cf3e1583756fe94edd396cd38b
2023-02-28 21:23:46 +00:00
drh
e88b209874 In fuzzcheck, only show the description of each database if the -v option
is specified.

FossilOrigin-Name: 6a58179aaffa77a5542ab620ffce6f68135e399de957b1a97113fd2f1dc0c098
2023-02-05 17:09:18 +00:00
drh
2cdcc7f01a Clarify documentation regarding the --recovery-db option to ".recover" and
the magic 789 configuration option it is associated with.

FossilOrigin-Name: f6fa0cffa921ccde8910e7fa4a63c2e4ef8ddb376c8ce99e436b27ac332c4498
2022-11-02 14:08:26 +00:00
drh
71b65e88e8 Add sqlite3recover() support to fuzzcheck.
FossilOrigin-Name: e65c5bdc5bd6e1989c3de59798ff0a761125fc490fdec8c7671ca70ed688c4f8
2022-10-28 18:35:06 +00:00
drh
13736999d9 Enable query invariant checking in fuzzcheck by default. There is no way
to turn it off.  Update the invariant checking logic to be consistant with
dbsqlfuzz.

FossilOrigin-Name: 66ca729bbbf37cb7ff8eb12f51429e0c0833bd5d3f0ef20a1eaeeb10820713c2
2022-06-18 20:20:30 +00:00
drh
c2beb0d8f6 Omit the --query-invariants processing in fuzzcheck for queries that contain
the implies_nonnull_row() test function.

FossilOrigin-Name: 0602a0844893465ac2fe53c0fa648a5cbcbc6452fff6181c42fab517f047b583
2022-06-17 17:11:51 +00:00
drh
f26e45139e Do not run --query-invariants on statements that make use of
sqlite_offset().

FossilOrigin-Name: c5ac4cbfb173c613d633b2c76484d735073692d001a336576174201b8f9af7b1
2022-06-17 16:52:54 +00:00
drh
63880362ed Improve query-invariants to the point that it would have discovered the
[f23a429d4153518d] bug if that bug had not already been fixed.

FossilOrigin-Name: 2a7251ed9c4c959b6df75172159c6b4445e1c2212e357d2c49ab8fa19cb3ac11
2022-06-17 16:09:47 +00:00
drh
c68fb84759 Only run query-invariant checks after the original query has run to completion,
so that we know it does not error-out on a subsequent row.

FossilOrigin-Name: d1fc857bb8dcd5914f5a9bbcc4efe5f4abe19a190e42e2c923b28327a95e4de6
2022-06-17 15:52:43 +00:00
drh
36f904f065 Fix the virtual table detection mechanism to avoid false-positives that were
blocking all failures.  Then fix a few of the additional problems that are
revealed by that fix.  More fixes are needed.

FossilOrigin-Name: 42b2e6676fed1508ea0ba17c292e83134825469735700da97817c45d45c54e66
2022-06-17 15:11:31 +00:00
drh
8f9261a8e9 Improvements to query invariants in fuzzcheck.
FossilOrigin-Name: 3a461f61b47e6ba6d5dcc2b7470ebde512b57bc68086f65050e07b06f42b7351
2022-06-15 20:18:44 +00:00
drh
e3bf2c8e9b Improvements to query invariant checking in fuzzcheck.
FossilOrigin-Name: 56c60a35ea457f06db58ec3f694a1ae16fd03e6625da1d7879d63d72bbcb1c62
2022-06-15 16:26:37 +00:00
drh
0c278c3d76 Add the --query-invariants flag to fuzzcheck. The query invariant checks are
only run if that flag is enabled.

FossilOrigin-Name: d13b4621291831ff33cc4a8d53653eaa3f59fecf2fbc5d404db17e33a914495d
2022-06-15 10:46:52 +00:00
drh
a1f79dae98 Attempt to enhance fuzzcheck to do some simple invariant testing on queries.
This is an incremental check-in for a work-in-progress.

FossilOrigin-Name: ce2d780163b3a28486904860a1815acc4169c09b971cfd199bb58d1e9a57b000
2022-06-14 19:12:25 +00:00
drh
0fab10991b Add a compile-time option to include vt02.c in fuzzcheck.
FossilOrigin-Name: c404c8c72600c11b181519d269bf949aff304eaafb90a50d1415c6fe84d2b092
2022-02-04 19:13:18 +00:00
drh
81258cc911 In fuzzcheck, improve the defense against long delays due to
rogue busy_timeout macros in fuzzer-generated scripts.

FossilOrigin-Name: 3024d7ca03541a6fe3d264fdc82dd49f8f6b51d2fbeec4dfc9c6dd72806b271a
2021-11-22 13:59:06 +00:00
drh
be2d6fdd71 Fix a harmless compiler warning in fuzzcheck.
FossilOrigin-Name: 1cfb7e8a095e1e24df5117aa7be97470d8ce91837ff83dabebac53fafee0b09c
2021-10-27 15:16:30 +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
075201e50f Add the --script option to fuzzcheck.
FossilOrigin-Name: 5a9676bd4945ca098652780515e94d04859e73588d9db5558ab42f8b068a9ddb
2021-10-27 12:05:28 +00:00
drh
48b4bf269c Enhance fuzzcheck so that if an argument is an ordinary disk file (not
a database) it is read in and processed as a script.

FossilOrigin-Name: 978dc89df521f5855678128b3c0eb503c67c1b97ddb297076e5f2c03d6297605
2021-10-26 22:36:41 +00:00
drh
629c2eaf46 Fix the busy_timeout restriction on fuzzcheck so that it can deal with
hexadecimal integer literals.

FossilOrigin-Name: 4b41535b096dec4b15a85e657102a72d4288728da6103f3fdcbe0e6f244c673a
2021-10-26 09:53:51 +00:00
drh
63e8f03c78 Do not allow large busy_timeout pragmas in fuzzcheck, as they accomplish
nothing other than making the tests unnecessarily slow.

FossilOrigin-Name: fba441bf9f6ed729a66ccd4e42b5a8859bf3952d70a66bc9a2496ec49d90a60c
2021-10-25 12:54:23 +00:00
drh
c8f7211d8f Improve the authorizer filter for ATTACH on fuzzcheck.
FossilOrigin-Name: 87d49e80878674470d280de79c8ade222dd006e65c90e79616c4f72c7c32dabb
2021-10-23 22:14:11 +00:00
drh
be53656171 Update fuzzcheck so that it allows ATTACH statements with memdb filenames.
FossilOrigin-Name: 31671237e560b52dc27f707309269069a6bdcd017df9844908e77b57dc11f180
2021-10-23 11:30:35 +00:00
drh
9d41caf361 Fix a harmless compiler warning in the "fuzzcheck" test program.
FossilOrigin-Name: 8c432642572c8c4b7251f413def0725b3b8e9e7fe10230aa0aabe86b58e5902d
2021-07-07 19:44:32 +00:00
drh
0fcf6f01e7 Minor comment improvements in fuzzcheck.c.
FossilOrigin-Name: 7aca8d52c16c2192d9c1ff03a976c482a60365cef8d2474b540ff4c84e8737b4
2021-05-24 12:28:13 +00:00
drh
5960724789 Fix the operation of the "-" argument to --load-dbsql in the fuzzcheck program.
FossilOrigin-Name: 1f18b3cbee7e1342fdd66e45ef744fea3db2ba4513943c0582ff8ef98974865e
2021-04-29 18:03:42 +00:00
drh
1521270010 Fix harmless compiler warnings in fuzzcheck.
FossilOrigin-Name: e7b4ffecc610c494ebd506977402ec48cc799780f96c6293c0ccf27697160aa1
2021-04-23 13:57:53 +00:00
drh
ba6619d7be Enhance the --load-dbsql and related options of fuzzcheck so that if the
argument is a single - then filenames are read from standard input.

FossilOrigin-Name: e1548802b6de7037baf388d27a7f3658abafe07b6f48d5ec97e5f644303592d8
2021-04-23 12:58:16 +00:00
drh
292ed6decf Give a better final output line for the --spinner option on fuzzcheck.
FossilOrigin-Name: 93729614e21ee674b83b0d2babb71bb758f1a2ec55bf9bda057fb7739f2e14e0
2021-04-23 12:16:16 +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
8df014979e Fix the dbsqlfuzz-derived authorizer in fuzzcheck to avoid creating junk
files when running rogue tests.

FossilOrigin-Name: eca21a620630b0c8d21a91ad6a8760a6c87270ab2a45cafa18bd31b305c53dba
2021-03-18 14:36:19 +00:00
drh
4d17e30624 Improvement to the ATTACH-abuse authorizer logic in fuzzcheck.
FossilOrigin-Name: 88132f698a7a9b7d41dd1dd393592cbda130d2bf1a9fd18c509503e1891b9655
2021-03-10 17:52:59 +00:00
drh
657a7a66c3 Update the authorizer in fuzzcheck to align with dbsqlfuzz.
FossilOrigin-Name: f86d8fae3b29de014d8bfcae38a15bdb15ddceabfcfff7829f3145cfd69dff2a
2021-03-09 13:12:58 +00:00
drh
7ae0549961 Enable internal functions for fuzzcheck.
FossilOrigin-Name: 79281603b951b438303130820deb6b05baeca366c2cd93be7d8909d3232bcc96
2021-03-08 16:13:52 +00:00
drh
237f41ab8d Add the --timer option to fuzzcheck. Get the --timeout option working in
fuzzcheck when running dbsql tests.

FossilOrigin-Name: 3b0c9b41a877c7344ef3b7c5b6981436005716e25b41b1a1ffc145520243abd3
2020-12-21 12:14:59 +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
4b3282d8a0 Limit LIKE/GLOB pattern length to 100 bytes (default is 50K) when running
dbsql cases in the fuzzcheck utility.

FossilOrigin-Name: 10306118e8591e727af477a1a15d136852d21170e645bd0e75f7c88346b037d7
2020-04-07 15:07:11 +00:00
drh
aa0696ee9a Add the --spinner option to the fuzzcheck test program.
FossilOrigin-Name: b1eae2686f03a6e20a49ca2b3a654b3019506d4941708ee3919c339cd093a57d
2020-04-07 13:08:56 +00:00
drh
f0a2172d1d Fix an integer overflow problem with the dbstat virtual table that comes up
when trying to analyze a corrupt database.

FossilOrigin-Name: 1d64f4a8af81fe1235fffa54884d8f842a48ff6a33d6172f0cd65bf42fe8b2a1
2020-03-19 17:27:52 +00:00
drh
39b3bcf8ef Enhance the fuzzcheck test program so that it is able to simulate OOM errors
in the same way that dbsqlfuzz does.

FossilOrigin-Name: a65c8d4e26b2428ecb8232a4a6a44443aa1701319223397e61a823a5aa1827de
2020-03-02 16:31:21 +00:00
drh
a8781d9d93 Update the fuzzcheck test module so that it avoids inserting text values
that contain embedded NULs in the XSQL table.  Fix some legacy entries in
the test/fuzzdata8.db that had embedded NULs.  Add in new dbsqlfuzz cases
that have accumulated over on the dbsqlfuzz project for a while.

FossilOrigin-Name: 47d4240c4a837e829f593bb2aad7563010838f55345e7a0d8e2ea79462aeeb3c
2020-02-25 20:05:58 +00:00