Commit Graph

2735 Commits

Author SHA1 Message Date
drh 066b667313 Prevent internal-use-only SQL functions from being used inside of a CHECK
constraint added using ALTER TABLE ADD CONSTRAINT.

FossilOrigin-Name: 6cb565fe20049a48619fa3c7995de30fd9e284cfacd1652465e1f9083daf2669
2026-05-11 14:47:45 +00:00
drh 6d27844bbe Merge trunk performance enhancements and fixes into the direct-printf branch.
FossilOrigin-Name: 9fa9cd11f8f5f7591168870c6e41121221b58a4a3094e708e3fa5bab1502f190
2026-03-29 19:23:47 +00:00
drh 03f13d77a5 Avoid using unsigned 64-bit integer division on platforms that do not support
it in hardware.

FossilOrigin-Name: 2197677491dfc5ec87b57bbf807776875248a250f80ce9a5ce94ae385bb1d2bc
2026-03-29 19:06:36 +00:00
drh eb0cb3f53b In sqlite3_str_vappendf(), write floating-point renderings directly into
the output buffer, saving a memcpy().

FossilOrigin-Name: e4e040e7aaaf5bfccbf0414fee3d08c5fdc24e03d1118dce92d2dd16c614ce63
2026-03-28 20:24:47 +00:00
drh eac7cd634d Use the UINT64_C() macro rather than the LLU suffix on integer literals
for portability to older Microsoft compilers.
[forum:/forumpost/0a9ffaff6fcdedb3|Forum thread 0a9ffaff6fcdedb3].

FossilOrigin-Name: 27be26566fdb4d01c44dc111f1c18c835797de0990d4fcc876e91edc216e9e93
2026-03-07 22:37:28 +00:00
drh 7a125b97d7 Fix the build for -DSQLITE_OMIT_FLOATING_POINT.
FossilOrigin-Name: f41b9ad98c474755c6701eb6ab3dc9864ace9b52a81581f73ca0912cedbc3c37
2026-03-05 18:28:43 +00:00
drh 9d65290207 Rename SQLITE_ENABLE_MULTITHREADED_CHECKS to SQLITE_THREAD_MISUSE_WARNINGS.
Run test cases with that option. Also add the
SQLITE_THREAD_MISUSE_ABORT option.

FossilOrigin-Name: be8c8b9cb7b618a1571a988bc1cfdc15d99a8bf144d699385c0076e940b9f7f5
2026-02-24 19:37:16 +00:00
drh 8642ca2025 New sqlite3_db_config(SQLITE_DBCONFIG_FP_DIGITS) that let's the application
specify the number of significant digits that double→text conversions
will attempt to preserve.

FossilOrigin-Name: 3f16985dcc47a366b54164c5024f920a79dddd76faeac5e36b4770732ed72c0a
2026-02-21 19:26:58 +00:00
drh ac5ee556eb Inconsequential changes to floating-point conversion, amounting to mere
code cleanup to aid comprehension.

FossilOrigin-Name: 6d9c29123b6b143b0f7c8f5d018f170c72edfc5b1a4d67edd45e5552def2af6c
2026-02-20 20:43:25 +00:00
drh 5c977eaa0a Refactor the sqlite3AtoF() routine so that it requires a zero-terminated
UTF-8 input.  When the need arises to convert UTF16 or non-terminated
strings, wrapper functions are used.  Together, this makes the code slightly
smaller and faster.

FossilOrigin-Name: 67c7c72e9bdf04c920d77006538a202c923fa74b47c81dc3014c2929dac7277d
2026-02-16 16:56:59 +00:00
dan 7b93f1a387 Fix a problem with identifying ON clauses attached to RIGHT or FULL JOINs (which is an error) if the join appeared in a flattened sub-query.
FossilOrigin-Name: cf2dc6dfad275dad8fef763a57baaaf6301b0d3bf1916be90f22200cbe0115d0
2026-02-16 11:59:14 +00:00
drh c47bc0ffca Performance improvement in floating-point conversions.
FossilOrigin-Name: b5ebbd004183f81902fa79a143222204b33dbe1cacb918194556b8dac67bd567
2026-02-16 11:14:59 +00:00
drh 4bee65dcb9 Another minor performance refinement.
FossilOrigin-Name: 9d3a12d3926d55efffdc84bff342bd1dbccd08426104aeb2d339b064bf6f02f4
2026-02-14 20:48:58 +00:00
drh 23e57bc7cd Use only a single bit, rather than a whole byte, to store infrequently
accessed boolean values in the Parse object.

FossilOrigin-Name: e1bcd7e1cf6d6b1add49deac65e1b64bcae52fbbad094e561846bb92959db76a
2026-02-13 12:20:57 +00:00
drh 450a90097f Do a better job of not generating unnecessary Bloom filters associated
with IN operators.

FossilOrigin-Name: 3861df5c127f82becea80c48c547de8ed0d01eebcf6a6a9d7f234dde31f50394
2026-02-05 21:14:34 +00:00
drh 3212ab33d4 Refactor the implementation of this enhancement to keep all the code inside
the query planner, not leaking out into SQL function implementations.
Expand the enhancement to cover MATCH and REGEXP operators and overloads
of LIKE and GLOB.

FossilOrigin-Name: 96f8ce225ee863c6dfe0df2d10da27a35407128d7c4691ddb927401465047a6e
2026-02-03 14:00:28 +00:00
drh 49c70b88bc When reducing the truth probability of a LIKE/GLOB constraint, only consider
non-wildcard characters in the pattern.

FossilOrigin-Name: 2ba8fc290dbc80d159a217d745d8bd62371c305443d5aed10bfcf34cc98d3985
2026-02-02 20:54:28 +00:00
drh 5c8cd31246 An experimental query-planner change that reduces the estimated number
of output rows for FROM clause terms that are restricted by a LIKE or
GLOB operator, based on the number of bytes in the pattern.  The idea is
that longer patterns will match fewer records and hence should reduce the
estimated output count.  The implementation is not workable as it stands
now.  This is just a crazy idea, saved for future reference.

FossilOrigin-Name: 97bcb56a208af0687750a6438981bbfe36a8d516d996178e62551d302ef811ee
2026-02-01 00:37:04 +00:00
drh 33db5b73e5 The Select.addrOpenEphm field is no longer needed. Remove it and
simplify related code.

FossilOrigin-Name: 1fe5a1ca72892987716b71b9419265f25c8c426e52320acf56724fd64b838be6
2026-01-25 20:15:00 +00:00
drh 46a395ff3d Additional simplifications to achieve 100% MC/DC.
FossilOrigin-Name: 781b7ec0bcaa5d94e8c5fd31b4fe0203393d5209a5f518848f057ec3d2b8d7ac
2026-01-25 13:26:19 +00:00
drh 1f567aef4c Remove code that is no longer used.
FossilOrigin-Name: 8d7f91e07b0c7573f94fddd64f39671e608969764615bd7f5c060e7ee7540bc6
2026-01-23 16:07:51 +00:00
drh ec13fcecd2 Minor fixes. Tests are passing now.
FossilOrigin-Name: 305ae331f5e791941c12b04b727656ac8d80f7c5cb6343277b979a456eb3b834
2026-01-20 15:07:28 +00:00
drh 5ef150c223 Merge all the latest trunk enhancements and fixes into the temp-trigger-refs
branch.

FossilOrigin-Name: 8e8a27c77aa0ea5891968231e13a8caeade48b817419bbf6eda18ad217f1df63
2025-12-04 11:20:01 +00:00
drh 1e235b9b02 Create a new internal subroutine specifically designed to allocate
Expr nodes that hold a 32-bit integer.

FossilOrigin-Name: 38d06f69e516dd13becbfb735a2a0035c2f3c50ea5d661a668b109a996656523
2025-12-03 16:54:48 +00:00
dan 928276043b Merge latest trunk changes into this branch.
FossilOrigin-Name: 230fd5533e07ec36f1938f34153c9ef97a7acd6604d023b56dfc5269ca6173c2
2025-12-01 17:22:35 +00:00
drh 57b61bf78f Improved comments in code. Omit unneeded wrapper functions.
FossilOrigin-Name: 3485c7c81bee8e98ea6b403438bcdb2b6fa058afeafea150ce1c859345e1529b
2025-11-19 15:25:18 +00:00
drh ec047587e3 Merge the latest trunk changes into the alter-table-constraints branch.
FossilOrigin-Name: 31d7aeeaef20ac42c3c395dbaf7a8225ac718256a4cbeb7c198d1c7361766b1b
2025-11-18 19:36:45 +00:00
drh 074b753bca Merge the latest trunk enhancements into the temp-trigger-refs branch.
FossilOrigin-Name: 0957f4c9c45dc2f4543021cf739bfcc940da6e5fc05b7a4e8721b8c02861bfd9
2025-11-18 19:34:11 +00:00
drh fef2233090 Add the SQLITE_LIMIT_PARSER_DEPTH value for sqlite3_limit(). This isn't
something that many applications will need, but it is useful for testing.

FossilOrigin-Name: 8f0b07f36159225c476f756f8f9b35c75783bc8bed43b578f4d1055fa800ecc9
2025-11-18 14:48:33 +00:00
dan 39d132db5b Merge latest trunk changes with this branch.
FossilOrigin-Name: c0571f0010f3a6311fa99cf1b37a8e5ee39a9b8e27313cde5ea4bd1701bf2f93
2025-11-07 19:23:06 +00:00
dan 11b6fc93f6 Experimental change to allow triggers in the temp schema to use fully qualified table names in INSERT/UPDATE/DELETE statements.
FossilOrigin-Name: 48e168007ceb1bdc54cf21a8e959a8e0f9ccdc478827db7a7a0518fc7a226401
2025-10-29 20:57:44 +00:00
drh acdda1075d Enhance the tokenizer so that it is able to deal with individual tokens
larger than 2GiB.

FossilOrigin-Name: 4e713558f6c6ea3dfbc97d2eb0a328955ef6ad6f2ad05517efe9ed4a60181440
2025-10-24 13:18:31 +00:00
drh 898ac77f55 Merge all the latest trunk enhancements into the dbstatus-spill branch.
FossilOrigin-Name: 55f2613c1bacddb05902d4d5dac3d2b49b91053e6249dd926bb953c763eafeb0
2025-10-14 11:18:45 +00:00
drh 80f0fcd31d Fix harmless compiler warnings.
FossilOrigin-Name: 4966d7a1ce42af8b1c50fdd40e651e80d0eeb8cb62dd882950cab275f98aba88
2025-10-10 14:31:46 +00:00
drh cdaff852bf Were we to choose to integrate the carray() table-valued function into the
amalgamation, that integration might look something like this.

FossilOrigin-Name: 2b43d5d7dcc5aee14a050c824a5e09b6a38a9c78ddcc25a994eba5d4c5ad9ba2
2025-10-08 15:32:55 +00:00
drh c49ff175ef Merge the latest trunk enhancements into the dbstatus-spill branch
FossilOrigin-Name: cb604efdb40da95a759e2eeb9d73608859a94acde9d9782ca82757d3a1c15303
2025-09-29 18:48:00 +00:00
dan 32c49bd6e6 Fix authorization callbacks for the new commands on this branch.
FossilOrigin-Name: 0165e2afa8b640c9d7a31414f06144e089844dc13691f06f363a50d14fec62bc
2025-09-27 16:13:56 +00:00
dan ba1ee803ee Add experimental implementations of ALTER TABLE commands to add and drop CHECK and NOT NULL constraints.
FossilOrigin-Name: d939b25d76fe70a3255cfe38097d4489323028cd05e5512a98dce06b48eee445
2025-09-27 14:59:21 +00:00
drh 92f93556e5 On-demand loading of JSON virtual tables.
FossilOrigin-Name: 118f97ddcd8f888715825a623c02d42b92a82737a316f7bee4cd66f570945346
2025-09-26 10:29:07 +00:00
drh 6ba22a75f3 Revise [a4430d262b3e129d] to preserve legacy behavior of the imposter
test-control.  The control argument must be 2 now to get read-only behavior.
The control argument of 1 goes back to the prior read/write behavior.

FossilOrigin-Name: 3e7ede2e6dc9ac8e746dafe0ecb5379044631e753e951f9ab97ec84addbd830a
2025-09-22 17:28:08 +00:00
drh 49a37f333a Improvements to imposter tables: (1) They are read-only unless writable-schema
is enabled.  (2) Because they are now read-only, the ".imposter" command
in the CLI no longer requires the --unsafe-testing command-line option.
(3) Imposter tables do not participate in a PRAGMA integrity_check and hence
do not cause false-positive errors.  However, you can still do an
integrity_check on the the imposter table itself by naming the imposter
table as the argument to integrity_check.

FossilOrigin-Name: ad152ddc4bcf6cfe840b9a36ab76a5ec36afdb1dd96eb7697e4b3df1bf63b00d
2025-09-19 17:24:12 +00:00
drh 16eedfbdda Initial implementation of SQLITE_DBSTATUS_SPILL. Does not yet take into
account sorters or transient tables.

FossilOrigin-Name: 4e63ee20f80e486ecc4aa4523afa43f994c267e638f8f084f0d6df369aa74a1d
2025-09-18 14:51:23 +00:00
dan 4bace197e1 Fix the cases in joinI.test on this branch.
FossilOrigin-Name: 23ac2377315af02b73db6ae37bfeeda1453e41efb702a6b707346956c2d41a9d
2025-08-23 16:26:36 +00:00
drh fbb07ff67f Remember if a SELECT statement contains an ON clause. If it does, then after
name resolution, scan the WHERE clause to verify that the ON clause does not
reference tables to its right.

FossilOrigin-Name: 0ec8a8f64434f8cc04f02a356ecaa409ebd886566ba09c32f0fff8ebd103a609
2025-08-22 19:17:44 +00:00
drh 74cc109780 Ensure that the accumulator for an aggregate always gets initialized,
even when the aggregate is on the right side of a LEFT JOIN and never
gets evaluated.  This fixes a problem introduced by [663f5dd32d9db832]
and found by dbsqlfuzz.  Test cases in TH3.

FossilOrigin-Name: 235cf6586b9ac914a32bd8adfd460daae998687f02f0998a7aa3c6bfc857d1c9
2025-07-18 12:10:15 +00:00
drh f8addcf937 Fix harmless compiler warnings in builds that use SQLITE_OMIT_DATETIME_FUNCS.
FossilOrigin-Name: e11fbf9fd630a7de2e0b0e4b67dded05b905b2a0ba04aa7e915ca9df2d9ebe21
2025-07-14 09:41:59 +00:00
drh 44a03671c4 Merge the latest trunk enhancements and fixes into the empty-table-optimizations branch.
FossilOrigin-Name: f15cdf07573c05276a13885d74bae21a93544766344f19ef939b7a69edd1073b
2025-07-07 18:35:51 +00:00
drh 4aacd1ef8e Back out the fix at [ba7d5bad32ad6aac] because it does not always work and because
it causes a performance regression.  Add new test cases for row-value lookups of
indexes that contain redundant columns, three of which are currently failing.  This
branch is seeking an improved solution to the redundant index column problem for
row-value lookups.

FossilOrigin-Name: ad8ddcefab5cc526b1cd77731e00939c672e61ca83350d28961b67635d20da03
2025-07-07 10:54:00 +00:00
drh aa54d7a0ca Merge in the exists-to-join optimization that has been modified
to relax the requirement of having an indexed join constraint.

FossilOrigin-Name: 1c1aef2b7feae29066d0330699ab634ef41f5b60cdcd479a60cb1a5409553138
2025-07-02 20:46:02 +00:00
drh c52e9d97d4 Raise an error right away if the number of aggregate terms in a query
exceeds the maximum number of columns.

FossilOrigin-Name: 5508b56fd24016c13981ec280ecdd833007c9d8dd595edb295b984c2b487b5c8
2025-06-27 19:02:21 +00:00