Commit Graph

18879 Commits

Author SHA1 Message Date
drh c2e400af04 New assert() statements to validate OP_OpenEphemeral logic.
FossilOrigin-Name: 6d55c3e238e06c6727f3e816a9268b6222ebfc90ec745bbbd48430bf7b16664c
2024-10-18 01:14:14 +00:00
drh fe15ed4342 Fixes from code inspection:
(1) Extra paranoid defense against integer overflow.
(2) Remove a stray blank line in an FTS5 comment.

FossilOrigin-Name: 8563728deeb1d3ead9ff99a3ad2c7819b2223ead44e7374ecc7bbeda2d955ade
2024-10-17 18:12:03 +00:00
drh f578ce102e Change the name of the new utility program from sqlite3-rsync to
sqlite3_rsync - dash changed to underscore - for consistency with the
preexisting sqlite3_analyzer.

FossilOrigin-Name: 86e794cbaa5ae600635c933b46298a39f2465daf4c5cd1570f2a03e19ac08d9d
2024-10-16 11:05:11 +00:00
drh 87cb97b0ec Fix harmless compiler warning in flockCheckReservedLock().
FossilOrigin-Name: f369de3d8fa34a403b5c9f6269f7e3fdb16a13784a70460c5032ad4e66615d64
2024-10-15 22:22:53 +00:00
drh 1b59f37c06 Fix a typo in a comment used to generate document. No code changes.
FossilOrigin-Name: 9b4bc5c4c1dc7c4ba359babc71c07ac3a6719971766951a8d2cb1df9e2396a83
2024-10-15 14:28:23 +00:00
drh dcaae8fd4b Cross-reference the sqlite3_backup_init() function to the documentation for
VACUUM INTO and sqlite3-rsync.  Comment changes only.  No changes to code.

FossilOrigin-Name: 405c23ce02cc7f970e732afc26e01d0267b8fa89d8edc3d53fae2b3bc8405cbb
2024-10-15 14:00:29 +00:00
drh 4924847cb9 Avoid the possibility of buffer overrun in the READ_UTF8 macro by using
an less-than operator rather than not-equal-to.

FossilOrigin-Name: 20e60bf058c54bc818ea1b8ce54ace8bcd50699734713cef622bf79e49a9a279
2024-10-14 18:43:04 +00:00
drh 5899d9c08f There is no need to DELETE the content of sqlite_sequence in the output of
the CLI ".dump" command because that table will initially be empty if it
exists at all.  [forum:/forumpost/2e31f49d00472cec|Forum post 2e31f49d004]

FossilOrigin-Name: 8d7fe903d09a2a7961f506b2c8e93765e4feb7cd48aac436d75c7ec7838e856a
2024-10-14 11:48:19 +00:00
drh 39b9249562 The CLI now default to ".crlf ON" in Windows. CSV output always uses CRLF on
all platforms.

FossilOrigin-Name: 84d19f03b1989d665547745defcd95fc927f8389ed65c76195a39206435791ba
2024-10-14 10:45:02 +00:00
drh 863fcdc116 Be consistent about using "CRLF" instead of "CRNL".
FossilOrigin-Name: ec4f4cfd5f8ca83fad4f08cf6566251d9c63e50a3a4284baca299bd94b047951
2024-10-14 09:19:02 +00:00
drh 72fea11809 Fix a harmless compiler warning in the CLI.
FossilOrigin-Name: 31c46e84fffe29c45fc63ae8cd1f96f42196f0ab56e72cd07b4eedbd9058e85b
2024-10-14 09:08:02 +00:00
drh 17408fbbd8 An improved method for statically linking sqlite3_analyzer.exe using Tcl9.
Enable wildcard expansion of arguments to testfiture on Windows.

FossilOrigin-Name: 9b87ea219bce5689a69efac31063b9b11928e59124c0d36194715ff7faa5129d
2024-10-11 17:02:37 +00:00
drh b23cce9a16 Fix the CSV output mode in the CLI such that the line ending is NL by default
but goes to CRLF if ".crnl on" is set.  Make the .crnl command available on
non-Windows builds.  Update the .crnl command such that if it has no arguments
it shows the current setting.

FossilOrigin-Name: da750e39df7bf42330d8c8b266300da07247c9619895861b4cff4be7c94db7cf
2024-10-11 14:30:58 +00:00
drh 0b453b3b33 Avoid undesirable NL to CRLF translation when doing binary output to the
Windows console.

FossilOrigin-Name: d25bdce36abed95524ad058a277aba7bb17270e7ff1476474713dbc29742c762
2024-10-11 14:02:48 +00:00
drh 64366ae114 Improvements to TCL9 support. Fixes to the Makefiles so that the "install"
targets are consistent and so that they work better with TCL9.

FossilOrigin-Name: bcfae7183e92ce37717852bae5b1dd526903fa8429fb6f738c2147d4e5231642
2024-10-10 10:47:37 +00:00
drh 7b179a3098 For compatibility, allow the TCL interfact to continue working with TCL 8.5.
FossilOrigin-Name: 69346e9d4704e8fd82cbb3359913191e05cb38ee591baf97dcfe321db0ea085e
2024-10-10 10:33:31 +00:00
dan 48dd75df73 Fix the xCheckReservedLock() method of the flock VFS to avoid dropping the file-lock.
FossilOrigin-Name: 8ffaf85249ff38ceea037a6e96b3484c912f1c1aa55b8642297d592768661344
2024-10-09 15:40:07 +00:00
drh 50bb0aaa2c Changes to the TCL extension and how it is built, suggested by Jan Nijtmans.
FossilOrigin-Name: 9c0690193200551a3218c576b19eaf40e330dc252d67b430204ff44495e4793e
2024-10-09 13:19:21 +00:00
drh 4b0a2e0106 Improved handling of unicode characters in the LIKE optimization.
Follow-up to [bce52ce2a6e7f3d3].

FossilOrigin-Name: 9d0eb3980409115f2f6fd1720a03f34e3968c93be55feafdfef20bf5f711c17f
2024-10-09 11:52:29 +00:00
drh 7f5a10e4ba Enable the ".crnl" command on Windows builds of the CLI even if the
SQLITE_U8TEXT_ONLY or SQLITE_U8TEST_STDIO compile-time options are used.

FossilOrigin-Name: 6364a2f0449794b0c089ba9fbc099f5558b88ac91c459caf7fae3a43dfcd192e
2024-10-08 17:27:00 +00:00
drh ab85d9abd6 Additional improvements to the behavior of ".crnl" in the CLI. The default
output mode is O_BINARY so that results are identical on Windows and
non-Windows systems.  On Windows you can optionally do ".crnl on" to enable
NL-to-CRLF conversion on output.  Output to Windows console is always
O_U8TEXT and so is unaffected by the .crnl setting.

FossilOrigin-Name: dbfc10b8981bcce4f875c4adef43f398871b41551074445087e343ded50253c5
2024-10-08 15:11:43 +00:00
drh dd2deecbbd Fix the .crnl command in the shell so that it does not get undone by
calls to print a quoted string or CSV output.

FossilOrigin-Name: 6b932337c8dee3e52b472a38984e91b5091f3d90c41ac1cc171fa4149cc491c5
2024-10-08 14:07:28 +00:00
drh 7998b889e8 Add an ALWAYS() on a branch in the new indexed-subtype logic.
FossilOrigin-Name: f150c3c5b898975b1f83d61fa589753449a48f8a0007e8e167dbd702528197c5
2024-10-08 00:15:22 +00:00
drh ddc764b274 Add a NEVER() to an unreachable branch in the new indexed-subtype logic.
Mark the pi() function as deterministic.

FossilOrigin-Name: 50be8f5091b2202b67a80f826feee2c378f001745ad5acb7c4374423bbf6ff22
2024-10-07 21:04:57 +00:00
drh f7f78a624d The (undocumented) subtype() SQL function should have the SQLITE_SUBTYPE flag.
FossilOrigin-Name: c361dd91841da64fdd009e6eab389ccd81266a24d1070e5313fe1d22e6cef65a
2024-10-07 18:06:17 +00:00
drh 56423385fb Merge the latest trunk enhancements into the indexed-subtype-expr branch.
FossilOrigin-Name: 2fe2f374584b025676684ebe4ef29304883a3b0b125b62abc1dbf74815eecdfb
2024-10-07 16:53:41 +00:00
drh 2813eb3c9e Add the undocumented test/debug function parseuri(), useful for fuzzing.
Only appears when compiling with SQLITE_DEBUG.

FossilOrigin-Name: 011fab70cb3d194b27742ebb236b05be582230567cf78e3e6cac6911de86922f
2024-10-07 12:48:21 +00:00
drh ce527f2e97 Fix handling of U+fffd in the LIKE optimization.
dbsqlfuzz eee57fb9eea1dfa5aa40dfa87865cf8c84d12f96.

FossilOrigin-Name: bce52ce2a6e7f3d3d1b2807d1ea95243d9b655e557c1bb6f0b8a9a6cefb1aed6
2024-10-07 12:19:23 +00:00
dan 29f976432a Fix an assert() failure in "PRAGMA integrity_check" that could occur when checking a corrupt database.
FossilOrigin-Name: d218993be5886f07193d5c2a66ccd0ecdd7bb87687947b89945c90e31cea5451
2024-10-07 11:47:05 +00:00
drh 74672acd94 New SQL function for testing/debugging use only: parseuri().
FossilOrigin-Name: 37d3b6b17e92b2c760239c3053bbc7fb85091acd688c54a73af7611fe9501312
2024-10-06 15:01:31 +00:00
dan d564bdb050 Allow expressions with subtypes to be read from indexes unless they are being used as direct or indirect parameters to SQLITE_SUBTYPE functions.
FossilOrigin-Name: aa440e78e9004c7ca3e03beaf264f54d0070ad7298a3c96ca097d8b35c872e5f
2024-10-05 18:10:02 +00:00
dan c857b9eb5d Experimental change to allow expressions with subtypes to be read from indexes in situations where they are not used as function parameters.
FossilOrigin-Name: ac63f98ad85a4dd1e49cc64b41f0ca0044153972c15d71c669f4bc3ec590e268
2024-10-05 17:37:19 +00:00
dan c8c95f5149 Fix typo in documentation for SQLITE_SUBTYPE. No code changes.
FossilOrigin-Name: 6733893f450097e07cbd563d6a46790825fd0689283d60181c09793ce7d5509e
2024-10-04 17:02:36 +00:00
drh 51bbf0c7b8 Unconditionally include <ctype.h> in sqliteInt.h, even in builds where
it is not needed.

FossilOrigin-Name: 825f01d7e258ac7981f715fd10708560381b079f0e026abc414cf56d16d862da
2024-10-03 16:31:08 +00:00
drh 1e2834dd45 Fix to the previous: The dbpageRollbackTo() method should return SQLITE_OK.
FossilOrigin-Name: 4dea7221129350a15df8dee5aabd5567e47adda4d255b65d4ba82fd821913759
2024-10-03 10:06:51 +00:00
drh c51dccbd8b Fix missing return value from the new dbpageRollbackTo() callback.
FossilOrigin-Name: d1e0992e1f2885be9725d872b8688806e06788f3d66a70de86255179d93f74d3
2024-10-03 09:53:44 +00:00
drh 46a62afbab Modify the behavior of sqlite_dbpage so that the null-INSERT that truncates
a database must be the very last INSERT operation within a transaction in order
to be effective.  This simplifies the code and also makes the behavior
easier to document and understand.

FossilOrigin-Name: b869a7d9ce9567a61d2257272032aaee705bbc6158c7f2cd36e7f3ee66d72722
2024-10-02 18:54:40 +00:00
drh 3b3f230d95 Adjust the new truncation behavior of sqlite_dbpage(N,null) such that it causes
the database to be truncated to N-1 pages.  This makes more since.  An error is
raised if N is less than 2.

FossilOrigin-Name: 7d5ff86ef7386f4f7f6a956dc0de607e61040d335c9f98d1f71e76a39f4f5e03
2024-10-02 16:55:27 +00:00
drh 92e71573ce Remove all use of the "long double" data type from SQLite, as hardware support
for long double is increasingly rare and the use of long double creates
challenges for some compilers.

FossilOrigin-Name: 761d8fd18b0ee8681b12998f01a2eca1b796807a5174a1270cfb9bdc841424ac
2024-10-02 13:26:17 +00:00
dan 512ad53f3a Merge latest trunk changes into this branch.
FossilOrigin-Name: 2b3945e6a597e6853cac567052e92926c8cb6d7a029ac64c2d45c321bbe2e94d
2024-10-02 11:11:29 +00:00
dan f9d1141a3b Update docs for sqlite3_snapshot_get().
FossilOrigin-Name: 78c3892ab777a39406da8a9df84d0634397514e25512b0363a13bff3b8bc8925
2024-10-02 11:11:00 +00:00
drh e8b2c92240 Remove all code that makes use of the C-language "long double" datatype.
FossilOrigin-Name: f622b52024c8bec1d241b1dc480fbbd839fc1af50b6220f012812503de2c656e
2024-10-01 20:29:43 +00:00
drh 7151010919 New #ifdefs to omit code that is unused when SQLITE_USE_LONG DOUBLE is defined.
FossilOrigin-Name: 98066e2d226e7d2eceec1931a1432baea956f49bf3c708d8a6d511fa4e864ca3
2024-10-01 19:10:47 +00:00
drh dac22f6566 Add compile-time option -DSQLITE_USE_LONG_DOUBLE=0 to omit all attempts to use
"long double".  Or =1 to omit attempts to use the Dekker algorithms to achieve
high-resolution floating point.

FossilOrigin-Name: ca5964ef70efad3332e0bf9c158eb5fd5006d3022051d1ac506c097c427735a1
2024-10-01 16:55:30 +00:00
drh cacef23082 Fix the character width tables for the CLI such that all unicode code-points
less than 0x300 have a width of 1.  This is in fact the case for Mac, Ubuntu,
and Windows.

FossilOrigin-Name: f0c5a86fefecded07e098e1326dd54c72504b0bb480f710e395d4041a322dfcb
2024-09-30 18:19:38 +00:00
drh 54fd01c4ab Fix the CLI so that the --bom option only outputs a single BOM, not two.
FossilOrigin-Name: 76b6331e6a705a420a64820a18214f07cf4c1d5151e7158d6fff09964e63f352
2024-09-28 19:52:38 +00:00
drh c94e4a7b2f Fix a harmless compiler warning in the CLI.
FossilOrigin-Name: 27ef1909bb0c4d9470c6074b40500632c68341127a079a3eb3b6a19dbfb2aeac
2024-09-26 22:25:13 +00:00
drh 74194f14ec Add the ext/misc/sqlite3_stdio.c portability interface and incorporate it
into the CLI, sqldiff, and sqlite3_analyzer.  Enhance the CLI with the new
".www" dot-command and related options on .once and .output.

FossilOrigin-Name: f97f9944b829a49da12786f934da0a5ad51591afd6d8a19a4a0835f51bbdbff2
2024-09-26 19:38:34 +00:00
drh 2b041fb97a Provide SQLITE_U8TEXT_ONLY and SQLITE_U8TEXT_STDIO compile-time options
to the sqlite3_stdio.c module.

FossilOrigin-Name: f31588520e3f45b50dcaa9eecab17f52ebb56bb53d0f9bdb88cc596d1a156353
2024-09-26 19:16:20 +00:00
stephan 2c77d51dfe Resolve a harmless compiler warning in QNX builds.
FossilOrigin-Name: 2916460179c6089375188c6e4e3cff1fca5bbbbb7280a10c919e09e75d1f11f8
2024-09-26 18:13:10 +00:00