Commit Graph

31778 Commits

Author SHA1 Message Date
drh 31c19f587d Fix another off-by-one error.
FossilOrigin-Name: 8ae724a647dfcb986c4037caaab07e5d0188e66b66039a4758937c963f1fcbf7
2026-05-07 14:30:34 +00:00
drh bfc0414b9a Bug fixes in the new %J and %j logic.
FossilOrigin-Name: d1b55572c76569cb1e999028e79bcf2e76069f8778f0c8e933ace606d7b6a8b2
2026-05-07 14:14:05 +00:00
drh f9db8b2350 Add support for width to %J and %j.
FossilOrigin-Name: 0b102f2076586c08b134c78cc18acdd05555fa2b534c895535e96a0466661910
2026-05-07 10:46:39 +00:00
drh ad37ec3aa2 Separate conversion letters %J and %j. %J includes surrounding quotes and
%j omits them.  Some test cases added.

FossilOrigin-Name: ea7c2c1a6bd32695fc3a1f2295b4c4719e3d9dd0a8f6480e7c95e17b564c3391
2026-05-07 08:58:10 +00:00
drh 4b77e36dec Get precision working on %J, both with and with the ! flag. Width is
still a no-op, and there are no test cases.  Incremental check-in.

FossilOrigin-Name: 18166bce208c64b7f3afaa88c27a10e0295a89f9c72942dcaa949cf7efb479e6
2026-05-07 00:02:55 +00:00
drh 3ece90420d Experimental prototype of the %J conversion in printf().
FossilOrigin-Name: 7f6b1bae0849f0a840b95ae95aa6fdc6d51b72fdd50493649f584ad7829a3060
2026-05-06 20:48:34 +00:00
drh 8ff6523afd Fix a minor typo in a comment in the json module.
FossilOrigin-Name: 5c6d3e9d83af94234f67b06bd23c4eb0178a80c74c39be4945b3282244630020
2026-05-06 19:13:21 +00:00
stephan 821323938d Minor internal doc typo fixes.
FossilOrigin-Name: d588680240a7f4395f2ef52dd78635de66120a677a41a28ceb96921b3333973d
2026-05-06 06:57:42 +00:00
stephan e572525306 Delete the OPFS SEE test dbs when done with them.
FossilOrigin-Name: cbb9f7bcd04c586d523192f32c0ce7dcec72a76bb9a9c3b67fcde1f9e79f7218
2026-05-05 15:31:41 +00:00
stephan 082aebfa0d Add importDb() tests of SEE databases for the opfs/opfs-wl VFSes, analog to the opfs-sahpool test in [a5a9ac7ad6622b].
FossilOrigin-Name: 534d388031dfacf83cb40c712150a376db10393c98936a33ea80da0166b3dbeb
2026-05-05 15:26:24 +00:00
stephan 6f842b8da4 For the various OPFS VFS db-import routines, in SEE builds (only) relax the is-this-a-db check to allow for SEE dbs not having the usual header string in cleartext. Addresses [https://sqlite.org/see/forumpost/f84bef3552|SEE forum post f84bef3552].
FossilOrigin-Name: a5a9ac7ad6622b5b07193aa279deefde7d59ca17f81aba9dd78ee90718446993
2026-05-05 08:51:10 +00:00
stephan 3d84988efe Fix a predicate which causes a false error in the OPFS SAHPool tests when building with SEE.
FossilOrigin-Name: 97ab0a2fd56501d08bc2ab2adbe70a4130f6c5b5db343941fa16c7b34c550bd3
2026-05-05 08:11:55 +00:00
stephan 128f65ca6d Add #include time.h to shell.c.in to get fiddle building with emcc 5.x.
FossilOrigin-Name: ae675dfe7946d37f224f22ad34b6ebe049fb1426cb3d49d88ebc10d0b7634e40
2026-05-05 07:57:54 +00:00
drh 79a4591478 Fix a test case on CLI ".help" output due to the output changing because
of check-in [1590b401ff0670b6].

FossilOrigin-Name: b6ad35096d48de29fd8da498ac23cd7eba9194a70cad05ec49c318f11fe77199
2026-05-04 18:36:04 +00:00
dan 14fa0e9b86 When using the OR-optimization on a loop created by exists-to-join, do the early-exit logic for the whole loop, not for each individual OR branch. Possible fix for forum post [forum:c8b205720c | c8b205720c].
FossilOrigin-Name: 70a5d091241748aea63aa13bb218b573d0b84615a0682c2ec693addbfe9bc2f4
2026-05-04 18:16:09 +00:00
dan b4d42c6702 When using the OR-optimization on a loop created by exists-to-join, do the early-exit logic for the whole loop, not for each individual OR branch. Possible fix for forum post [forum:c8b205720c | c8b205720c].
FossilOrigin-Name: 3d197dd03c47a0fb687064131dbf519b8c587a47f9c2bccfdb83d7eae8418336
2026-05-04 17:16:43 +00:00
stephan 3ed7926e2f Add a missing tcl quote which breaks the build on msys2.
FossilOrigin-Name: 9380be51c76392eca9544f1fd56373406d2ce001e77a8d476deb772968f2aacc
2026-05-04 16:18:25 +00:00
drh 8923a68c5f Add the --color and --no-color options to the ".prompt" command of the CLI.
FossilOrigin-Name: 1590b401ff0670b68910504c281e67ecae7ae357ba3ed65f96dabaabd7aaeb7f
2026-05-04 12:58:05 +00:00
drh c94c21d0a6 Honor the NO_COLOR environment variable. If NO_COLOR is set and
SQLITE_PS1 and SQLITE_PS2 are not set, then the default prompt is
monochrome and ANSI escapes are omitted.  Also change the name of
the SQLITE_PS_NOANSI compile-time option to SQLITE_NO_COLOR.

FossilOrigin-Name: 7e4134e3ff1ca8712f5fc78fadae665549450988dc43af27c7fe0c77f10ce3fb
2026-05-04 10:14:13 +00:00
drh fb7c642990 New test cases for the shell prompt
FossilOrigin-Name: 2340cbbd230bdadedbb5d3eb9cfd287fd934e69ce5a2c989e141b0fc87b947aa
2026-05-03 18:31:49 +00:00
drh 2bc658c387 Improvements to the non-printing character delimiter logic in the CLI
prompt, for improved accuracy and for improved testability.

FossilOrigin-Name: f5649795cd8d7a1f270037ef0b212ea605c1665ec05a75a6da0b250f2aeab070
2026-05-03 15:53:52 +00:00
drh f02745088c Change the non-printing character escapes for editline to U+0001 and
U+0002.  Also insert those escapes for readline.  Readline does not
need it (because it can figure them out on its own) but they are needed
when editline is being used in readline-compatibility mode, and we have
no way of distinguishing between editline and readline in that case, so
we might as well include them.

FossilOrigin-Name: b9545b0f0b6fa0a777a064e1410b17f52cb49d853c188f9b8b3a772bd810ece3
2026-05-02 23:40:40 +00:00
drh 596008f078 Attempt to automatically insert U+0001 escape bytes before and after
ANSI X3.64 escape sequences when using editline, to work around the
limitations of editline.

FossilOrigin-Name: 63050bee6e5ed46cead14bd5a02b0cb6a7dbcdcb6a56601b90c10cf1c8d84efc
2026-05-02 23:03:42 +00:00
drh 1c9e8ca88b Fix a harmless compiler warning on some MSVC versions.
FossilOrigin-Name: bb8f6deeff31e9cc9b5a88b17b29dc6cd4fb4515134fa8e9758e33e42bbe89b0
2026-05-02 20:19:31 +00:00
drh c70fbd39f9 Minor optimization to the authorizer.
FossilOrigin-Name: 625f78a630bbf897f945065f1b85a92fe26e426302c8f6edc4d26a817ff62358
2026-05-02 17:30:33 +00:00
drh 9db9f18985 Fix harmless compiler warnings.
FossilOrigin-Name: a0d0b5aff51088699e5ad0a726c350d10744b1779acd9ee54232659fb4c352a4
2026-05-02 15:58:28 +00:00
drh f107c52d4c Close database connections in a timely manner to fix test script problems
on Windows.

FossilOrigin-Name: 068a53865a17d4c2b4ce227fc08a2c019d1dbf31d833842ec08ab5665a3565a3
2026-05-02 11:47:22 +00:00
drh 7509c6351e Fix an SQLITE_MISUSE memory error in check-ini [1f940357f7bb160b].
FossilOrigin-Name: fc64113e8f9aee0161e682db7c244a7849f2db86551a557b276deb1785941476
2026-05-01 17:42:15 +00:00
drh 57e46429fe Harden the recovery extension against SQL injections coming from the
sqlite_schema table of the database being recovered.

FossilOrigin-Name: 9190f1b9b8889e4d80c370db36b916744d5779de0ec51da0369bbe74adb7b931
2026-05-01 16:06:21 +00:00
drh a9c2e08087 Check-in [1786fcd5b4ee6cd9] works great and generates correct code, but it
upset UBSAN.  This check-in fixes the UBSAN complaint.

FossilOrigin-Name: 7cd76847e8c9b683e39c1063a343288f11b4aa5e9302394fe0c4244d361ee4f1
2026-05-01 16:03:51 +00:00
drh 7f1f4c803d The value for /f and other filename substitutions in SQLITE_PS1 is now
"memory" if open on an in-memory database.

FossilOrigin-Name: 4aac1057eeaf6c29a4893e9c080497c780b0963e810c501532d79eba1b457f27
2026-04-30 18:23:58 +00:00
drh bd13573a96 Remove lots of code used to support legacy Windows version (WindowsXP and
before).  Use Slim Reader/Writer Locks on Windows for non-recursive mutexes,
since SRWLs are now available on all supported Windows platforms.

FossilOrigin-Name: 6f7a5ff22db10f889596239aae5f6a1130cbdfe72612ceee68cbeb3b86e40227
2026-04-30 16:52:56 +00:00
drh 0cadeecf6f Fix a harmless compiler warning in src/mutex_w32.c.
FossilOrigin-Name: 8de796ca459f2c996937fe1107838b217572636110c8c09e358343385bf17a1b
2026-04-30 15:41:01 +00:00
drh ad52288e0d Fix the memdb1.test test module so that it runs correctly on Windows.
FossilOrigin-Name: 9012f8ea7454bbb792b4361ed74d778e02b98ef44a443f9a23a27a4222fda747
2026-04-30 15:33:44 +00:00
drh d5f0e01593 Change the CLI warning that appears in the header about opening a
in-memory database, to be more readable.

FossilOrigin-Name: cc64cafdfe0b0965fabaf9d561d9a108c20a3643f71b36e6a6c51fc8f30b82cb
2026-04-30 15:19:09 +00:00
drh 3e663bd8c7 Add the /m escape to the CLI prompt string. Use it to show "memory"
in italic for the default prompt for in-memory databases.

FossilOrigin-Name: 1e3c95393044279997833145cb610b98926fb0c8f53ae4fb35e9fcc6c1ded1a2
2026-04-30 15:07:25 +00:00
dan 97901bbd69 Fix a crash that could occur if the destination database of a backup is
replaced using sqlite3_deserialize() between the call to sqlite3_backup_init()
and the first call to sqlite3_backup_step(). Forum post [forum:15d82885e2 | 15d82885e2].

FossilOrigin-Name: 1f940357f7bb160b583ac5b08ff4e32a9fef353255d032c5a18bcb04416c0f0b
2026-04-29 19:14:54 +00:00
drh c549e28c67 Reduce the number of system calls in the os_win.c thunk from 81 down
to 58, as well as other simplifications.

FossilOrigin-Name: c49521739c961ed5e38424bf26b2e34d8017a85122622ceac5af7398233fe343
2026-04-29 16:09:47 +00:00
drh 90dae0d01d Further simplifications to the interface to the Windows family of OSes.
An incremental check-in.

FossilOrigin-Name: f2aa6b66d2a1b5bb2dc8a44788a061a549a846244354df19b44398839578461e
2026-04-29 15:03:01 +00:00
drh 0a0a52ae93 Simplify the Windows interface by removing support for various WindowsXP
and WindowsCE.  This is a work-in-progress.  More to follow.

FossilOrigin-Name: 4dbc4d19c4f3b58d0bedd766cfba65d9624903a5ab0a340eb83ddeec058607ea
2026-04-29 14:02:23 +00:00
drh e1d4680fdd Updates and simplifications to the mutex implementation on Windows. Uses
Slim Reader/Writer Locks for performance, for non-reentrant mutexes.
Requires WindowsVista or later.

FossilOrigin-Name: a75aa5400f94531b8ffd00be4580b0578d8d81ba9681fd06b1d9d96a6180994c
2026-04-28 20:01:03 +00:00
drh 532e506d18 Attempt to align instances of the sqlite3_mutex object at 128-byte boundaries
to prevent false-sharing in multi-core machines. See the discussion at and
around [forum:/forumpost/2026-03-25T23:15:03Z|forum post 2026-03-25T23:15:03Z].

FossilOrigin-Name: 1786fcd5b4ee6cd9b4780f3687dfaec5b90ef0476e0da266a94e069b98e70514
2026-04-28 15:12:40 +00:00
drh c9bed48c3c Fix comment typo
FossilOrigin-Name: d64a1dbe0fb2d9286806d833a3146b21d5bf1636a650d5a64cf163c7f2356e98
2026-04-28 12:49:10 +00:00
drh 6b4eb6725f Improved detection of when the alternative windows-compatible main() is
needed in the sqldiff.exe utility.

FossilOrigin-Name: e25b849a603cb08ab888641ff324e9aa129391c4792de86a62c55e9caf84c16e
2026-04-27 14:01:23 +00:00
drh 6176034151 Relax arbitrary length restrictions on some error messages in the CLI.
FossilOrigin-Name: 52f5531ded8e0d3da3dc4d5c9b3d14573041b9446e2c45b5093c958b6c74e0de
2026-04-27 12:43:09 +00:00
stephan 7471b5d6c0 Increase a stack-local buffer size to resolve a test regression introduced in [ff084ae341eab5c], in which some tests fail a pattern match check if their absolute file names are too long. Resolves [forum:205f73db1b2806f5|forum post 205f73db1b2806f5].
FossilOrigin-Name: 286fc22c7ca882b0b09de2f1b2a7e0b382af6c498f2f8ad237fe064feaa70d7f
2026-04-27 12:05:56 +00:00
dan 1fc7341ad2 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].
FossilOrigin-Name: 77662cce9aa452ba5820e5f1a864a802763bd83b937cdb16e7025219eff7bd08
2026-04-27 11:32:43 +00:00
stephan 6af10b0efd Refactor the uint128 type check to consolidate duplicated rules.
FossilOrigin-Name: 362ef7bc00eea180fb3458bd8887021aed54e321901483edc00ad6b23a33d8e5
2026-04-27 06:48:07 +00:00
stephan 70d1e3e75e Feature detection fix for uint128 on RISCV 32-bit, reported in [forum:f8d1417ce8eb2f22|forum post 2026-04-26T11:41:01Z] and validated by the OP.
FossilOrigin-Name: c4a2c20839ef75534d71d928a03ad276bdc488b0baa76c1505f48dc1ff0bcdd1
2026-04-27 05:55:38 +00:00
drh 74006fdcdb Improvements to temp-file cleanup on close in the CLI.
FossilOrigin-Name: 048c969c34eaaf8c203b996e999a7dbc94c47b4959719af9e6625052520f7135
2026-04-26 18:35:26 +00:00