1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-09-05 10:44:27 +03:00
Commit Graph

30276 Commits

Author SHA1 Message Date
stephan
67695a30ea Minor doc and consistency improvements to [cf7163f82ca380958].
FossilOrigin-Name: 690a7273226df361f3eaa90f9b693ba554ed9d9456c19c5d3a12e812eca49eab
2025-07-31 07:44:18 +00:00
stephan
3e616d3445 Back out [e283d817e3a9] because further testing has proven it unnecessary.
FossilOrigin-Name: 7318a00de64ec89c2a08d86e9f50c694894c4b59b07ff52b0d1f9f0ab8c4df44
2025-07-30 21:39:27 +00:00
stephan
d38777134b Move the flexarray union members from [527bbc1676a85a9] to the end of their respective objects.
FossilOrigin-Name: 3082e07926695863bd5ef51c3c4803fbe267dc0d9b6ac9a717c225459f8988ba
2025-07-30 21:34:47 +00:00
stephan
df23b518da Apply alignment-related patches suggested in [forum:41cd226375cd49c6 | forum post 41cd226375].
FossilOrigin-Name: 527bbc1676a85a927352cd10a292afe041a72692ec0b1360e5a1ccaa19a32fcb
2025-07-30 19:48:12 +00:00
drh
7957c70947 Default pointer size for the __SUNPRO_C compiler is 4 bytes.
FossilOrigin-Name: e283d817e3a93a3cd42c7b79e08e5fb61cb4fa4734137b92f1748dbbe8b8b919
2025-07-30 18:23:33 +00:00
stephan
b79848edd4 JS: ensure that sqlite3WorkerPromiser.v2.defaultConfig initially refers to sqlite3WorkerPromiser.defaultConfig. This fixes a longstanding oversight rather than a known in-the-wild problem.
FossilOrigin-Name: cf7163f82ca380958a79350473b2c5a2cebda7496d6d575fa2835c362010fea1
2025-07-30 16:17:14 +00:00
stephan
1560d52f82 Adjust the previous check-in to replace the db's WASM address with yet another random number, and increase the range of random numbers, reducing the chance of cross-worker db ID collision to 1 in many billions.
FossilOrigin-Name: f5e2a72c57e802c5042ab8343e5009ba9f22ca7138a1c78f4b8201ab9b4fd395
2025-07-30 15:02:32 +00:00
stephan
f402509b62 JS: add a random element when assigning db IDs to Worker1 db instances. This addresses [https://github.com/sqlite/sqlite-wasm/issues/113 | the npm project's ticket #113], which demonstrates that two independent workers can end up generating non-globally-unique IDs. That's not a bug, per se, but it makes the IDs useless for client-side mapping of db connection IDs to client-side state, so we add some randomness to them.
FossilOrigin-Name: 6d2a43075fda9c4eae28f9ca4aaf459c41d305c861947a47fb2cbd513249c4b9
2025-07-30 14:50:44 +00:00
drh
bac6793a8a Enhance the printf formatter for %#f such that the minus sign is omitted
if the '+' is missing and all digits shown in the rendering are zero.
Thus, for example, '%#.2f' renders -0.004 as "0.00" instead of "-0.00".

FossilOrigin-Name: 09e1d7c7b4615262dd03adf1be201122f3cb8909ad381d67f51c812f07e25719
2025-07-30 13:37:49 +00:00
dan
7423ecb0a9 Fix SQLITE_OMIT_WAL builds on windows.
FossilOrigin-Name: 575271c3ae53c64784a2aa1e9b7c6cdcb0402022967155dd176a6b1f1e560b50
2025-07-29 11:04:32 +00:00
drh
7bcb650f57 Add new extended error codes to SQLITE_ERROR and SQLITE_IOERR, for use
by extensions.

FossilOrigin-Name: 02b241bc4ce72d50a8d7621a663e759443b532a5ff9354fc3266ad6bb9433ed4
2025-07-26 12:51:18 +00:00
drh
6d7be8293e Do not apply the [/info/e33da6d5dc964db8|EXISTS-to-JOIN optimization] if
the subquery contains a LIMIT clause.
[forum:/forumpost/2025-07-23T10:59:14z|forum post 2025-07-23T10:59:14z].

FossilOrigin-Name: 314c493f273a34dff7b9f954e7553bc540bbcf5b913f779ef9ce0b9ba11acf7a
2025-07-23 12:48:16 +00:00
drh
5a6f651397 Fix a potentially uninitialized field in the WhereLoop object that is used
as part of the skip-ahead-distinct optimization.  This fixes various
[forum:/timeline?ymd=20250722&u=yxchen&vfx|recent forum reports from yxchen].

FossilOrigin-Name: c10f9970c6a3ffacaef0f0728fc7ff11011686835dc78ca43035c0493e0af319
2025-07-22 15:51:41 +00:00
stephan
d649d7b90c Apply [ebb346c5aa]'s change to sqlite3.1, as reported in [forum:bf92f78344 | forum post bf92f78344].
FossilOrigin-Name: 477211be60cd873d078293f0dd767506c069c3dd83bc1759ae7258d4d3dff359
2025-07-21 18:00:44 +00:00
stephan
095d399e7c Ensure that certain local files are not inadvertently carried over into the snapshot tarball and causing confusing build results.
FossilOrigin-Name: 47fdf7ed2cad7ec56118cf4f77297b1178cd2104a21b19d4afad46437a944378
2025-07-20 18:29:35 +00:00
stephan
fdd37e9637 Teach autoconf/tea/configure to be able to run from the canonical source tree so that a snapshot build or appropriate symlinks are not necessary in order to test the extension.
FossilOrigin-Name: 71b9365b848d9b2bc75336ebbec815eba3a7ed5168798759753a990a1b706fc8
2025-07-20 18:05:45 +00:00
drh
2445ee0e37 Factor out the unusual encoding-change case from vdbeCompareMemString() for
a performance improvement in the common case, and a small size reduction.

FossilOrigin-Name: cbd46ab8a8b4622f42dd9f87f28b812c1d6fa5ea73a4e8f1253514455f397783
2025-07-19 20:10:07 +00:00
drh
ea8f9708c5 Small performance optimization in sqlite3VdbeRecordUnpack().
FossilOrigin-Name: eae168def2ff11f57f730f8a3bd86748b0943077e37b2709c10de0aecff664ec
2025-07-19 19:54:44 +00:00
drh
bcd14a0a3e Split the (internal) sqlite3VdbeCheckFk() routine into two variants,
sqlite3VdbeCheckFkImmediate() and sqlite3VdbeCheckFkDeferred(), which
run faster than the combined general-purpose variant.

FossilOrigin-Name: 872b1b52ed93ef85911c2ef87b15673f9e102aef564f208e0a916af62671df93
2025-07-19 18:46:03 +00:00
drh
c585e03a4b Use fewer CPU cycles to commit a read transaction.
FossilOrigin-Name: 861e55656abb208b4f1f2c8808c76c0454427af85a8930ab53f9c053605f39c7
2025-07-19 18:17:06 +00:00
stephan
1f436ad563 Add SQLITE_SELFORDER1 to JS's sqlite3.capi namespace. It's only useful when built with an sqlite3.c which itself was created with -DSQLITE_ENABLE_ORDERED_SET_AGGREGATES, which the canonical build does not do but custom builds may.
FossilOrigin-Name: fdd15e938ccfac9e871d781d1c8fe8be6dbd9e8cbbcb8b7f0b035e5ceebb8746
2025-07-18 22:18:41 +00:00
drh
daa4cdf84a Fix a minor comment inaccuracy.
FossilOrigin-Name: b66fcb61a1d044fa18419ab382a8b159e9b6bb52956917d8a9de4dccf8dc9a87
2025-07-18 19:17:32 +00:00
drh
bae748a76e Increase the precision of the "real time" output from the ".timer" command
in the CLI from milliseconds to microseconds.

FossilOrigin-Name: c5dbe93114d318fea431859e388af74aeb4cb854c514c9910590441c990321f3
2025-07-18 17:40:34 +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
stephan
01a2953350 Pedantic internal build doc fix.
FossilOrigin-Name: 9ef429a8507745e0a6fae4f0ec1dc2b142dad1357f9a7ff576e7834c8ff5c6fe
2025-07-17 19:18:01 +00:00
stephan
cf05295a85 Diverse wasm build cleanups.
FossilOrigin-Name: 14ca18f72a7edde7c65a6c6b23fdc3f5ed6860371795926045c987f7b2c75e1b
2025-07-16 20:50:40 +00:00
dan
91db1c413b Fix vtabH.test so that it works on windows even if there are files that begin with "$" in the root directory.
FossilOrigin-Name: 19a79219a7d52272102ff09d19e6b9b87e88e0070592fd7e6040bd8ce66ad238
2025-07-16 17:24:31 +00:00
stephan
10687e283a Remove some stray makefile debug output.
FossilOrigin-Name: 7ef22c3d11088210d2267375ec188bd352b067614200394b9877f2e40dc12bb2
2025-07-16 16:56:33 +00:00
stephan
074b1aa42d In the wasm makefiles, replace X:=Y with X=Y because := has different semantics depending on the make impl and its use is arguably a bad muscle-memory habit worth breaking. These makefiles are very specifically for GNU make, but long-term it would be nice to eliminate that requirement.
FossilOrigin-Name: d4203311a2f39189ed8f30d519468aed8983af7772a5b247e7557d3e1936064e
2025-07-16 14:51:23 +00:00
stephan
522ce56734 wasm: remove some extraneous levels of makefile var and fix the (unsupported) wasmfs speedtest1 build to account for var renaming which happened long before this.
FossilOrigin-Name: 35b2315343e22ca12c6ee3f5be8741eba889bb6461e08fad0a8ae7db033319cb
2025-07-16 13:22:38 +00:00
stephan
68b74e2c42 Remove an unnecessary step from the wasm builds and account for a recent Emscripten-internal code-generation change which caused a post-build cleanup step to not actually clean up (harmless, but adds about 26k of useless stuff to the resulting JS).
FossilOrigin-Name: a8ed16989dcd324bd9caa09aec7979249deaf59ca13bc377379ddd83c53379cd
2025-07-16 11:56:16 +00:00
stephan
e5a7b815af Further internal wasm build cleanups. No functional changes.
FossilOrigin-Name: 8364d89c3bc1d1dbd95b4324a41bd655251ebd2da5b9f1b9f9aceba9c3d26d3d
2025-07-16 11:09:18 +00:00
stephan
f98148be9c Internal refactoring of the WASM build makefile rule generator, working towards parallelizing the various build modes (which is not currently possible because most modes share the same sqlite3.wasm output file name).
FossilOrigin-Name: 1062b61e9c949d76791ed7974cf6c38d1cec9797a930e9ad7ca851130f5e9a48
2025-07-16 10:34:14 +00:00
stephan
27e13f4f3a Teach the sqlite3 CLI shell to look in XDG_STATE_HOME for the CLI history file before falling back to its historical location in the user's home directory.
FossilOrigin-Name: 1e663374c3fcc20ab0b3250aa1ff9d5e5ac391c89808ad589aa30c8882d4b61e
2025-07-16 09:27:55 +00:00
stephan
3a97a1ba8c Squelch a legitimate but harmless 'discards const' warning.
FossilOrigin-Name: 73539fe0932494234b8f2293b0dbc1f0aac60a7d00fdaf4a59c2da654ce26f5b
2025-07-16 09:20:02 +00:00
dan
81e9bbf8da Avoid evaluating special vtab operators (e.g. MATCH) that are part of ON clauses attached to left joins from being evaluated too early. Fix for [forum:/forumpost/428ef7c468 | forum post 428ef7c468].
FossilOrigin-Name: 9f184f8dfa5ef6d57e10376adc30e0060ceda07d283c23dfdfe3dbdd6608f839
2025-07-15 19:00:01 +00:00
dan
7d20c2e8a3 Add test case to between.test.
FossilOrigin-Name: ffebbb7ae977adc6c729d30b51f2ff29d416e018d82e450d87ccd973472819c8
2025-07-15 18:51:46 +00:00
dan
192d0ff8cc Optimize allocation of large tombstone arrays in fts5.
FossilOrigin-Name: 0fcc3cbdfa21adf97aed01fa76991cccf9380e2755b0182a9e2c94e3c8fb38d7
2025-07-15 14:06:15 +00:00
drh
97e6368abc Add the snapshot-zip makefile targets for both Windows and Posix.
FossilOrigin-Name: 8c73c0c5935431556f687556bfdb459754609f07c6366c810a55bf7583ee303d
2025-07-14 18:27:32 +00:00
drh
1c11aa3da2 Enhance the "mktoolzip.tcl" script (used by the "tool-zip" makefile target) so that
it uses "fossil test-filezip" to build the ZIP archive if available, and so that
it also generates windows-dll-*.zip on Windows platforms.

FossilOrigin-Name: 63ddc215eb6106985c53d3c8d99f5445a92acf4359a6bb2681882c49583df871
2025-07-14 16:05:59 +00:00
dan
bf5f1f5172 In rtree.c, ensure that the pReadAux statement is reset whenever the bAuxValid flag is cleared. Fix for [forum:/forumpost/3e45ed31d8 | forum post 3e45ed31d8].
FossilOrigin-Name: 3c0afda372cd688e9aff7be1c0a41f557c8c8819f5f47420166ce8255cd806c8
2025-07-14 15:40:25 +00:00
dan
194f0bada7 In rtree.c, ensure that the pReadAux statement is reset whenever the bAuxValid flag is cleared. Possible fix for [forum:/forumpost/3e45ed31d8 | forum post 3e45ed31d8].
FossilOrigin-Name: 1740f9a09850f6647fc1f6384353d89a1ac0b2b15c429b576b6014eada71937e
2025-07-14 15:34:11 +00:00
dan
08f8111bd8 Add new sessions function sqlite3changeset_apply_v3() and its streaming equivalent. This allows changesets to be filtered on a per-change basis, not just per-table.
FossilOrigin-Name: 10ebd7a119ef1985755ef143a941fbaed1b5ca1c8a71e011c8bbc70e383fd337
2025-07-14 14:51:43 +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
dan
bcfe38b96a Avoid evaluating special vtab operators (e.g. MATCH) that are part of ON clauses attached to left joins from being evaluated too early. Possible fix for [forum:/forumpost/428ef7c468 | forum post 428ef7c468].
FossilOrigin-Name: 18ba07c152294a96d510a7851a0860f982ff1e0725afeebed9a343f550f6925a
2025-07-12 18:14:41 +00:00
stephan
1b8f6558f8 wasm: introduce the sqlite3.oo1.DB.wrapHandle() and Stmt.wrapHandle() APIs, which enable clients to wrap (sqlite3*) resp. (sqlite3_stmt*) pointers in their oo1 API counterparts, optionally with or without taking over ownership of the pointer.
FossilOrigin-Name: e5d079549594ca44852773b8919894866394e47ad725dadc7f65242413a219d3
2025-07-11 19:52:36 +00:00
stephan
1f68085849 Clearer docs for the unowned db/stmt handle mechanism.
FossilOrigin-Name: 53401b5435e30c4b47b6e203976b714d616246d734b5876a34f53f6388f872f8
2025-07-11 19:44:42 +00:00
stephan
c493e4516a Correct a one-too-many-exclamation-points bug which caused the opposite of intended semantics in oo1.Stmt.pointer ownership.
FossilOrigin-Name: 91e709f36d36174534b4cf4ff548a558e66cca5e23a6c8c106bc43375fc3ce72
2025-07-11 19:34:30 +00:00
drh
69b5674b40 Additional header comment documentation in the ext/misc/vtablog.c test extension.
FossilOrigin-Name: 3656acfaa3011321a6e17fb81e5bdedcfffeab6035f133ab89ae9589bf5bef72
2025-07-11 17:02:11 +00:00
stephan
0eca9db776 speedtest1: in WASM builds, disable the "app" test set by default because that one set is triggering file-not-found errors for the db file for reasons not yet understood.
FossilOrigin-Name: 9d68971c58261bce72b49c574cf07ad31add62bee814c58840b927fed7eb87b1
2025-07-11 11:06:25 +00:00