0
0
mirror of https://github.com/sqlite/sqlite.git synced 2024-11-25 00:49:41 +01:00
Commit Graph

24345 Commits

Author SHA1 Message Date
drh
62f1b48638 Increase the version number to 3.40.0 so as to begin the next
development cycle.

FossilOrigin-Name: 4542e32302067f24bf71c77620e09663f47c3ddce703c21ffa82d09532ae1d51
2022-06-25 19:30:07 +00:00
drh
3691e56210 Fix documentation type. [forum:/forumpost/8d900996ed|forum post 8d900996ed].
FossilOrigin-Name: 869061f18d2f2f500451c87ab62d3ca71a5321d5246b2e2c7bf960e48c6b5250
2022-06-25 18:55:08 +00:00
drh
47d8c40ca5 Version 3.39.0
FossilOrigin-Name: 14e166f40dbfa6e055543f8301525f2ca2e96a02a57269818b9e69e162e98918
2022-06-25 14:57:57 +00:00
drh
a36fedbda0 Change a harmless assert() into a testcase(). The actually test case code
is in TH3.  Fix for the problem described at
[forum:/info/ed29e196d5c4f3d5|forum post ed29e196d5c4f3d5].

FossilOrigin-Name: cd6254fcd32798f7be4e6d827597ddaa2e46ac6e2f0149cd3a3be0416fa18835
2022-06-25 02:39:29 +00:00
drh
86bc5e41bb Fix a harmless UBSAN warning associated with PRAGMA schema_version
found by OSSFuzz.

FossilOrigin-Name: e93fd170ce4ae91d572c46d03f68f55d00091d0188030517455017d90d212587
2022-06-24 12:56:48 +00:00
dan
a5ec23a705 In sqlite3WhereBegin, do not proceed with coding the loop if an error is detected as part of WHERE expression analysis.
FossilOrigin-Name: db5266dec601a9513bc8dd09a9f8bb4aef55b780d22610946099e8edd4836587
2022-06-24 11:05:36 +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
9efc618607 Minor correction to a comment. No code changes.
FossilOrigin-Name: 5fa00959ebc3a46fe400564d5a30e8c44857cd4f0473fb25e84154019eff3f39
2022-06-23 12:36:56 +00:00
drh
2b0ea0204f Enhance the TCL scrip that generates sqlite3-all.c so that it outputs all
text in its original order.

FossilOrigin-Name: 83ff1a28e3e7a99fa90d5079897d76529c4256eed859bf7cb98b860fbedfdc5b
2022-06-22 18:51:47 +00:00
drh
f221e4b5d6 Fix requirements marks that changed due to typo fixes in the documentation.
FossilOrigin-Name: 5247df05991df979024df5a30bb3473401add92d4c12b01c040a16dda6da39f5
2022-06-22 18:33:21 +00:00
drh
cf5cab01cf More comment fixes. No changes to code.
FossilOrigin-Name: 5c9133ef431a031249760267ca851239d0857ffba633cac27d3865cf179c3274
2022-06-22 15:55:28 +00:00
drh
0751fc3b85 Allow more line with on the debugging output for SrcItem elements in the
parse tree.  This affects debugging builds only and is a no-op for production
builds.

FossilOrigin-Name: edbe24e7fc81ab6c26ab05f2231cb46d157d71a677ce8a2983e0c6e48122a2bd
2022-06-22 14:43:52 +00:00
drh
2591cfb673 Additional enhancements to comments. No changes to code.
FossilOrigin-Name: d9a320448f5693d906adf437800675cd4773701db065f3ed238b933fb80f6681
2022-06-22 14:25:12 +00:00
larrybr
b885744709 Give dbtotxt an option to prepend .open --hexdb
FossilOrigin-Name: afeee6125d141ae281658a5f7b73e9b77bc252fa387678b2b5837488180bf108
2022-06-22 14:00:24 +00:00
drh
861ac67a9d Fix a typo in a comment. No changes to code.
FossilOrigin-Name: ef9de201b33678a80bb27c5be8f9dc973c8a4f14af9bfdd3ace36887c8a591ea
2022-06-22 12:54:25 +00:00
drh
8c44962aaf Disable the short-cut query planner if the NOT INDEXED modifier is used.
[forum:/forumpost/454d706296|Forum post 454d706296].

FossilOrigin-Name: bd87d107fe474ceeac8bacb01c80bc479edbc2ae4e30697bf54ab91a5a8d2a98
2022-06-21 18:38:18 +00:00
drh
b9294de1e6 Allow a HAVING clause on any aggregate query, even if there is no GROUP BY
clause.  This brings SQLite into closer agreement with PostgreSQL and fixes
the concern raised by 
[forum:/forumpost/1a7fea4651|forum post 1a7fea4651].

FossilOrigin-Name: 9322a7c21f1c22ba00e9b889223e89bc1591db6e561ce05091e905e98c1bf2b3
2022-06-21 13:41:24 +00:00
drh
4af6462fb8 Add an ALWAYS() macro to an always-true branch.
FossilOrigin-Name: 364645d8fe22491cd566e868027e739464205e892753356016b1988ead207af4
2022-06-20 19:12:57 +00:00
drh
436c28a265 Do not allow FROM-clause terms on the left side of a RIGHT or FULL JOIN to
be reordered. [forum:/forumpost/6650cd40b5634f35|forum post 6650cd40b5634f35].
This is probably more strict that necessary to get correct behavior,
but for the first release that supports RIGHT/FULL JOIN it is perhaps better
to be correct than fast.  A less strict constraint might be to prohibit
FROM-clause terms that originate on the left side of a RIGHT JOIN from
crossing from the right side to the left side of a LEFT JOIN.  Revisit this
later.

FossilOrigin-Name: 238453ffab0ba1bdddb529be35da82d5e8fb312a9574003a5441f455e601a909
2022-06-20 18:26:14 +00:00
drh
d7480403bc Do not allow an ON clause to references tables to its right if there is a
RIGHT or LEFT join anywhere in the query.  Other RDBMSes prohibit this always,
but SQLite must allow ON clauses to reference tables to their right for legacy
compatibility, unless there is a RIGHT or LEFT join someplace in the query,
in which case there is no legacy to support.

FossilOrigin-Name: e615dbe02ca949252d1526ed5c48f8ce08159773ea2008ce666484379d0d9854
2022-06-20 17:04:44 +00:00
drh
ae8776e092 The fix at [cab9b4cccd13bf0a] was incomplete, as demonstrated by
[forum:/forumpost/57bdf2217d|forum post 57bdf2217d].  This check-in
should complete the fix.

FossilOrigin-Name: fb0a23b6789da8e934562ce9ebd9d58ea13a10fd10dee5cbfc7ac8f394e1aeec
2022-06-20 12:42:28 +00:00
drh
1d49768151 Follow-up to check-in [0057bbb508e7662b] - ensure that the database page
has been initialized prior to continuing with the optimization.  If the page
is not initialized, that indicates that the database is corrupt.
dbsqlfuzz 09ee46becd5e6d1b2a55c9f8ad767335a90aadb0.

FossilOrigin-Name: 11162446f12ae3af6e4a63bb5c374129b2505f6006f91d4028c7165f05fe9651
2022-06-19 16:55:07 +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
01156ec1c9 Fix the OP_Concat operator such that when concatenating a BLOB with an
odd number of bytes on a database that is UTF16, the size of the resulting
string is reduced to a multiple of two.

FossilOrigin-Name: 5eb2c23635320b76f5e1aea4d94375b847fe4b38cdb4e287fba188753f4773b1
2022-06-17 21:31: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
b103c574fd Various fixes and improvements to the --query-invariants option of
fuzzcheck.

FossilOrigin-Name: 09aca89b7c26c1eb7f9df1d1cfdada18848d7c188fa7fbbcf95442dabce476ea
2022-06-17 16:39:55 +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
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
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
dan
2a7aff93ed Avoid omitting the rhs of FULL JOINs in cases where it is only correct to omit the rhs of a LEFT JOIN.
FossilOrigin-Name: f23a429d4153518d37387e121f22a30b22e2b31e126ad168e72049a96be86269
2022-06-17 11:39:24 +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
dba3a5ab87 When running an incremental vacuum, detect growth in the size of the database
file (which can only occur if the file is corrupt) and fail with SQLITE_CORRUPT.

FossilOrigin-Name: cd7a44124558ea6a43c89b1cba4402d7bf6a6ccb83be0eeb7dd01b56933bca73
2022-06-15 14:57:04 +00:00
drh
516c85026b Add the --query-invariants option to fuzzcheck. No changes to the SQLite core.
FossilOrigin-Name: fef282f9fbb10967102f9676d85b8c6a3b36aff7109f1becdaeaeddef0dff4f1
2022-06-15 12:50:51 +00:00
drh
10c5341c72 Dbsqlfuzz discovered a case where a bytecode branch is in fact taken, so change
the designator from VdbeCoverageNeverTaken() to VdbeCoverage().  Test case
in TH3.

FossilOrigin-Name: 988a2a759f2b9da0e287e65306039b7a3e2b5aac3d31fe15cbb30d30ea6caf71
2022-06-15 12:32:27 +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
a913f9b992 Improvements to query invariant testing. Almost working now.
FossilOrigin-Name: e039820418d64fb57cb1a8f9f21186284e6c76255a53445c5d7aef6cca89bfc4
2022-06-15 10:37:16 +00:00
drh
27a242c634 Fix the OP_NullRow opcode so that it works even if it applied to an
ephemeral cursor that has not yet been created.

FossilOrigin-Name: 0e925654c24774933c7738c68f704b229c68e18c8baa45f506b8d6f09164d0d8
2022-06-14 22:21:23 +00:00
dan
bbf71138cf Add missing SQLITE_FCNTL_SIZE_HINT call to a path taken during transaction rollback.
FossilOrigin-Name: 6c3266c1b4fc446c7c3a40a8816caf4f9fe0cafe4f27cdafecac61425a17927e
2022-06-14 21:34:13 +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
92d1afba9b Do not remove the EP_CanBeNull flag from expressions during a LEFT JOIN
strength reduction if the query also contains a RIGHT JOIN. Fix for
the problem identified by
[forum/forumpost/b40696f50145d21c|forum post b40696f50145d21c].

FossilOrigin-Name: b1be2259e2e08ec22a88bc9a18b3ab4d83246ad4c635c05cdf80d3eff84df06a
2022-06-13 12:42:24 +00:00
drh
1cc5c4ac84 The same restrictions on the use of WHERE clause terms to drive indexes
in the presence of RIGHT JOINs also apply to the use of WHERE clause terms
to manufacture automatic indexes.  This fixes a problem identified by
[forum:/forumpost/51e6959f61|forum post 51e6959f61].

FossilOrigin-Name: 342c501f532523347e6c339351e02043dd6ee9e11a291224b65ea72bd6c2ba40
2022-06-10 16:41:54 +00:00
stephan
e45b87a9b7 fiddle: minor style tweaks, including using swapped colors for the input/output fields to help (hopefully) reduce the "which field is which?" dissonance.
FossilOrigin-Name: e25dad868f9ef2c7847319c9f6f106999ba8b0a3e09ed9edfbd25e8fc6f3c10e
2022-06-10 15:43:03 +00:00
drh
958fcd417c Do not allow constant propagation between WHERE-clause terms and ON-clause terms
as this can confuse RIGHT JOIN.  Fix for the problem reported by
[forum:/forumpost/8e4c352937e82929|forum post 8e4c352937e82929].

FossilOrigin-Name: cab9b4cccd13bf0ab2bc38dc9a9c04ddd34e29c65ab6aef07b6bb3c31a43bece
2022-06-10 11:28:52 +00:00