Commit Graph

24389 Commits

Author SHA1 Message Date
drh 48fa01e4a8 Version 3.39.4
FossilOrigin-Name: a29f9949895322123f7c38fbe94c649a9d6e6c9cd0c3b41c96d694552f26b309
version-3.39.4
2022-09-29 15:55:41 +00:00
drh e18246199a Fix misuse of the sqlite3_set_auxdata() interface in the ICU extension.
FossilOrigin-Name: 6607dd010359d0f2e07e49ce69d4bfd1e57c3505df5d667cf7735facf34112d7
2022-09-28 19:19:11 +00:00
drh 76167f96b0 Remove a NEVER macro in defragmentPage() that dbsqlfuzz discovered can be
true.  crash-32d9312f145cdce41613573f6431d9a3e439e3d7

FossilOrigin-Name: a4342fc020a41bc5eed2d8f02ec4a759a78c5b0cbc1ae5e8dc167dcc69aa698d
2022-09-28 13:38:49 +00:00
drh 3ec786ab9c Enhance defensive mode so that it disallows CREATE TRIGGER statements if
the statements within the trigger attempt to write on a shadow table.  Also
make the legacy FTS3 code more robust against integer overflow during
memory allocation.

FossilOrigin-Name: c41f25e6f3591e575452c4c68f8072a0163cc00d80af31f90d407c7deca79622
2022-09-27 02:04:52 +00:00
dan 8cf7bedb81 Enhance the b-tree page sorting code to ensure that sqlite3PagerRekey() never
overloads a page number and uses only the PENDING_BYTE page for temporary
storage.

FossilOrigin-Name: aa6a5b729782dee75f14ae4e780302c4446074c20d1eb300346fbe874eb64706
2022-09-10 13:50:33 +00:00
drh 77aa809a37 Enhance an assert() to impose for tighter constraints on the operation of pcache.
FossilOrigin-Name: 461511cc99e5b1f936d0acbfcfe117c4ceb721a28eed50bb6db7a2244aedb599
2022-09-07 20:14:38 +00:00
drh 1b7e5d2b0b Fix the windows build so that it works with -DSQLITE_OMIT_AUTOINIT.
FossilOrigin-Name: 1662eb07d8fa01457b3e3f37894234aae27c25a67059da968ab8cb599d3bd8f6
2022-09-07 19:58:48 +00:00
drh 3943571dda Ensure that the Rekey() operation does not overwrite an existing page number.
FossilOrigin-Name: cd1e40064ccd9fe2189feb4fd3b77be265990baba8be3d53256b85716650f5bc
2022-09-07 19:50:06 +00:00
drh 3ec39b0cf2 Increase the version number to 3.39.4
FossilOrigin-Name: e98bed127db003c4ea34d8ca331b29a0256d9073c27a3e914f02030c1b0af77c
2022-09-07 19:35:23 +00:00
drh 230ad4565e Version 3.39.3
FossilOrigin-Name: 4635f4a69c8c2a8df242b384a992aea71224e39a2ccab42d8c0b0602f1e826e8
version-3.39.3
2022-09-05 11:02:23 +00:00
dan 98e57757dc Ensure the Pager.journalOff variable is zeroed if an error occurs while writing the initial header to the journal file.
FossilOrigin-Name: fe547035ce9204a8e573540115fa8514fbf875e3cae493d88ff3eceb61a67384
2022-09-02 21:21:58 +00:00
drh e8b45c33cd Remove a NEVER() that is sometimes true.
FossilOrigin-Name: 85a8a117402737352d0c36e9f24a9bdb3842b34f1c520db2d37a2fc91b026486
2022-09-02 19:18:49 +00:00
drh 47405642f2 Fix an assert() associated with the dbsqlfuzz error at [8372468bb5d8922c].
FossilOrigin-Name: f448480e1b93d94ee852b252df6e2fd8649a08f78ab294b07f77307ac0821beb
2022-09-02 17:26:22 +00:00
drh 16938fc374 When an OOM occurs and sets the Parse.nErr value, also set the Parse.nErr
value for all outer Parse objects.
dbsqlfuzz d33f60aaa67733aa700cd69dacf8e0e23a327a29

FossilOrigin-Name: 073621afa2fd833a3ee976d7508a11eca67520e1bc6d5351654fa220c9397976
2022-09-02 16:45:21 +00:00
drh cdce08b05a Mutex protect access to the sqlite3_test_directory and sqlite3_data_directory
global variables.  See
[forum:/forumpost/719a11e1314d1c70|forum thread 719a11e1314d1c70].

FossilOrigin-Name: 34c6ec3989fd605f020efa077a0ffacf426456bab1b0290aaa517ccf04fe7de5
2022-09-02 12:12:46 +00:00
drh 254c5ad58d Defer deleting a transient SELECT statement associated with a flattening
of one arm of a compound SELECT until after the parse has completed.

FossilOrigin-Name: 8403c0d5d626eaf6c4830e6d706af3ea2d84a9a12b8eecc6f549fa2ca24352b7
2022-09-01 14:33:28 +00:00
drh 87cef5ed35 Do not attempt the OP_Count optimization on queries with HAVING clauses.
This fixes a problem exposed by [2cf373b10c9bc4cb].

FossilOrigin-Name: 5f93239a8c0fc724837b208fb3d48fd709c5b60c15e90dbb82fd046c0b735b04
2022-08-31 14:40:46 +00:00
drh 9eb67ef5f9 Any function call can abort. Take this into account when deciding if a DML
statement needs a statement journal.  See
[forum:/forumpost/9b9e4716c0d7bbd1|forum thread 9b9e4716c0d7bbd1] for more
information.

FossilOrigin-Name: 5bf4c5fd0a6ac02392249d3a2057a6fca5b3fcf7c8ad376bbd009d11a9ecd765
2022-08-30 14:13:15 +00:00
drh 7ef2cf86d3 Avoid having fts3 read uninitialized values when processing deferred tokens.
FossilOrigin-Name: 8e2bfe58030cab8230001c73b60c3ecd421dde5c473b39429ddad610e1d2b1be
2022-08-05 19:37:05 +00:00
drh 0b316cb36d Fix a problem with the query optimizer for LIMIT/OFFSET queries when
underlying query is a UNION ALL and both arms of the UNION ALL are
subqueries with an ORDER BY clause.  This bug was reported at
[forum:/forumpost/6b5e9188f0657616|forum post 6b5e9188f0657616].  The
problem was introduced in 2015 (SQLite version 3.9.0) by check-in
[4b631364354068af].  See also ticket [b65cb2c8d91f6685].

FossilOrigin-Name: 5e1db87cfa262deb85447c1e0bc0412bcebec2ee5503b01f309c61c548a7f32c
2022-08-04 17:17:41 +00:00
drh 71dc5f83f4 Improvement on the previous check-in.
FossilOrigin-Name: 0d0c31117a530356495fa24e020bb9536a1c4b68c35a1e96cbd70ea5a7cc4e75
2022-08-03 17:27:52 +00:00
drh 7dde866d3b For an IN operator used with a RIGHT JOIN, use the number of terms in the
vector, not the number of equality terms, to size the column map.
dbsqlfuzz 14cfdad6ca45e607163f54049ddf5065183dc657.

FossilOrigin-Name: 003e4eee6b53a4dee3b8593dc052661d56bd426c8fc184b8a6b5e760a7f9e003
2022-08-03 16:04:12 +00:00
drh 65f517d619 Bump the version number up to 3.39.3.
FossilOrigin-Name: d0f7f22a8f4e74d344d9ac7b5bd5a3905179ab1954c8351b0aac912c410a6767
2022-08-01 13:17:41 +00:00
drh 96e3015e4d In the xUpdate method of the GeoPoly virtual table, make sure that the
number of updated columns does not exceed the underlying implementation, even
if the virtual table object records an excess number of column in the nAux
field due to table constraints in the table definition.
Fix for the problem reported by
[forum:/forumpost/a096ab7d96bb057a|forum post a096ab7d96bb057a].

FossilOrigin-Name: a8ae721617e75742966cbc77bf56a264e36b7278cb718eb155d72b579c95d5cd
2022-08-01 13:15:29 +00:00
drh 202b2a7b54 Version 3.39.2
FossilOrigin-Name: 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603
version-3.39.2
2022-07-21 15:24:47 +00:00
drh b0ddbf7922 In the query planner, restore the former aggressiveness in reordering of
FROM clause terms that existed prior to version 3.39.0 for queries that
contain no RIGHT or FULL JOINs.

FossilOrigin-Name: 9141e873c575b049ce7aeaf313d05966f1966087caf33a6c80d2416a28571a21
2022-07-21 12:26:01 +00:00
drh fd34e75b0a Simplify the logic that converts the "1" expression in "ORDER BY 1" into a
copy of the expression that defines the first output column.

FossilOrigin-Name: 449935914c3f64e37bbfb9842e868927222fa3d5315c123a32818e67fcfbbf60
2022-07-20 17:01:18 +00:00
drh 6eb7354fab Increase the size of loop variables in the printf() implementation to avoid
harmless compiler warnings.

FossilOrigin-Name: 26db4fc22fe6665809d321b8a88b60efbbfecd5723ff3e370b857661b981c32c
2022-07-18 15:27:29 +00:00
mistachkin afb21dc9ca Fix harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 2be8fa158e035faf0ec46830a9ec270fb292cd79a882a8fe8dadd19d6ee057a0
2022-07-15 15:24:10 +00:00
dan b1c445732e Fix a memory leak in fts3 that could occur when processing a corrupt database.
FossilOrigin-Name: 48f323b9561969bc7d7157ee361c18b047a876be5907c34d2a73254256934098
2022-07-15 15:11:41 +00:00
drh effc07ec9c Fix the whereKeyStats() routine (part of STAT4 processing only) so that it
is able to cope with row-value comparisons against the primary key index
of a WITHOUT ROWID table.
[forum:/forumpost/3607259d3c|Forum post 3607259d3c].

FossilOrigin-Name: 2a6f761864a462de5c2d5bc666b82fb0b7e124a03443cd1482620dde344b34bb
2022-07-15 12:34:31 +00:00
dan 8d65601931 Update some faulty assert() statements in fts3.
FossilOrigin-Name: 958d104bcfb63b53b1f7ed745fafed8f392b71ed8b694675502473da735fc6a0
2022-07-15 12:07:25 +00:00
drh c892515c7a Bump the version number up to 3.39.2.
FossilOrigin-Name: c4dbcb282d28bcc9b8001f387d0fc605be928453b3f61d2f5150f529647027b2
2022-07-14 01:54:17 +00:00
drh 9dde91f613 When applying the omit-ORDER-BY optimization, defer deleting the AST of
the deleted ORDER BY clause until after code generation ends.

FossilOrigin-Name: b88d6c4b814ec4166ec50f32a2f10d7857df05414c0048c1234ab290a273e50c
2022-07-14 01:49:17 +00:00
drh 11dbd0be3c Version 3.39.1
FossilOrigin-Name: 7c16541a0efb3985578181171c9f2bb3fdc4bad6a2ec85c6e31ab96f3eff201f
version-3.39.1
2022-07-13 19:41:41 +00:00
drh b3f7a5d8f6 The query flattener should not run if the subquery is a compound that contains
a RIGHT JOIN in any arm and the subquery is not the first element of the
outer query.  Otherwise, prior elements of the outer query will not have
the JT_LTORJ flag set.  Fix for the problem reported in
[forum:/forumpost/174afeae5734d42d|forum post 174afeae5734d42d].

FossilOrigin-Name: cf9ed7f2e1a7be230a8ff689a759289a6bf59c1c84169f2ed510f74c02e0c2e0
2022-07-13 16:06:35 +00:00
drh 14030cca04 Fix test case error messages so that they work with after the removal of
the unnecessary zErrMsg clearing from [44d77a7f807f5dc3].

FossilOrigin-Name: 7b167b87d63f6a7399886c84a40bf53b504aa9f6bd18dd06aad2a02aa0a88b2f
2022-07-13 11:27:20 +00:00
dan 9d905ce1c5 Update makefiles to fix building the non-amalgamation testfixture with SQLITE_DEBUG.
FossilOrigin-Name: 1ca705641708cc39d984c8f688df1418f9abd7cc39ac8cb6f0cd689f0bc2b568
2022-07-12 15:12:19 +00:00
drh 9dfd155f68 Use 64-bit memory allocation APIs in the sqlite_stmt virtual table, to avoid
harmless compiler warnings.

FossilOrigin-Name: 4c40b38cbe04ddd8c1ef442bf14e1625f5494d64c78ae830b9e01fe4c7243394
2022-07-11 19:48:48 +00:00
drh 31114a38cc Fix harmless compiler warnings.
FossilOrigin-Name: 9931bb202e2a4e0a980ebc6164e8f1da6c724e07242f448058e1c4cc3694b2b3
2022-07-11 19:29:48 +00:00
drh 4292973810 Increase the version number to 3.39.1.
FossilOrigin-Name: 88b1b0327f6d2843a4c84b4f5249162cf81a86bfd43f9412ebe6142d7c2df2fb
2022-07-11 14:44:28 +00:00
drh 8d7ffd2904 Ensure that the Parse.nErr flag is set following an SQLITE_TOOBIG error on
a nested parse.  Fix for the problem identified by
[forum/forumpost/d5a82ba9eedee30c | forum post d5a82ba9eedee30c].
Also, remove unnecessary clearing of the Parse.zErrMsg field
following a nested parse.

FossilOrigin-Name: eaef7b71900ef7701c11f07ec8b0ca3fec7e055ce8fd9c769f36669b482de134
2022-07-11 14:43:33 +00:00
drh 64477226e2 Fix a problem in fts3 to do with deferred tokens and OR expressions.
FossilOrigin-Name: bbe999e345d43b2f90493d11b95bb5da39d356bfddfc79234cfa70ac1eb273e8
2022-07-11 14:39:55 +00:00
dan d120a50ef7 Fix for builds with both SQLITE_DEBUG and SQLITE_OMIT_WINDOWFUNC defined.
FossilOrigin-Name: dfe46de2d4149fea5031c670f2bcec20851b0941ed9b7adf6cb31a01040362c5
2022-07-05 19:56:10 +00:00
drh f14c4c91e1 Fix the initial-prefix optimization for the REGEXP extension such that it
works even if the prefix contains characters that require a 3-byte UTF8
encoding.  This should fix the problem reported by
[forum:/forumpost/96692f8ba5|forum post 96692f8ba5].

FossilOrigin-Name: 7a32ccccef7712a40aba86c2204457f6772403befabe0aab19407399df46f096
2022-07-03 14:32:18 +00:00
drh 98c336c2b2 Fix documentation and test-script typos and a dependency problem on a Makefile. Fix the sqlite_stmt extension virtual table so that it shows the state of all
prepared statements for a single instant in time.

FossilOrigin-Name: 0a9e08be6d06e571ef9dc688317271de8054179a0458e196d3bc2dc6262efecc
2022-06-30 14:19:38 +00:00
drh 47d8c40ca5 Version 3.39.0
FossilOrigin-Name: 14e166f40dbfa6e055543f8301525f2ca2e96a02a57269818b9e69e162e98918
version-3.39.0
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