1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-10-23 21:49:02 +03:00
Commit Graph

10376 Commits

Author SHA1 Message Date
drh
c907770214 Improved capture and reporting of errors by the CLI.
[bugs:/info/2026-09-21T02:55:55Z|Bug 2026-09-21T02:55:55Z]

FossilOrigin-Name: 6698a7e18727b08748eb875c08c93a23afa391d3642e7610a87e86f7528a04bc
2026-09-22 17:12:56 +00:00
dan
6c6d1c71eb Fix calculation of the virtual table dbstat.pgoffset field for overflow pages. Report [bugs:/info/2026-09-22T01:43:42Z | 2026-09-22T01:43:42Z].
FossilOrigin-Name: 4f4ca57309c82d9e2e090cf3accb83d4ee2868de2a7626d7afc30ff4c8351695
2026-09-22 10:30:05 +00:00
dan
5f8b6a782d Fix truncation of 64-bit integer values passed to the fts3 snippet() function. Report [bugs:/info/2026-09-21T02:41:49Z | 2026-09-21T02:41:49Z].
FossilOrigin-Name: b0919c9687f01240c89171e1607816b603450e5bed37c468860298b2ccc11a81
2026-09-21 11:14:14 +00:00
drh
93d6a90fe9 Adjustments to the substr() function so that it can accommodate
ridiculous values for the second argument.
[bugs:/info/2026-09-20T18:42:27Z|Bug 2026-09-20T18:42:27Z]

FossilOrigin-Name: aadf42e021fc55d457836c7cda68f3d22dcaae72a7bbc105c3c727b3eb5c4657
2026-09-20 20:17:58 +00:00
drh
30fbf300af Fix test cases added by [f847298c8d424071] so that they work on
all configurations.

FossilOrigin-Name: 977e0faac735409fd06d61851a30686b471bcfc3f1dcfba2debe2b4a3d42b5e8
2026-09-19 11:07:26 +00:00
drh
ac2685b071 Fix new test cases added by [c77ff6089de242d8] so that they work
on all configurations.

FossilOrigin-Name: 78d3370d36fb8872de1ed853f3a479273b54d2cff9fdfe83db963f4da9c7f999
2026-09-19 10:58:12 +00:00
drh
b8c29c92a5 Ensure that the comments generated by the ".schema" command in the CLI
are not terminated early by rogue SQL.

FossilOrigin-Name: e6eef2cb8fff278cfef2b8898e12d641df22c435d70800d0f031ae740cc88b7e
2026-09-19 09:24:10 +00:00
stephan
9073f828a3 Cygwin portability fixes contributed by Jan Nijtmans, including the un-exporting of some non-public-APIs which need to be reviewed closely. One test (delete_db.test) is failing but that specific failure has been a recurring theme in this environment.
FossilOrigin-Name: fe484c8dbc4829508616a1db1bd38a8e451409bddcc20b593fbf51a6ab1a1b00
2026-09-15 08:37:47 +00:00
drh
1eca07ed73 Do not discard INDEXED BY or NOT INDEXED from a parenthesized term
of the FROM clause.
[bugs:/info/2026-09-10T20:38:13Z|Bug 2026-09-10T20:38:13Z].

FossilOrigin-Name: e308b0fce47e184860564f0535174017eb7d5d7efc4f86dd1eb8d234f75e4d08
2026-09-10 23:54:06 +00:00
drh
134f69359c In PRAGMA integrity_check, double the space available for checking that
every byte of a page is used only once as a safety margin to deal with
unforeseen kinds of database corruption.

FossilOrigin-Name: 0c173d54b1bab44748f0010ec7aa5bd79891aa9aaea91d2996c6f0d3f859d1a8
2026-09-10 20:04:18 +00:00
drh
220b580fc7 Fix minor issues with the delta_parse() table-valued function in the
fossildelta.c extension.  Add test cases for the fossildelta.c extension.
[bugs:/info/2026-09-09T10:29:35Z|Bug 2026-09-09T10:29:35Z] and
[bugs:/info/2026-09-09T10:55:54Z|Bug 2026-09-09T10:55:54Z].

FossilOrigin-Name: 737ab94632c7745d3fd1f82894a1c8174db59350a33329660681398dd604c4d0
2026-09-09 13:49:42 +00:00
drh
e137e97af6 Improved orderly-shutdown in testrunner. Windows lets running jobs complete.
Unix just invokes exit and lets the OS deal with cleaning up the mess.

FossilOrigin-Name: ce822e8dc137128a6c495600205c6659a9cd2ba6ba188d86567ed97c04b7aeea
2026-09-04 14:02:05 +00:00
drh
55f0206dca Remove an intentional error used for testing that was accidently left in
the previous check-in.

FossilOrigin-Name: 87f9d70d9e3fae2eda2650d9f58fd587c5f7b9cf7f7d13d47ebd11053ce63a25
2026-09-04 13:43:43 +00:00
drh
b5e3cf0655 The testrunner.tcl script is enhanced so that --stop-on-error does not
exit immediately, but instead  marks all pending tasks as "halt" so
that no new tasks are scheduled, but allows "running" tasks to continue
on to completion, as an immediate halt can cause hung processes on  Windows.
Also, in Makefile.msc, the "test" target now includes --stop-on-error.

FossilOrigin-Name: 0fba9b52b41a5fade0d162c947712669653c4619c89a79800017703e978d8a24
2026-09-04 13:37:51 +00:00
drh
61974281e4 Omit a minro optimization that fails in two ways: (1) it does not actually
make the code run any faster, and (2) it allows an incorrect type 
coercion on a GROUP BY query where there is a subquery as one of the
result set columns.
[bugs:/info/2026-09-03T02:29:56Z|Bug 2026-09-03T02:29:56Z].

FossilOrigin-Name: 5d9e5cddec144492df866bf0ea1808b1c099be92551cbb2433a0f3a0ff119023
2026-09-03 16:32:43 +00:00
stephan
62c805e36c Cygwin portability patches from Jan Nijtmans.
FossilOrigin-Name: c76e64373cca884ab47ea24f8df3cedcdc823ccf3484e9b78715154f6d1ea66f
2026-09-01 17:50:43 +00:00
dan
09a5513008 Within a checkpoint, avoid allocating memory for *-shm pages that will not be processed as they have already been completely checkpointed.
FossilOrigin-Name: 53a9312cc923073066d697a0038e647d83a17ad0730dd91033e8fe7435fcc8df
2026-09-01 17:44:43 +00:00
stephan
be3dc6699e Cygwin portability patches sent off-list from from Jan Nijtmans.
FossilOrigin-Name: f8306cd54d28ceda631ce9053d94df2bb28cffccce2a7e72d088b4b1f2a0d3ed
2026-09-01 16:26:50 +00:00
drh
ff622746c4 Make sure the extra sorting cursor used by SQLITE_ENABLE_SORTER_REFERENCES
is initialized even if the corresponding table is empty.
[bugs:/info/2026-09-01T01:34:02Z|Bug 2026-09-01T01:34:02Z]

FossilOrigin-Name: a418005ba503e65944808a5a8397359210293bcde4c5ddd8800c66ea5c103292
2026-09-01 12:36:03 +00:00
dan
99b322eca9 Fix an SQLITE_CORRUPT error that could occur with an incremental vacuum database if many tables were created and dropped within a single wal-mode transaction.
FossilOrigin-Name: f847298c8d4240711e4e12f256941dcf3d5978c53da3a6836cdc675c3468c179
2026-08-31 18:15:11 +00:00
dan
a5ae4bd098 Return an error if the arguments of a table-valued function that is on the left of a RIGHT JOIN depend on tables to the right of it in the FROM clause. Report [bugs:/info/2026-08-31T08:07:08Z | 2026-08-31T08:07:08Z].
FossilOrigin-Name: 43c8d7c41c3d8a2602ea0a7759c6b85eeca8640bc85024746e77eb58648f73a6
2026-08-31 15:02:19 +00:00
dan
aba9f8ef69 Fix a bad interaction between the skip-ahead DISTINCT optimization and "ORDER BY ... NULLS FIRST/LAST" clauses. Report [bugs:/info/2026-08-30T23:22:05Z | 2026-08-30T23:22:05Z].
FossilOrigin-Name: 7bfd3d6f80316f3d129a1e8c798be0a0efa8fbeb69d6958c1c2af9f4f6945a9e
2026-08-31 11:04:03 +00:00
drh
d92acf1afe Follow-up to check-in [2cb349e5b02aa549] to help indexes on negative
DEFAULT integer values get stored more efficiently.

FossilOrigin-Name: c77ff6089de242d8cb7487ea36b094e403c9ed1a48a8ee713d64a0b87b334369
2026-08-29 20:27:09 +00:00
drh
4213c5cc4f Fix two test cases that do not work when optimizations are disabled.
FossilOrigin-Name: e78b72fadfe4c263f5af56aa887891a49055edfccda9397267804b3aaf4afd53
2026-08-25 17:08:19 +00:00
drh
46c7844d76 Make the optimization of UNION with ORDER BY and LIMIT sound by restricing
it to LIMIT 1.

FossilOrigin-Name: 7e6e665d05e5d5895bac60d68b49bdf28e2ec6d8dc4ef8c18703f2e6d4f8870f
2026-08-25 16:29:27 +00:00
drh
69785dee50 Merge the latest trunk enhancements into the union-to-union-all branch.
FossilOrigin-Name: c58631b26ad6ee39d8db2700a26413249fd88d137c3a7944bad7af07cd7fe121
2026-08-25 15:49:27 +00:00
dan
11d653bbd3 When an expression that may have a subtype from the WHERE clause of a partial index is substituted for a column value, clear the subtype before the value is used. Report [bugs:/info/2026-08-25T05:36:33Z | 2026-08-25T05:36:33Z].
FossilOrigin-Name: e6ae6fbd5c0b33ae6950a5a45fc0631cd5e0a437eb672f0a2ec6d288596f1be2
2026-08-25 14:26:16 +00:00
dan
b1df30c735 Fix test file default.test so that it works with SQLITE_OMIT_ALTERTABLE builds.
FossilOrigin-Name: ff0e3dd09486dad093b8392e088d17f78e4445f68baebf63d24ad232d45e69b3
2026-08-25 11:50:11 +00:00
dan
6121d9909d Avoid coding WHERE constraints too early when using the OR-optimization with OUTER join queries. Report [bugs:/info/2026-08-25T02:08:22Z | 2026-08-25T02:08:22Z].
FossilOrigin-Name: a3d15e4937c8f767db046615994f53618be0a407dee09a1989a6382e9b945574
2026-08-25 11:42:00 +00:00
drh
eb13d2232e Change error message text in the previous check-in to not have initial caps,
for consistency with other error messages.

FossilOrigin-Name: c4bd2ffcb7110d71bf1ec8114d65b57cbbad084851295adca754def847751464
2026-08-25 10:39:48 +00:00
dan
9ca4d3f61e Prohibit using ALTER TABLE to add or drop, or rename to or from a rowid alias, unless the table is a WITHOUT ROWID table. Report [bugs:/info/2026-08-23T15:59:23Z | 2026-08-23T15:59:23Z].
FossilOrigin-Name: dfcff5be53c26b9a1728e485ac9c56d50be5ac9ce877fcae3965471469dc8a8d
2026-08-24 21:20:49 +00:00
dan
d6bae5ec97 Ensure that when a large integer value (too large to be losslessly converted to double) is specified as a default value for a column with REAL affinity, the real version of the value is stored in indexes. Report [bugs:/info/2026-08-23T15:39:59Z | 2026-08-23T15:39:59Z].
FossilOrigin-Name: 2cb349e5b02aa549518f2e17cbfc6b4841e5686dcfb828f243c87ff3006f4870
2026-08-24 14:40:43 +00:00
drh
221ad559b6 When generating code to evaluate a vector IN constraint where the RHS
of the IN operator is a subquery, if the removeUnindexableInClauseTerms()
subroutine changes the order of terms in the IN operator, then do not
allow the modified IN operator to reuse a previously generated evaluation
of the subquery.
[bugs:/info/2026-08-23T06:58:36Z|Bug 2026-08-23T06:58:36Z].

FossilOrigin-Name: 8ee92456eb21878c44732e9adaac64009133eb03c36a7390b42427d63ff4a340
2026-08-24 14:30:29 +00:00
dan
1934b305cd Ensure that when a large integer value (too large to be losslessly converted to double) is specified as a default value for a column with REAL affinity, the real version of the value is stored in indexes. Report [bugs:/info/2026-08-23T15:39:59Z | 2026-08-23T15:39:59Z].
FossilOrigin-Name: c494b123f52506ab57edd3f4c317b882b270e13bd5798b6c8fbdf5eebbd4ed63
2026-08-24 14:22:19 +00:00
drh
85e7fd94d9 The optimization of disabling an ORDER BY term if it is constrained by
an equality comparison with a column from an outer query does not work
if there is an affinity mismatch between the two columns.  This is a
follow-on to check-in [16aed5d0c63dcdc2] and a fix for
[bugs:/info/2026-08-23T01:02:14Z|Bug 2026-08-23T01:02:14Z].

FossilOrigin-Name: 383e42bc1096d6fe6a2a0a147da90a1bb0bfb37c78a3288bbacaaf9bf7ac17c4
2026-08-24 00:08:45 +00:00
drh
4efa7a477e Correctly enforce a UNIQUE constraint on a non-PRIMARY KEY column of a table
that has an INTEGER PRIMARY KEY with ON CONFLICT REPLACE and that has
a AFTER DELETE trigger that fires when the REPLACE happens and that trigger
tries to INSERT a new row that violates uniqueness.
[bugs:/info/2026-08-22T23:55:15Z|Bug 2026-08-22T23:55:15Z].

FossilOrigin-Name: 521c9f5f282f159332101be32031568cb3f08fd937f354a282e09957dd570f53
2026-08-23 21:41:08 +00:00
drh
5ff4a5390c Remove some unnecessary sqlite3_test_control() optimization control flags
for a small performance increase and size reduction.

FossilOrigin-Name: 2a9cb1e12ab4b81875e2d08f6cdecfb08b57137a69f6eb4efd19a56347184c3b
2026-08-22 16:33:58 +00:00
drh
ccfd5e0941 Add an optimization that converts UNION into UNION ALL if there is
a LIMIT 1 and no ORDER BY.

FossilOrigin-Name: fb83742dd163363b9c18c530b6f95964562a0fca2a563462379595632af94387
2026-08-22 10:39:18 +00:00
drh
3468c5b73e Fix check-in [468e730036edac22] so that it works with DESC indexes.
[bugs:/info/2026-08-22T07:01:45Z|Bug 2026-08-22T07:01:45Z].

FossilOrigin-Name: d1f4fa43f30d0aaf04af1b2afe9ec488654df43444bd49fae31ba1e2ab16b985
2026-08-22 09:33:37 +00:00
drh
45f4f1c1cb A couple of fixes, one of them important, for the previous check-in.
FossilOrigin-Name: 3a01099c45bd5965286640c23d727ef0c4a61bd97146bf01bac63e296808cba9
2026-08-22 01:21:46 +00:00
drh
6f1110ce05 Faster implementation of sqlite3_bind_int64(). Reduce the need to
reprepare when replacing one integer binding with a different integer
value is many cases.

FossilOrigin-Name: 98edd4ac227e555a84ee7025983a4a394c89d52cb5dfe2076ad9431566be2288
2026-08-21 20:32:06 +00:00
drh
54508b2801 In the CLI, finer-grain control of what status information is displayed via
the ".stats" command.  Add the ability to reset peak measurements after
each display.

FossilOrigin-Name: 852972861636d75ed935c3a0b1b170442048a1eaa80c4d4abd1c9de14c8be022
2026-08-21 14:04:05 +00:00
drh
5d92a8f1b5 Merge the latest trunk enhancements into the reduce-reprepares branch.
FossilOrigin-Name: 62ad88fe1ccd647ef77910d116856d6f2d9c96a726a2a270eacc8f5785875264
2026-08-20 14:05:49 +00:00
stephan
73e39488f7 Internal doc typo fix. No code changes.
FossilOrigin-Name: 1c19bc27cbeb6614e7c01a28c76a7e5f649dba3c15c5fa4588c4e84fe5541947
2026-08-20 11:12:56 +00:00
drh
255f7220fd Modify the OP_Int64 and OP_Real opcodes so that their 64-bit immediate value
is stored split across to arguments, P1 and P3, rather than being stored
as a separate memory allocation pointed to by P4.  Slightly smaller and
slightly faster, but perhaps also easier to maintain.

FossilOrigin-Name: c13b4c2c41e19fc47925dfb75e5f48d9972ef9ffb68c2d3c57e71a23e75717f9
2026-08-20 01:22:18 +00:00
drh
7e50e63de2 Disable three unimportant scanstatus tests on Windows to work around
platform incompatibilities.
[bugs:/info/2026-08-19T20:22:44Z|Bug 2026-08-19T20:22:44Z].

FossilOrigin-Name: 3f2b5dc6cd9d83724fcf39e9d7e2ca0eae6b8c698d1eb5444c705696a866d85a
2026-08-19 21:01:42 +00:00
drh
2b356863cc Merge recent trunk enhancements into the reduce-reprepares branch.
FossilOrigin-Name: f3adcd561a50646fa53173da162ed3952065d7bd6cc82babbecf3973be269d57
2026-08-19 17:25:54 +00:00
drh
c69f996361 Fix the zipvfs virtual table so that it works with UPDATE OR REPLACE.
[bugs:/info/2026-08-19T01:52:09Z|Bug 2026-08-19T01:52:09Z].

FossilOrigin-Name: 1f71a577adfbfe9ca691766b9c97d002720118dbfdee5f16424ecf96b4a40b9b
2026-08-19 15:29:15 +00:00
drh
857f41a4ae Fix a minor error in [d287358b8d356d4f] that was causing an assertion fault.
FossilOrigin-Name: 1357ac105a0e0c380dc88b13d53b93799221a389f3f81ba6d05fe8fd9ffc6975
2026-08-19 10:38:49 +00:00
dan
c60dd4af07 Experimental attempt to reduce reprepares caused by bound variables and "=" constraints in WHERE clauses.
FossilOrigin-Name: 1cfdde74f1c68589d722b876c20317c2a70cec2d915546a2200035190d3fb082
2026-08-18 18:22:47 +00:00