Commit Graph

29 Commits

Author SHA1 Message Date
drh
8755e695c5 Fix an off-by-one error in the routines that bind the special $test_TTT and
$int_NNN parameters for fuzz testing.  Fix to testing logic only - no changes
to the SQLite core.

FossilOrigin-Name: 6206b90a4ec3f05e3bbb4844e71569bbde7df237550569e6419ff7c3146505dc
2024-09-07 16:04:04 +00:00
drh
deb6a60a84 Fix harmless compiler warnings.
FossilOrigin-Name: 60fb8ee153ec293b6b3a4170dafa305e4c16af575aced72daef46116d8dc2bb6
2024-09-06 11:21:53 +00:00
drh
1107b4b9cf Bind the new debug parameters in fuzzinvariants.c.
FossilOrigin-Name: 7e1dc263051cf50db04643d1a2aa9f91559b2b121859b750ce4446012d5f3c3e
2024-08-09 12:35:27 +00:00
drh
ac94cf3ece Enhancements to the fuzzer invariant checker to turn optimizations on and
off.

FossilOrigin-Name: 67594481379824823105939fea2ce1fe280667f6db91735ac78b4b6164a78dab
2024-04-08 06:37:19 +00:00
drh
fa4c4247a5 Omit all rowid-in-view restrictions from the fuzzinvariant.c test module
as they are no longer necessary, as of the previous check-in.

FossilOrigin-Name: 6431538f0bb3bb8606786f3c3e5c055c4bc387098dd3bdc8a94f6fda61c47f52
2024-04-07 18:36:32 +00:00
drh
8181cc6c10 Improvements to the accurancy of the fuzzinvariants.c testing module when
SQLITE_ALLOW_ROWID_IN_VIEW is defined and the test query involves rowids.

FossilOrigin-Name: c6e873d4db3ef36a0d561e64ead6feada5d1654c0757b4b6e55f671c9db66469
2024-04-06 17:37:30 +00:00
drh
967c303212 Fix the fuzzinvariants.c test module so that it does not generate
invariants that depend on rowid when SQLITE_ALLOW_ROWID_IN_VIEW is used,
since rowid values can be unreliable in that context.

FossilOrigin-Name: 0d711aaaa14472a82f8893e1b07d845073f3d018bd5b8093ec0b00ffbbc8cd5a
2024-03-19 14:38:39 +00:00
drh
7a9c235aaf Additional debug/test output from the query invariant checker showing the
row-number that is being checked.

FossilOrigin-Name: e4b6eb58e65f7fa0c92768f42bc820614169b7c2f37ded391b866ddb0d894de0
2023-03-16 12:28:48 +00:00
drh
db8c6aa03a Update the tracing output for the query-invariant checker such that it shows
the SQL that is run to verify that a found query-invariant discrepency is
valid.  Changes to testing logic only.

FossilOrigin-Name: 8f45ad27403e971d88ec62e674c03f82eb19df0b43aa58d20b3400cdb6611d90
2023-03-16 11:50:44 +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
a9d18d83fc Disallow some of the query invariant tests on SQL statements that contain
a GROUP BY since output terms that are no covered by the GROUP BY are
indeterminant.

FossilOrigin-Name: 28ba1fec4519e7ca9466f1a2f787c905f2cf880d38a004639f99f948e46a51e7
2022-12-16 18:32:07 +00:00
drh
d980442188 In the fuzzer invariant checker, do not add new WHERE clause terms that
make use of an ambiguous column name.

FossilOrigin-Name: d5b46541c30bcbeb7e57b5b5951856d564e81f7f9638d66d205157797964418c
2022-12-16 12:07:48 +00:00
drh
053bb22f35 Fix harmless compiler warnings in testing code.
FossilOrigin-Name: 2f53612388507f9b1ecbec3c15281825beab54b8062d97d0ab6f009c5fed347b
2022-10-28 18:52:05 +00:00
drh
2d75c1aa3d Update the fuzzinvariant logic in fuzzcheck to the latest code from
dbsqlfuzz.

FossilOrigin-Name: 739ad584765f1fc0eb196db870785da1726805cc2d9dd0a831a37a9e55a4afe9
2022-10-24 12:38:32 +00:00
drh
1ffb6be119 Updates to the fuzzer query invariant checker - tracking changes made
over in dbsqlfuzz.

FossilOrigin-Name: 4ca16a304ad10fbb48f78b4384b347fe883e1a4f222f113ac981e89845c3e113
2022-10-12 18:40:25 +00:00
drh
703c208d30 Update the fuzz invariant checker to conform to the latest changes in
dbsqlfuzz.

FossilOrigin-Name: 8d8c124349d2a25200ace9a60d76751594b722468ad0c39d927a5d2c6e2464e0
2022-09-20 17:21:54 +00:00
drh
2a40a882f2 A minor fix to test/fuzzinvariants.c so that it works even with column names
that originally contain a ':' and that are disambiguated.

FossilOrigin-Name: 8d9b1fff9d87522c4464aaf3ff0a7b93db244c59b4010562e35a8f161da4859b
2022-06-24 11:02:42 +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
d0d21f5565 Abandon a query-invariant check in fuzzcheck if the call to
sqlite3_bind_value() returns anything other than SQLITE_OK or SQLITE_RANGE.

FossilOrigin-Name: d31e1cd2ab44c7cce20b8990dff17719c286dd2fb46ba6d4f581a9553cf31891
2022-06-18 14:50:43 +00:00
drh
8fa6206bc4 In the --query-invariants option of fuzzcheck, correctly deal with OOMs
causing the return value of sqlite3_column_name() to be NULL.

FossilOrigin-Name: eabbee4a51bc1a865bddee890004ff3a1c9cc6b797b21f73e908642e154cef50
2022-06-18 10:26:12 +00:00
drh
ea64cb31a5 Allow integers and floating point numbers to compare equal.
FossilOrigin-Name: 0fe2e465ba931d4bceaf171693d2ee7af45a5f96840e65e9d4ee4a2e60f155d8
2022-06-17 16:32:21 +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
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
6efabd6cd3 Fix the new --query-invariants option on fuzzcheck so that it does not
use an unprotected sqlite3_value object as an argument to sqlite3_value_int64().

FossilOrigin-Name: d9f820151d74a690b5fa560597a5b3ace20165a112e1b58cb4a7c47b42745643
2022-06-17 12:25:33 +00:00
drh
3e245bcef3 Minor fix to the query invariant testing logic of fuzzcheck.
FossilOrigin-Name: 447e62a0946f5d77b7358adcabaeb23a7012cdfbfa1ef6082734cd9b45b2699d
2022-06-16 20:29:36 +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
a913f9b992 Improvements to query invariant testing. Almost working now.
FossilOrigin-Name: e039820418d64fb57cb1a8f9f21186284e6c76255a53445c5d7aef6cca89bfc4
2022-06-15 10:37:16 +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