master
Allow "ALTER TABLE ... DROP CONSTRAINT" to drop foreign key constraints.
Further refinements and uses for sqlite3_result_str().
Fix a crash that could occur if sqlite3_deserialize() was used to overwrite a database with an open transaction on it. Bug introduced by [fc42d31d6fca21ab] on 2018-03-07 and first released in version 3.23.0. This is not a vulnerability as an attacker that can exploit this already has the ability to execute arbitrary code. Forum post [forum:39134ba029 | 39134ba029].
Minor optimization to the authorizer.
Add new assert()s to help static analyzers realize that the code is correct.
Improved selection of the divisor when subdividing nested Bitvec objects. This fixes a potential stack overflow that can occur when the database size is within 60 pages of the maximum allowed by the file format.
Tamp down various harmless compiler warnings. Use "int" in places instead of "u16" or "i16" since the compiler complains less and generates faster code.
Revert the fixes to backup in [1f940357f7] and [e5db80350c] and instead fix the problem reported by forum post [forum:15d82885e2 | 15d82885e2] (that a call to sqlite3_deserialize() after sqlite3_backup_init() but before the first call to sqlite3_backup_step() on the destination db of a backup could cause a crash) by deferring caching the pointer to the destination Btree until after it is locked. This addresses bug [bugs:/info/2026-06-24T08:41:13Z | 2026-06-24T08:41:13Z].
Improved detection of corrupt freelist chains on btree pages. Plus, add assert()s to verify that the min-heap does not overflow inside of PRAGMA integrity_check.
Add the ability for Bloom filters to work on text values, as long as the collating sequence is BINARY.
A better fix for the issue with RETURNING triggers on eponymous virtual tables and SQLITE_SCHEMA errors first addressed by [45d820ca22].
Back out the recent change to carray. The intent is to fix this problem in a different way so that it works for all table-valued functions.
Fix harmless UB in sqlite3_incomplete().
Minor change to the "weekday N" modifier in the date/time functions to facilitate 100% mutation test coverage.
Fix a compiler warning that comes up in gcc 4.0.1 for target powerpc-apple-darwin9
Add the SQLITE_INDEX_SCAN_HEX bit to the sqlite3_index_info.idxFlags bitmask. When set, this bit causes the EXPLAIN QUERY PLAN output to show the idxNum value in hex rather than in decimal. This is purely a debugging aid.
Enable the optimization on this branch for indexes on expressions only.
Avoid apply an affinity to a register that might be the result of a TK_AGG_COLUMN expression, as it might be reused. Possible fix for bug [bugs:/info/2026-07-29T05:51:06Z | 2026-07-29T05:51:06Z].
Rename the SQLITE_OMIT_BUILTIN_TEST compile-time option to SQLITE_UNTESTABLE.
Fix a harmless compiler warning.
Updates to build instructions, especially on Windows. Fix a harmless compiler working in debug builds on Windows.
Put the sqlite3OomStr singleton in "const" space to ensure that it is never modified. Doing so identified a long-standing bug.
Fix builds on i486 CPUs. [forum:/info/2025-01-25T12:58:44Z|Forum 2025-01-25T12:58:44Z].
Refactor the sqlite3ExprCodeIN() routine for improved maintainability.
After a DELETE trigger is fired by REPLACE conflict handling, retest all UNIQUE constraints to ensure that the row being inserted or updated does not conflict with one written by the DELETE trigger. Abort the statement if it does. Possible fix for forum post [forum:/info/2026-07-18T03:35:48Z | 2026-07-18T03:35:48Z].
Improve performance and robustness of internal routine jsonBlobExpand().
Ensure that the sqlite3_exec() callback gets the correct number of columns for a query, even if the schema changes out from under it.
Prototype implementation for a new sqlite3_result_str() API.
Performance improvement in the sqlite3_initialize() interface.
Guard against oversized index entries in databases larger than 2GiB.
Remove the obsolete "$Id:$" RCS identifier strings from the source code.
Add a C-source spell-checking facility. make misspell (on Nix)
Fix another harmless compiler warning for MSVC.
Extend the refactoring into extensions. Clean up stray newlines.
Fix a missing 0 at the end of an integer literal in check-in [8da0f0c38a458c57]
Have API functions sqlite3_serialize(), sqlite3_limit(), sqlite3_busy_timeout() and sqlite3_error_offset() take the database mutex.
Add assert() statements to verify that the SQLITE_OPEN_EXCLUSIVE flag is always passed to the VFS when opening a temporary file.
Fix compilation issues seen with older versions of MSVC.
Ensure xMutexInit() is called in SQLITE_THREAD_MISUSE_WARNINGS builds.
Disable sqlite3_drop_module() tests when virtual tables are omitted from the build.
Add static mutexes for use by the built-in / third-party VFSs and use the built-in VFS mutex where appropriate.
Check-in [1786fcd5b4ee6cd9] works great and generates correct code, but it upset UBSAN. This check-in fixes the UBSAN complaint.
Round one of an audit for SQLITE_ENABLE_API_ARMOR for functions exposed by JNI and those functions missing armor, as [forum:5e3fc453a69b49ca|reported in several forum posts].
Safer conversion from double to 64-bit integer in two places.
For the unix VFS, rewrite the xFullPathname method so that it automatically resolves all symbolic links, rendering a canonical pathname that contains no symlinks.
Change the handling of hwtime.h to make it easier to compile performance measurement builds that make use of hwtime.h. This should not affect productions builds.
Fix a comment in os_kv.c so that it does not match "###" and thus does not cause false-positives when searching the output of gcov. No changes to code.
Fix -DSQLITE_OS_OTHER=0 builds.
Improvements to the unix temporary filename generator so that it continues to work even after SQLITE_TMPDIR or TMPDIR environment variables are changed by the application. Similar changes are needed for Windows.
Fix a typo in a comment. No code changes.
Reduce the number of system calls in the os_win.c thunk from 81 down to 58, as well as other simplifications.
Check super-journal names for validity earlier, as this simplifies verification that the logic is correct.
Changes for better alignment with the wal2 branch.
An alternative fix to ALTER TABLE ADD CONSTRAINT.
Add extra assert() statements to the fixes on this branch.
Use a 64-bit hash for the testing option SQLITE_CHECK_PAGES to maintain page alignment.
Avoid an integer divide on the page-cache lookup fast path. The hash table size in pcache1 is always a power of two, so the bucket index in pcache1FetchNoMutex() can be computed with a mask instead of a modulo. An assert() verifies the power-of-two invariant in debug builds.
Remove unused variable from pragma.c.
New compile-time option SQLITE_MAX_SCHEMA and runtime limit option SQLITE_LIMIT_SCHEMA that put an upper bound on the number of objects in a database schema. Current default is 10 million.
Remove unnecessary tabs in the ChaCha20 implementation. [forum:/forumpost/0cdce5db8c|Forum post 0cdce5db8c].
Fix a bug in the check-in [bbd69ce274620008] causing that bug-fix check-in to fail to completely fix the original bug. This fix is in response to the follow-up report at [bugs:/info/2026-07-24T02:52:08Z|Bug 2026-07-24T02:52:08Z].
Improve comments. Move a variable outside of a loop.
Set O_BINARY for Windows console output in the CLI. Candidate fix for [bugs:/info/2026-08-03T08:52:42Z|bug 2026-08-03T08:52:42Z].
Improve documentation for sqlite3_result_zeroblob64(). No changes to code.
Remove unnecessary "www." prefixes on domain names in URLs.
Replace the EIGHT_BYTE_U64 macro with the in-line function sqlite3Get8byte() which is more efficient cross-platform.
Reestablish APIARMOR for the sqlite3_db_status() interface.
Use the sqlite3Realloc() interface internally, rather than the public sqlite3_realloc64() equivalent, to avoid unnecessary calls to sqlite3_initialize().
Change the way pointers are passed between C code and Tcl test scripts. This allows tests to be run with Fil-C builds.
Add config as an alias for the reconfigure makefile target. Minor makefile doc tweaks. Random typo fixes in shell.c.in and tclsqlite.h pointed out by the misspell makefile target. No code changes.
Further fixes for running [make devtest] with Fil-C.
Test app/script patches from Jan Nijtmans for cygwin. Add/replace many more sentinel arguments for TCL variadic functions which specifically need a NULL trailing argument. With this, 'make test' on cygwin runs to completion for me, with 134 of 329227 tests failing. MSC build fails the same 13 tests which fail for me in trunk.
First attempt at getting the build to work with Tcl 9.0.
Cygwin-centric fixes from Jan Nijtmans.
Fix a harmless compiler warning in testing code.
Merge trunk. Some additional test-fixes for Cygwin
Remove the clunky test_windirent.h and test_windirent.c files from src/ and replace them with a much cleaner and more compact ext/misc/windirent.h.
Block deep recursion in test extension functions test_eval() and eval(). Does not affect deliverable code. [bugs:/info/2026-07-29T06:29:11Z|Bug 2026-07-29T06:29:11Z]
GCC 13 has become more quite pedantic about the signature of functions matching the type of pointers through which the functions are called. Make adjustments to extension functions and test procedures to work around this. No changes to the core.
Update an assert() in test_journal.c to take the new "VACUUM INTO" functionality into account.
Fix some more harmless compiler warnings.
Fix a problem with the handling of SQLITE_FCNTL_PRAGMA in the test_onefile.c demo.
Fixes for platforms with 32-bit pointers that require 64-bit values to be aligned.
Further work on Windows header file reform.
The MREMAP_FIXED macro (added by [4d60798b20a560be]) is not available on all platforms.
Omit the antiquated and long-unsupport async extension since it has been superseded by WAL mode for over a decade.
Fix a few minor TCL9 compatibilities issues.
Fix harmless compiler warnings on Windows.
Turn an sqlite3VMPrintf() into an sqlite3DbStrDup().
Improved output from calls to sqlite3ShowSrcList() made from a symbolic debugger.
Improved detection and reporting of deliberate misinformation in the sqlite_schema table.
Use the sqlite3ColumnIndex() routine to look up a column in a table, rather than using a custom loop. Performance improvement, size reduction, and complexity decrease.
Fix a problem sometimes causing an UPSERT to incorrectly convert an excluded.* column from type REAL to INT in cases where doing so does not cause data loss. Bug [bugs:/info/2026-06-15T09:08:12Z | 2026-06-15T09:08:12Z].
Fix a harmless comment typo
Fix compiler warning an inefficiency introduced by previous commit.
Improvements to the implementation of sqlite3_result_str() so that it has 100% mutation coverage.
Avoid invoking the preupdate hook from within sqlite3_blob_write() if the cursor is already invalid.
A new approach to working around the GCC bug.
Enhance the tokenizer so that it is able to deal with individual tokens larger than 2GiB.
Avoid 32-bit overflow when calculating ncycle for ".scanstats vm".
Mark shadow tables when registering a new virtual table that already exists after the schema has loaded. Test cases in TH3. [bugs:/info/2026-06-26T12:45:51Z|Bug 2026-06-26T12:45:51Z].
Add the ability to compile with -DOS_VXWORKS=1 on Linux systems, in an effort to debug the VxWorks capabilities without actually having to run VxWorks.
When using a read-only WAL/SHM, handle a corrupt page size in the WAL file correctly. [bugs:/info/2026-06-11T22:20:03Z|Bug 2026-06-11T22:20:03Z].
ifdef adjustments so that SQLITE_OMIT_WAL works with SQLITE_USE_SEH.
Refactor the SrcItem object so that information about subqueries is stored in a separately allocated Subquery object. This reduces the memory requirements for SrcItem and makes the code run faster. It also provides an expansion path for subquery processing that does not burden simple queries. The current checking mostly works, but there are still issues that need to be tracked down and fixed.
Always take a copy of a value used to drive an index as part of a RIGHT JOIN loop. Otherwise, the RIGHT JOIN loop and the body of the loop it jumps back into may interfere with each other. Possible fix for [bugs:/info/2026-07-29T05:33:50Z | 2026-07-29T05:33:50Z].
When processing a vector IN(...) term in a WHERE clause, do not add individual terms for each column if the RHS of the IN(...) is a query that is expected to do the special min-max aggregate behaviour. Possible fix for [bugs:/info/2026-08-03T09:05:06Z | 2026-08-03T09:05:06Z].