1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-04-21 19:26:38 +03:00

19158 Commits

Author SHA1 Message Date
drh
76076d442a Fix a typo accidently added to the prior check-in.
FossilOrigin-Name: fb2f283038f9329b6f791d92d6f943269f24f1a0efd5859165b63f517ed52ddb
2025-04-01 16:26:51 +00:00
drh
3a7042e0e2 This is an experimental optimization that attempts to keep a JSONB value
the same size (same number of bytes) after doing a replace of an elements
with a slightly smaller element, by denormalizing the size field.  This
can perhaps avoid unnecessary page updates and memmove() operations when
making small changes in the middle of a large JSONB value.

FossilOrigin-Name: b5de9584b7f49586c5387d8a74af5e41dba50f1817a54257bf9da00deb695f72
2025-04-01 15:17:01 +00:00
drh
4d9384cba3 Fix a harmless typo in a code comment.
FossilOrigin-Name: dd251377bd1a8e95a4a0179c50595f290b08ea93659f4906f88f5a9dff534aa1
2025-03-31 23:18:06 +00:00
stephan
39d14d4856 Minor shell-internal doc addition. No functional changes.
FossilOrigin-Name: 01b99c8a2819469568f369479c097cc8e3ed1f2478958460755b283dc7d11706
2025-03-29 11:50:25 +00:00
stephan
cd1cbd641c CLI shell: make (.output off) an alias for (.output /dev/null) or (.output nul), depending on the platform. Discussed in [forum:633979ce307f1cc6|forum post 633979ce307f1cc6].
FossilOrigin-Name: 0f11087b84753576425823e10a7eeff45af02f3c0135dee72dec5019c8127500
2025-03-28 15:36:49 +00:00
drh
257e026de9 Merge cygwin and tclsqlite fixes into trunk.
FossilOrigin-Name: 121f4d97f9a855131859d342bc2ade5f8c34ba7732029ae156d02cec7cb6dd85
2025-03-27 23:29:25 +00:00
jan.nijtmans
1f3207a52a Fix for forum-post [/forum/forumpost/b5fde3596c|b5fde3596c]. Also fix encoding issue for non-ASCII characters.
Also includes a fix from Stephan Beal, about a missing <stdint.h> include.

FossilOrigin-Name: e60198001e12f85a5d6504ce72226dfceb8666fe5ec649237fa23ae20e8aa32d
2025-03-27 17:30:49 +00:00
jan.nijtmans
eb2644024a Merge trunk. Some additional test-fixes for Cygwin
FossilOrigin-Name: b36adadfa202fb8951149561471c3e01085d31e1837c99806f308f234cd24a8e
2025-03-27 14:13:12 +00:00
drh
7b3477c776 Fix an off-by-one bug in the ".dbtotxt" command from the shell that results
in incorrect output.

FossilOrigin-Name: 2345094e879c5538bfea005785ce0848e6d565a49bcb48b323c258d00ccbe9b8
2025-03-27 10:59:18 +00:00
drh
a6f6fa8675 On winOpen(), redo the read-only test on every retry attempt. Just
don't retry the winAccess() call.

FossilOrigin-Name: ccdd67ad9a508530ccfcec582410768c24bca4eb8b05939577fb99a50dd44b15
2025-03-26 17:05:29 +00:00
drh
4a6de7ff7c Further attempted improvements at fast-fail for an inaccessible
database file.

FossilOrigin-Name: cdeb21a312d4f1a9e3009a0baf0af33857c172f7bc22bca047dcd46a03e9c964
2025-03-26 15:51:05 +00:00
drh
517a0e04d1 Attempt to reduce the amount of retry time when trying to open
an inaccessible database file on Windows.  See
[forum:/forumpost/e7991420f54dca50|forum thread e7991420f5]

FossilOrigin-Name: 986e45912cde7cb8e6db8ba7a9364aef7187a23032be64ef6cd573163f56676d
2025-03-26 14:45:15 +00:00
stephan
22d502e33a Merge trunk into cygwin-fixes branch. Add .fossil-settings/binary-glob to squelch warnings about *.db files on Cygwin.
FossilOrigin-Name: a8328b921c5504eceacade417e16e713999eff63978caf3418fd79501590b1cb
2025-03-26 00:02:15 +00:00
drh
b0c3118cad Clarify and reduce redundancy in an assert() in walChecksumBytes().
FossilOrigin-Name: 3c53abf5e6df446d569040042363265737aa10fc8aaa20b31c587100c557c5e7
2025-03-24 23:08:40 +00:00
drh
7f4efdcb65 Teach the CLI that VT100-escape codes that do things like change font
colors have zero-width for the purpose of laying out the columns of a
table.

FossilOrigin-Name: 2d0a8a6c38981552748ff5fc2eeba86590e0f116abac260a7fc9318de0a0dbda
2025-03-21 18:15:13 +00:00
drh
4c13878ac2 Fix a problem in the sqlite_dbpage() table-valued function when it is
trying to truncate a file in locking-mode=EXCLUSIVE and the file was
obtained via sqlite3_deserialize().  Problem found by dbsqlfuzz.

FossilOrigin-Name: 346cf9794c6ce82ac32f7ccabc67240309306626709951593720abd198b103e3
2025-03-20 11:47:39 +00:00
stephan
6e059d9dac Merge trunk into the cygwin-fixes branch.
FossilOrigin-Name: 34eadd374b3c0a8c9e1f5f4a1c60fda8f16b1c56213b8c4047f96390c676b695
2025-03-19 10:14:46 +00:00
dan
31fd886576 Fix a problem that could occur when the RHS of an IN operator was a compound SELECT featuring an ORDER BY on a subquery that was flattened into one of the component SELECTs introduced by [baa83b460c677c21]. Forum post [/forumpost/1e17219c88].
FossilOrigin-Name: 7101ccd5331e36fd1a539f540e79ce0ce159be76ec422e1d9436eec6f3908c6e
2025-03-18 19:21:04 +00:00
drh
7bd72d4abf Fix alignment problems on Linux with -m32 and on Mac PPC.
FossilOrigin-Name: 8a91aeca60548d5cd19add128cf65b9c3815c9103b1ef8ff6bc02711b6d709de
2025-03-15 18:26:27 +00:00
drh
01ef1dfc1f Use flexible arrays for RTREE.
FossilOrigin-Name: 2b41776179c726586e3ff836edcf235938cf02f7c5e33c1d6954b84d4061b8d5
2025-03-14 20:19:49 +00:00
drh
b6e8f65ffe KeyInfo is now an indeterminate size, so we cannot declare a variable of that
type, only a pointer to an instance of that type.

FossilOrigin-Name: 37b687dc2d3b9dc82ed09a9c5b2c00e576b1eebe358a20d18a3da190347b644e
2025-03-14 19:07:11 +00:00
drh
cebf06c798 Make use of the flexible-array feature of C99, when available, to try to
pacify -fsanitize=strict-bounds.  This check-in fixes the core. There is
more yet to do in FTS3, RTREE, and in FTS5.

FossilOrigin-Name: 6fd6b32d06bd6a705e5140cd613af823b8183a6f6a9ceeeedfcf5e8b50821d68
2025-03-14 18:10:02 +00:00
stephan
dae87df198 Fix an internal doc typo reported in [forum:e25e581f917|forum post e25e581f917].
FossilOrigin-Name: fa6f6ccdffc50024624306900efd2538c7415d8bdd0f02835b2e9c05adab3cf1
2025-03-14 12:37:36 +00:00
stephan
1560045c32 Cherrypick the [2b582c0097e33] doc addition, which was initially committed to the wrong branch.
FossilOrigin-Name: f786de8d1873cd27b1bf83273a1e100e9d481144674888ccf65974e003a3caad
2025-03-14 09:34:09 +00:00
drh
62d9d70edd The --echo flag on the CLI also echos dot-commands provided on the command-line.
FossilOrigin-Name: 6ec0c03b954cf705da076d035a1cc2e784233ae28857385379e44a59af6c5ec4
2025-03-12 15:17:13 +00:00
stephan
ff3c451428 Document that sqlite_update_hook() can unset the current hook by passing a NULL callback, to address [forum:652aef4747|forum post 652aef4747].
FossilOrigin-Name: 2b582c0097e3374beb280dfa6b03e0dacb9911da1bceb0dce0468e6b7291e74f
2025-03-12 11:41:12 +00:00
drh
642479d1cd Ensure that the TEMP database has been initialized at the beginning of
a call to sqlite3_open_blob() for the TEMP database.  Fix for the issue
reported by [forum:/forumpost/0a556d619b|forum post 0a556d619b].

FossilOrigin-Name: 2cfccdbe08b7b14a6b255f7157ac20d0807327adefcb33fcffeeed14c7603fe1
2025-03-10 22:31:55 +00:00
stephan
e0fa42053f Merge trunk into the cygwin-fixes branch.
FossilOrigin-Name: f3d14433f24f89558e72a9085c950bc72440e9933d6b4ff59d6e603d25e39422
2025-03-10 17:35:00 +00:00
stephan
b37f8b9714 Patch an unnecessary size_t-to-int conversion which warns on some compilers.
FossilOrigin-Name: 8681dfdb59d3258663ec176daafd7a52446a207db21fbd1a4d151508092dcbc5
2025-03-10 15:35:43 +00:00
stephan
42e5ceb093 Reimplement pathname conversion on Cygwin. MSC test passes/failures are on par with trunk and 'make test' running on cygwin is down to a single failure.
FossilOrigin-Name: 57a4de09149663ac001848773c9dffe53e30f9263e4dacc792a0267401147d25
2025-03-10 15:15:13 +00:00
drh
eed4e1d2df Disable the [d1ba200234f40b84|count-of-view optimization] if any subquery
is DISTINCT, as the optimization does not work in that case.
Bug reported by [forum/forumpost/a860f5fb2e|forum post a860f5fb2e].

FossilOrigin-Name: d7013b63932b2f5750572ae6bdd259a2b6e6548c20fb9a5559edd22d2f2fc6cb
2025-03-10 10:32:31 +00:00
stephan
065c0a6120 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.
FossilOrigin-Name: 84d8fcfca19cd183d05a702d0eb1742bfae462d3383a3db72741a48cefac1058
2025-03-08 06:53:06 +00:00
stephan
7b9407af90 os_win.c patches for Cygwin (described in the cygwin-fixes branch wiki page). Makefile.msc's test target on trunk fails the same 13 tests as this branch.
FossilOrigin-Name: 655c60d1926adb552d37441bf9857263eae92e3806a8524e8443b81fdfd8c258
2025-03-07 06:54:04 +00:00
stephan
908c0301d1 Merge trunk into the cygwin-fixes branch (which was inadvertently branched too early).
FossilOrigin-Name: a7863b2e2fbea0ea11c494016b99921f70aae09607868aa65af988cbd173b31a
2025-03-06 14:40:45 +00:00
stephan
b6503f1444 Cygwin-centric fixes from Jan Nijtmans.
FossilOrigin-Name: 205979813c7300debb5f1ba270583ef2f08e069d6d01865b5910702889a5c1ed
2025-03-06 13:38:07 +00:00
stephan
47991d973a Various typo fixes reported by Daniel Dumitriu. No functional changes.
FossilOrigin-Name: 37e6ec777445d8ef81acecbb66f86ae78f2ae67ef0bfd3fbd089da51fff35cc9
2025-03-06 09:08:38 +00:00
stephan
ba6510a399 Additional 'array index is signed char' warning cleanups for the shell and its embedded extensions, analog to [44bd44532d].
FossilOrigin-Name: f31042595b8f8a378db9778c9a8223b07ec02cf2f528581ba43bf72b5b03c964
2025-03-06 07:48:45 +00:00
dan
fc9b5d2a95 Have the recover module add "PRAGMA foreign_keys = off" to SQL output. Have the shell tool add ".dbconfig defensive off".
FossilOrigin-Name: dcfe3d3292851aa48a085a2c68623b049e2786c8dc7154ccc78508443973b5a1
2025-03-05 19:39:02 +00:00
drh
bee4fb401e Always ignore comments in the schema of a database, even if
SQLITE_DBCONFIG_ENABLE_COMMENTS is turned off.

FossilOrigin-Name: 373ae3f4de526c636c35db03d6b5c84526d6f144c1c3bebcbb257e52f563a203
2025-03-05 18:18:17 +00:00
drh
427e0076a9 Use AtomicRead() and AtomicWrite() to access the pcache1_g.bUnderPressure
global, to forestall unnecessary angst from thread analyzers.

FossilOrigin-Name: 41ec85637a7fac710a3986ee78ed25a96d331a03653069bae4d9f826cc6f944a
2025-03-05 17:12:42 +00:00
drh
9f19ea83e7 Improvement output for ".schema --indent" in the CLI when the schema contains
partial indexes with long and complicated WHERE clauses.

FossilOrigin-Name: defd7187ff8c4388f8b5467ed168462ec48215a1f4263bc4128b8e4d89a0bb2a
2025-03-05 16:35:51 +00:00
stephan
e34ad2b0b3 tclsqlite3 patch from Christian Werner: replace FILE handles with TCL channels for the db copy command.
FossilOrigin-Name: ea1f7f8de4abb80fe41a115c9f601ff27cd728493640c6d47d868913feec28dc
2025-03-04 21:25:18 +00:00
stephan
3ce81095f9 Minor doc typo fixes via [forum:65bd941da8|forum post 65bd941da8].
FossilOrigin-Name: 6f6a03e93cf58eaee79603de0b28ad34c872fb4b4b7d9c4e7fe35c698b27618a
2025-03-04 06:29:03 +00:00
stephan
272344d206 Internal configure script cleanups. Resolve an as-yet-hypothetical corner case involving the --dev flag mixed with custom CFLAGS containing SQLITE_ENABLE... or SQLITE_OMIT... flags. Fix an unrelated API doc typo reported in [forum:606ea661df|forum post 606ea661df].
FossilOrigin-Name: 0554c00f32b7cc81d35340080df10ea6d66c9ff07fe749ea76cc523a4149b5c8
2025-03-03 14:15:13 +00:00
drh
c171cf1ef7 Ensure that detection of control characters by comparison against 0x1f
uses unsigned characters. [forum:/forumpost/4c344ca61f|Forum post 4c344ca61f].

FossilOrigin-Name: b7c5ce84216cc7f5a3ba07404572edb94fd628b3a7421111cd5f5333f3e56ea8
2025-03-02 20:29:49 +00:00
drh
8346ceef5a Add an assert() in vdbesort.c to help both humans and static analyzer AIs
understand why a particular array cannot overflow.

FossilOrigin-Name: a14d4afd5020af327629e5c72b0699ddab0ef4e3f23938a1b72669aa29fc2e87
2025-03-01 11:47:01 +00:00
drh
557974e126 In the CLI, ensure that all calls to ctype.h macros are cast to unsigned char.
Apparently cygwin needs this.

FossilOrigin-Name: 44bd44532d4a63b2f600427dc425bde618bcc21e4abffaa2ec19f27350e54732
2025-02-28 15:54:28 +00:00
stephan
da5f813878 Approximately 100 typo corrections spanning the whole tree, submitted via [forum:0db9827f0464bc33|forum post 0db9827f0464bc33] and individually audited and verified. Affects only code comments, innocuous test strings, error message text in tool (not library) code, and configure-level help text.
FossilOrigin-Name: f50c21484d3cac73589da0376c423de39ae8b842218105786c5aa3726e4dcaed
2025-02-27 21:17:55 +00:00
dan
fd3938fbca Add support for SQLITE_EXTRA_INIT_MUTEXED - like SQLITE_EXTRA_INIT, but is called from within sqlite3_initialize() when the SQLITE_MUTEX_STATIC_MAIN mutex is still held.
FossilOrigin-Name: 3cf88d429f6e7c10b8f19c283151541924c4bb84bbd0d2e05cabdd4f9f0e88c9
2025-02-27 11:03:54 +00:00
stephan
129203bce3 Internal doc typo fixes reported in [forum:01d15f21b6|forum post 01d15f21b6].
FossilOrigin-Name: d6514c20ff583ccc4fb3a526fb8f86a563224f513ee10bb39a978046bd952726
2025-02-27 03:23:33 +00:00