stephan
5b985fee64
Extend sqlite3.c makefile rule to support EXTRA_SRC=list-of-c-files to append to the generated sqlite3.c, as discussed in/around [forum:ccda88cf6f1754c5|forum post ccda88cf6f1754c5].
...
FossilOrigin-Name: 61676f1e18a405e4f3b6007488f2e68f3f55b312c107359ae5e52929f0c104c8
2024-02-27 11:02:31 +00:00
dan
1ffaa03adc
Allow "_" characters to appear between any two digits in an integer, real or hexadecimal SQL literal.
...
FossilOrigin-Name: 0e6700f43f133510c8049b2c5a2610cb3be29da7ed4d39b1fa65dc22c4cf529b
2024-02-27 10:52:41 +00:00
stephan
32888c2b30
Bring the extra-src branch up to date with the trunk.
...
FossilOrigin-Name: 12ff5c5c4162951a29b638a5bc6cffa50e057c5a5e8f5e9c627af5f4ab1e4cdb
2024-02-27 00:58:51 +00:00
drh
f79b0bdcbf
The quote() SQL function should convert +Inf into 9.0e+999 and -Inf into
...
-9.0e+999. See [forum:/forumpost/6675b25108|forum post 6675b25108].
FossilOrigin-Name: 85dd79a6edecfc8c6307c6d215998f76dab086aa14528ddc64eb9955501becfd
2024-02-26 22:28:21 +00:00
drh
7c6433cfff
When inserting a 3-byte cell into a btree, ensure that the extra padding byte
...
is 0x00. This is not necessary for security, as far as I can tell, but it
seems like a reasonable precaution.
FossilOrigin-Name: 5766f1279dab91e030d4dcf5133659e5cedf914a1628ccf00d67d8e50a9957fd
2024-02-26 15:27:33 +00:00
dan
09e1900cdc
Add the intck extension. For performing incremental integrity-check on a database.
...
FossilOrigin-Name: 141d8bb059f8987d05d18327b97c4d36e98258f657b41a3d4d8877fe8b4e72e3
2024-02-26 12:16:02 +00:00
drh
1103eb423e
Fix header comments on test scripts.
...
FossilOrigin-Name: 9fe9670c977ce7ad2c19657783a63998769dbb7741a587889c72ecc04d895793
2024-02-26 11:51:21 +00:00
drh
f286ad9211
Remove a local variable from sqlite3IntFloatCompare() that was being optimized
...
out anyhow, in order to get back to 100% MC/DC.
FossilOrigin-Name: 52b13d6acbb738b9281f7dd44edd6c3c9585d22d98b1951b7059534fbd16fac0
2024-02-26 11:43:44 +00:00
dan
afeec79847
Merge latest trunk changes into this branch.
...
FossilOrigin-Name: b6371ff9f5c3d4e87a5b1127a82970202f74c790b828dda20df88dd727bcc9b4
2024-02-26 10:56:54 +00:00
drh
dfd991c3b9
Make sure key comprisons are done correctly if the index key contains NaN
...
values that have not been shifted into NULLs. That can only happen due to
database corruption, but we need to deal with it nevertheless.
FossilOrigin-Name: 7e4c743f9e6ef33500795543e6db9a77c533025bf00c2ee97abd433a3871b5a1
2024-02-25 21:30:33 +00:00
drh
7598e7d70e
Add two GIFs that contain the feather logo.
...
FossilOrigin-Name: 5f21e6a8ee709d8c5ec12c45e8dc702a7d0bb041f31b5715e28cd904dfd566b0
2024-02-24 19:58:15 +00:00
dan
9c59c87448
Add further tests for the intck module.
...
FossilOrigin-Name: c253e276b29de28a18270d01b60d95157ce3fc4b37e246d991f9119d26e718d7
2024-02-24 16:26:15 +00:00
dan
ee299cc7d4
Add tests for the new code on this branch.
...
FossilOrigin-Name: 351d46b2373f08bc8033d0902d9f67cd6c8bcc16c0d9f787e4fb279c0a76da87
2024-02-23 20:51:06 +00:00
dan
645f21f15b
Add the ".intck ?STEPS_PER_UNLOCK?" command to the shell tool.
...
FossilOrigin-Name: cfd051836b72f7d4e38cc9614f6ae5c003de4ce377359fd391adf06fe1ddf6b9
2024-02-23 18:21:51 +00:00
stephan
b088e892a0
Typo fixes [forum:c19bbf245d|reported in the forum]. No code changes.
...
FossilOrigin-Name: 67d8bae0f695c0839e724c1aadea0a22f736fdd9664d40a29b4d82c91fb89ab3
2024-02-23 18:02:31 +00:00
dan
5956d1d942
Fix detection of surplus index entries when all indexed fields are NULL.
...
FossilOrigin-Name: 5f310fb7be450c96f01c21e6fd1377d4a274784377d0bd811922ab63e612bd11
2024-02-23 17:10:39 +00:00
dan
1545243368
Fix problems with resuming integrity-check operations on indexes with mixed ASC and DESC columns, and on indexes that contain NULL values.
...
FossilOrigin-Name: 0f68b35a000ef9f4691c59797c66ed6c3435fc5c503e9d24f891afec6aceeada
2024-02-23 15:13:53 +00:00
mistachkin
f7ad684c5a
Fix harmless compiler warning seen with MSVC.
...
FossilOrigin-Name: e5db08993127dfc18cc2b621a13cbfef52974f0f504f4d8208093bfad1ffdcc5
2024-02-22 18:15:08 +00:00
drh
0b8c3126f4
Fix debugging code so that it compiles on MSVC.
...
FossilOrigin-Name: ce5df19dc4aff3fde03ef62261a5e095a16a8f4e46e2924becea4fed56ce49e3
2024-02-22 00:50:54 +00:00
dan
639db50a02
Fix various issues in sqlite3intck.c.
...
FossilOrigin-Name: 8a7bfa74525a495f45b1ea212b1718633b637295090d514dd777f9263477d514
2024-02-21 20:58:48 +00:00
drh
9591a9f069
Fix typo in comment. [ https://fossil-scm.org/forum/forumpost/cc20266bf2 |Fossil forum post cc20266bf2].
...
FossilOrigin-Name: 7e3c46eed1290964a3e25662686c6ba1149bf8687d05719b684772e65d660c09
2024-02-21 20:21:46 +00:00
dan
6a00f707e8
Simplify the way the restart key is saved internally by the intck extension.
...
FossilOrigin-Name: 0e39962baae8a82a3021077676b792ac30c79426bcd8c075b5e92bee55e8c3a5
2024-02-21 19:31:00 +00:00
dan
b783f56c58
Add documentation to ext/intck/sqlite3intck.h.
...
FossilOrigin-Name: 4cc19bd74f05fe92658cc392a1d1afa173d93181a77303af6bc5684436ae832e
2024-02-21 19:17:45 +00:00
dan
b2897c221d
Ensure intck tests are run by testrunner.tcl.
...
FossilOrigin-Name: 11d6816c060b6edb9cd61f29297ab95e75e2b46f29c0a796820d94fc13586f6d
2024-02-21 16:15:50 +00:00
dan
ebd99d5708
Merge trunk changes into this branch.
...
FossilOrigin-Name: 63e8846ac1dc1cf1f7071c4634ccbfec3c13560db6afec376cd91515b62430d3
2024-02-21 16:12:23 +00:00
dan
eb715f022f
Have the intck extension better handle corruption at the b-tree layer.
...
FossilOrigin-Name: ecd775d108f77d39a1303316c1e0f0b0ae3ffc5218222e1ebfe2ef6783829b85
2024-02-20 20:18:02 +00:00
dan
cfcb3b9208
Use fewer cycles to generate the "next key" value used by sqlite3_intck_suspend() function in the intck extension.
...
FossilOrigin-Name: 95f01426f948cf435d0b400dc7ae06fa699eee32cff498fe77e74a1257a4e09b
2024-02-20 18:17:06 +00:00
dan
626d619218
Consider using "=" and IS operators with even low-quality indexes in cases where they are selected explicitly using an INDEXED BY clause.
...
FossilOrigin-Name: 43cbbea82132db2d0ddb4f34cc2b6910b3a1243ae6d4e837b1b27bfe91b84834
2024-02-20 16:04:27 +00:00
drh
21eda699d7
Fixes to comments associated with the recent PRAGMA optimize enhancements.
...
No changes to code.
FossilOrigin-Name: 27a2113d78b35e324e9aedda7403c96c56ad0bed8c6b139fc5a179e8800b9109
2024-02-20 15:38:36 +00:00
drh
b468e68322
Remove an unreachable branch from printf(). Change it into an assert().
...
FossilOrigin-Name: 4c9886b692706723f4b68f58dfef07ab19b192fd19b953917f23b55655af3e02
2024-02-20 13:11:27 +00:00
drh
4b2eeb289b
Remove an unused variable from the merge in the previous check-in.
...
FossilOrigin-Name: 5c26bf379e18e28d800525bd03e2d5597e2f37674979302f351b99abfc064749
2024-02-20 13:10:46 +00:00
drh
68d92c4ad3
Enhancements to PRAGMA optimize and ANALYZE. Add the 0x10000 flag to
...
PRAGMA optimize. ANALYZE now records zero-size partial indexes in the
sqlite_stat1 table. PRAGMA optimize looks for both growth and shrinkage
in table sizes, and uses tighter bounds (10x rather than 25x) to trigger
a re-analyze. PRAGMA optimize automatically uses are reasonable
analysis_limit to prevent excessive runtimes.
FossilOrigin-Name: 63ef234e88857a653fa3541e80d59802ceccb806ac8296e8bae79a385b7086f7
2024-02-20 12:48:00 +00:00
drh
4189c44cff
Another simplification of the PRAGMA optimize logic for improved coverage.
...
FossilOrigin-Name: 6c5a0c85454e3c658e51fab611c169c034447174022eebc52fd8619b528a4765
2024-02-20 12:14:07 +00:00
drh
ae71fa5d59
Minor fixes.
...
FossilOrigin-Name: ed5afebc410e3d430e2428d35f027bffb218e5f11036a42f97b080153e89016e
2024-02-19 23:58:26 +00:00
drh
a1507a3fa0
Fix a minor hiccup in the computation of the number of btrees to be scanned.
...
FossilOrigin-Name: 91302d9b2720d6b5184e1c24db55d351544adfde4b3d2ddcdc1561f79f11985a
2024-02-19 20:47:59 +00:00
dan
ebea8458e2
Use more efficient SQL to verify that indexes contain entries that match their tables.
...
FossilOrigin-Name: c01e008c28895e50b14531b2a1f3f1110aab3b54df41ebdbd416fbac7b1bba94
2024-02-19 20:15:44 +00:00
drh
9a28311b6a
If there is no mention of a table in sqlite_stat1, use OP_Rewind to see if
...
the table is empty prior to invoking ANALYZE.
FossilOrigin-Name: 0cc93b19de597866292e0696f89fbd0e22a6cbb374678f5cc096fb889210fe3c
2024-02-19 20:12:30 +00:00
drh
74b0aad09f
In PRAGMA optimize, scale back the analysis_limit when many different tables
...
and indexes must be scanned.
FossilOrigin-Name: 636615358aebfef80a657d09f15f608df9e64882b2aaa5574ce31a4f1c71fd70
2024-02-19 19:56:40 +00:00
drh
f40da9226d
Merge trunk fixes into the better-optimize branch.
...
FossilOrigin-Name: 2cf78a5b5fce7f2d49ce185d27f50722c91a1d6c91bbcecebd4bb5244a76769f
2024-02-19 18:55:32 +00:00
dan
cfc62ceefd
Add implementation of sqlite3_intck_suspend().
...
FossilOrigin-Name: c36ada868da74e030ff5002de1f3b31b639b0c43714b91c2e5ca0eda16bb6bc2
2024-02-19 18:03:53 +00:00
drh
e7bdb2172c
If a table has one or more rows and it has a partial index has zero rows,
...
still make an entry in the sqlite_stat1 table for the partial index, so that
we know that "PRAGMA optimize" does not need to redo the whole table.
FossilOrigin-Name: e147b18991dd462fff367442acb0504fdf193a31843ed34ec8c1ced30747bf8a
2024-02-19 16:22:58 +00:00
drh
6c6356f7f2
Simplifications to PRAGMA optimize to make it easier to use. It always
...
tries to ANALYZE unanalyzed indexes. The 0x10000 flag just makes it check
for size changes in all tables.
FossilOrigin-Name: 44ed7f4cd07a88a2fdd303a2c78e6babe01d7344b399bd2b80ed68d75a77aaa2
2024-02-19 13:50:09 +00:00
drh
9f34a05e98
Change the 0x20000 bit (use analysis limit) to 0x10, meaning that this feature
...
is on by default. The default analysis limit is changed to 2000 which is
almost always sufficient for accurate analysis results.
FossilOrigin-Name: 4abd47b5917099a2f74e53e12c987da0722304a5e9a93b6d43015c1f45c48444
2024-02-19 13:06:27 +00:00
stephan
e0a9935be1
Extend the strerror_r() result type discrepancy check in os_unix.c to include the Android NDK, as reported in [forum post 3f13857fa4062301|forum:3f13857fa4062301]. The NDK's strerror_r() signature is version-dependent, whereas this change assumes int return (POSIX semantic) across all versions.
...
FossilOrigin-Name: f18b2524da6bbbcf372b292df52fbe6efa49fd6e1f1f13ef2447279d559f7a08
2024-02-19 12:20:46 +00:00
drh
d43e7adca7
Hold a transaction during PRAGMA optimize, for performance.
...
FossilOrigin-Name: d13b79eae6df7f9d1f3b8062ddc75a12ff038196b3d752d2672a9925fa45ca56
2024-02-18 01:12:22 +00:00
dan
99a94a124c
Add start of extension for incremental integrity-checks to ext/intck/.
...
FossilOrigin-Name: 444e3c9210026da7eae1ed98850722e002433aa2cc77dbc6b6f80327a6b7a390
2024-02-17 20:55:01 +00:00
drh
42eb6a91cd
Add new MASK bits to PRAGMA optimize: 0x70000.
...
FossilOrigin-Name: dd4497062569eec9ddfdaa7d6394c83ff40a7a59c6697a161bc4ff6d8af3bb29
2024-02-17 16:39:52 +00:00
drh
6161cdd446
Fix rounding in zero-precision %f and %g printf conversions.
...
[forum:/info/393708f4a8|Forum post 393708f4a8]. This bug was
introduced by check-in [32befb224b254639] and first appeared in version 3.43.0.
FossilOrigin-Name: 7fca1bc482fc2456d75392eb42f768fda72631c9070de46b8123b1126e78306f
2024-02-17 03:32:31 +00:00
drh
837efb4cbe
The PRAGMA optimize command invokes ANALYZE if a table shrinks by 25 times
...
in addition to if it grows by 25 times.
FossilOrigin-Name: 40532ffba91cf332c1ea4add80184031a9d6e10514d2d9b9a6cfd613091b81f7
2024-02-17 01:12:58 +00:00
drh
4dd59fd997
Fix the subtype on the value column from json_each/json_tree for cases
...
when the value is an array or object. Fix for the bug reported by
[forum:/forumpost/ecb94cd210|forum post ecb94cd210].
FossilOrigin-Name: 1c33c5db2e05019d1a375109f79ad8588a3c17f81e4f4b8d66c880c3c860e87e
2024-02-16 21:30:08 +00:00
larrybr
fd2500f98b
Retweak last check-in to retain compile-time checking of xprintf() arguments.
...
FossilOrigin-Name: 670174916c660b24ba70e96a42984eb65ee52da50e9828bdeca4c9ff4bf92e20
2024-02-16 18:34:21 +00:00
stephan
816f677c1c
Work around a __VA_ARGS__ complaint in fiddle builds.
...
FossilOrigin-Name: 7d750248c58ccbf87036ea7db053def1c83c7a8ed428a5c47895756302b36200
2024-02-16 16:04:31 +00:00
drh
9d00aba895
Rename the TF_StatsUsed flag to TF_MaybeReanalyze, to more accurately
...
reflect its usage. No logic changes.
FossilOrigin-Name: b4790da5e0d6f0f617e6c3a17fc2606842e41cab14339392abd335410fec0aa3
2024-02-16 12:57:04 +00:00
dan
5e5831a760
Handle an OOM case in fts5 code to query tokendata=1 tables.
...
FossilOrigin-Name: 01222d96b9ab24c7013a2587544304ba32c1f039b08c06a04d8d58ec9c790db0
2024-02-16 11:41:47 +00:00
drh
95b5295f52
Fix a bug in PRAGMA integrity_check introduced by enhancement (8a) in
...
[https://sqlite.org/releaselog/3_42_0.html |release 3.42.0] and first reported by
[forum:/forumpost/ee4f6fa5ab|forum post ee4f6fa5ab].
FossilOrigin-Name: 460353dfff8f2fb03f9c8666d0c367ec7be4cfa96dfcb0cea10f144d043223bb
2024-02-13 18:41:46 +00:00
drh
54eb54c7de
Changes to vtabCallConstructor() to avoid a harmless static analyzer warning
...
and to help prove that the UAF reported by
[forum:/forumpost/cafbe582e8|forum post cafbe582e8] is a false-positive.
FossilOrigin-Name: 4892440b93306e5a245f18c0d3d295d851e6712260e420016c0d70e12abf8901
2024-02-13 17:11:19 +00:00
drh
8e821c251d
Replace the assert() that was removed by [f023cb541b5dd72c] because
...
[1cd5d4623f44af25] made it true again.
FossilOrigin-Name: 189a49f165dfc348a8730ad2b2288b9b2b2089b1de99fa2d515f2a90c9e7bd4e
2024-02-12 19:12:30 +00:00
dan
98a8ffb3b3
Have rtree avoid keeping a blob handle open following an error.
...
FossilOrigin-Name: 1cd5d4623f44af25ab4f5af580354b3ae22cf5de4109e008ca41055125bb708d
2024-02-12 16:12:25 +00:00
drh
38e0492b91
Add a new sqlite3FaultSim() to btree for better fault analysis.
...
FossilOrigin-Name: 2c675bd30568d3c530300beb3fcfaa17c9f063cdcb9a39ac68b9902100f641a6
2024-02-12 14:44:35 +00:00
drh
84dea8264b
Add a new sqlite3FaultSim() call in the btree logic, for testing.
...
FossilOrigin-Name: e0558f79b8184ea6741fb20b710dab854f5bdb71aa47d5a6701eeb7389540c8c
2024-02-12 13:51:08 +00:00
drh
b29047838d
Add support for the ".testctrl fault_install" dot-command in the CLI when
...
launched with the --unsafe-testing option.
FossilOrigin-Name: 5ba7fee1a9b49df82387e355d2ab7de58663d3fa824e50717608b27e0f7ac874
2024-02-12 13:28:10 +00:00
drh
18b6019cdd
In the RTREE extension, allow the xBeginTransaction() entry point to be
...
invoked multiple times without intervening calls to xEndTransaction().
FossilOrigin-Name: f023cb541b5dd72c996f0574210344179217666a2229bc8d3fe057fdbc5c2245
2024-02-11 22:56:12 +00:00
drh
3c5a810646
If a term of an ORDER BY or GROUP BY contains an aggregate function or column,
...
then it is not an alias that needs to be resolved, so don't try to. This fixes
a harmless assertion found by dbsqlfuzz. This yet another problem that
orginated at check-in [6e6b3729e0549de0].
FossilOrigin-Name: d4ec2a5d2297cd9ead0a8768dcf003ea76c74d8d68d88c40f62363f484a4a4d3
2024-02-11 20:53:14 +00:00
drh
ece3567aec
Improved AggInfo tracing in debug builds. No changes to deliverable code.
...
FossilOrigin-Name: bb31f9c44794e02a46ed3edbcc96eb48c5870d3f82cb404586ded9a3efa7a859
2024-02-11 18:53:48 +00:00
larrybr
589c407f12
Further clarify sqlite3_exec() callback parameter lifetime.
...
FossilOrigin-Name: 993a1a843177b19a9cb5598f57d1e05c01e1695f164faaa9ae22810ad4533eba
2024-02-10 03:11:42 +00:00
larrybr
25e172d429
Mention limited lifetime of string arrays passed to sqlite3_exec() callback.
...
FossilOrigin-Name: 717f67f3189a59842f5c17a25e8db0e24ec4405886fc22ab6eeb3954fba5a964
2024-02-08 01:19:46 +00:00
drh
0f777cd622
Fix an #endif (added in the wrong place by [8f4b1ceafe4a271b]) so that
...
the build works with SQLITE_OMIT_VIRTUAL_TABLE.
FossilOrigin-Name: 7070924eebce1d089fde911dc0427ab8f3764d57ace24caff2b79954b42d1b51
2024-02-07 20:45:38 +00:00
drh
722bd1fe89
Bring test cases into alignment with the latest enhancements.
...
FossilOrigin-Name: cd017c28d516399e25b5ee9e8fcd7390ca2be9128c7c41f1007f37bc01a35717
2024-02-07 19:52:03 +00:00
drh
204b41955e
Turns out the branch is reachable, so back out the NEVER().
...
FossilOrigin-Name: 0af36a3223d2dabda887830390a603ab4781baca7e2f1698ec6c5f2cf03faf04
2024-02-07 19:17:44 +00:00
drh
71cdea8f5f
Detect and respond to an OOM on the jsonStringTerminate() call of
...
jsonReturnStringAsBlob() routine.
FossilOrigin-Name: 881f814c09b6896a448a2360b0b43dc99592ea3a1d72ac359770cbb0a2c7d38a
2024-02-07 14:05:38 +00:00
drh
8babc01892
Slight change to OOM handling in JSON to catch a corner case found by
...
dbsqlfuzz.
FossilOrigin-Name: 6a2b3266c586d12b51e11fe63cda5881be9373207aa16671ab77f547830eb790
2024-02-06 18:33:01 +00:00
stephan
72c7bb3e1a
Correct docs about the first OFPS VFS's importDb() method being synchronous (it's not, whereas the second VFS's importDb() is).
...
FossilOrigin-Name: ae7505fa5e112f39a329befb35eff6ddf46a53f5deb610906550bf67f56fc157
2024-02-06 08:59:59 +00:00
stephan
db9cc74c9c
Make explicit that using the importDb() methods of the OPFS VFSes has undefined results if the being-imported db is currently open. Doc changes only.
...
FossilOrigin-Name: f28b9924b401b359e59a73918a34b29cde719164a6b4ac5a9d23da6294b701bd
2024-02-06 08:25:23 +00:00
dan
5e922865aa
Return SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree query in such a way as to invalidate an rtree internal priority queue entry. This replaces the SQLITE_ABORT_ROLLBACK mechanism added in [af5c4251].
...
FossilOrigin-Name: 32f85a5ce8e32506ad0cf309c86589958f38d924b4b3de532bec8bdb8e385fad
2024-02-05 17:54:03 +00:00
dan
8e4d004ba1
Return SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree query in such a way as to invalidate an rtree internal priority queue entry.
...
FossilOrigin-Name: 478280ef67efed854988ab4f740a38ae1937204c0434ad8da11f1869a12a6d06
2024-02-05 17:35:36 +00:00
stephan
21ded98df5
Extend [d294a23ed6d] to apply to all wasm speedtest1 builds.
...
FossilOrigin-Name: 26f848e5e0ac34e545d2f27cf33abc46eac13e04ed9cd71084b0f7d47136ff97
2024-02-05 03:56:02 +00:00
stephan
7d3cd38034
wasm: pass the promiser function to the promiser onready() callback to simplify access to it in certain usage patterns.
...
FossilOrigin-Name: f8a8b9ee2eddf5f875c7c4399e750ccf1941f767560ebc2c88c083560f5aaae0
2024-02-05 03:37:54 +00:00
stephan
0009d40325
wasm: squelch a new (and, in our case, invalid) warning from emcc 3.1.52.
...
FossilOrigin-Name: d294a23ed6d1d2b567a02552b8a2e4921cd21891ee86e63f8f9945569e3262d3
2024-02-05 02:36:10 +00:00
mistachkin
7718c866e1
Fix a minor test file locking issue on Windows.
...
FossilOrigin-Name: 6cd70b71df5c0d45412081590316bced302ec4403d565250b56e611882204821
2024-02-04 04:18:29 +00:00
mistachkin
3ab9c021ff
Fix harmless compiler warnings seen with MSVC.
...
FossilOrigin-Name: e52c87420b072fa68d921eda66069542d50accbfaf1110ac4cc1543a4162200d
2024-02-04 04:01:11 +00:00
drh
7d6f33046f
Following a ROLLBACK that reverts changes to an RTREE, any pending queries
...
against that same RTREE abort with code SQLITE_ABORT_ROLLBACK.
dbsqlfuzz de7d17b72d0e842352c998dd86a47b7d0f707be9.
FossilOrigin-Name: af5c425114f32c2f84aea20edd4fa46eb1bfdeb3747fce357540e15978a070c8
2024-02-03 19:19:18 +00:00
drh
50f9caf270
More extensive use of SQLITE_CORRUPT_PGNO.
...
FossilOrigin-Name: 3838332cffb87f77a7c6b357066a59b9dc4f65ef4b3496767ad7ad7c14a77be2
2024-02-02 18:42:09 +00:00
dan
d90ecb5d6e
Have "PRAGMA quick_check" compare the number of entries in tables and indexes.
...
FossilOrigin-Name: cc294c041b4c7a044ff344989f872415ced5263a0b654112371b2da7c852a688
2024-02-02 16:51:24 +00:00
dan
3a32690a55
Fix typo in vdbe.c comment. No changes to code.
...
FossilOrigin-Name: 62010ba488f65aec3c6bd17b05f64c5b3e885dee4221e6016c4eb1053e19284d
2024-02-02 11:37:03 +00:00
dan
09768559b6
Ensure the fts5 xIntegrity method correctly returns error codes unrelated to corruption or missing SQL elements.
...
FossilOrigin-Name: d18d9a05c2d6f290d7b16eafced0cde4eb8dd3f869778a49103812d35a0cee65
2024-02-01 15:42:22 +00:00
dan
adea051707
Ensure the fts3 xIntegrity method correctly returns error codes unrelated to corruption or missing SQL elements.
...
FossilOrigin-Name: 1bdb8cbaf7e733e0731de2ecd7a05ddf44db5d8595dcc7aaf0927ed0aa5b33d3
2024-02-01 15:21:55 +00:00
drh
64b76c0ed4
In PRAGMA integrity_check, defer running xIntegrity on virtual tables until
...
after all ordinary tables have been checked.
FossilOrigin-Name: 8f4b1ceafe4a271b23e17493a244a34c1732a3d35c5533c37394b9f3dc158435
2024-02-01 14:57:24 +00:00
drh
1d09f4d018
Add tracing logic to the shared-cache locks in btree.c. The tracing is
...
off by default. Enable by changing a single "#if 0" into "#if 1" and
recompiling. Debugging code only - no changes to release builds.
FossilOrigin-Name: f2b943f97ad7e47848ac6df3a3a1eba134b9e63c4a631f8eaf8bda77cc02ba7b
2024-02-01 14:17:01 +00:00
drh
d87299cece
Add the test_oom_breakpoint() routine on debug builds, to serve as a
...
convenient breakpoint to intercept OOM conditions.
FossilOrigin-Name: e45df7dcd6b5766d7593ee87e59dd422a217cce0a1a8d369c03144bb21859428
2024-02-01 11:38:58 +00:00
drh
ed0a614c21
Replace an conditional assignment that was made obsolete by [d4c193f0b49f4950]
...
with an assert(). The conditional was added by [d6fd512f50513ab7] as
a fix for tickets [c36cdb4afd504dc1], [4051a7f931d9ba24], and
[d6fd512f50513ab7] which means now [d4c193f0b49f4950] is the correct fix
for those tickets.
that check-in
FossilOrigin-Name: 44b5524d522e749ad6bf76c94d754ff16c309c32439ec46802924663f64e8b09
2024-01-31 20:11:54 +00:00
drh
d844e0a1c4
Allow control characters in JSON5 string literals.
...
[forum:/forumpost/05182119f69c3a92|Forum thread 05182119f69c3a92].
FossilOrigin-Name: 380f09c194caff557640692d2f255f8cdc1dcfed5976711686466692f4d7a60d
2024-01-31 15:29:29 +00:00
drh
744581d3d6
Add NEVER() and ALWAYS() macros for the JSON5-control-character change.
...
Also fix an incorrect comparison used to determine if a buffer needed to
be resized.
FossilOrigin-Name: e3c0c0e686f3b7710f79587cf465b5aac52d8f2f2986a3de885a656f652cbfd3
2024-01-31 15:20:13 +00:00
drh
9486178f39
Fix failure to detect unterminated string literals in json_valid() in the
...
previous check-in.
FossilOrigin-Name: 5d725644621cf640fb743d59ccf89dac777540410e67501eb00b83638c8c857f
2024-01-31 14:44:59 +00:00
drh
c24f53635c
Allow control characters in JSON5 string literals.
...
[forum:/forumpost/05182119f69c3a92|Forum thread 05182119f69c3a92].
FossilOrigin-Name: 34709c7cc910539e23a830ad8b589a97a88be25e924a59670c1017fb51447dad
2024-01-31 13:46:44 +00:00
drh
b202a452ad
Fix a memory allocation bug in the (debug-use-only) json_parse() SQL function.
...
FossilOrigin-Name: 32ce7dacf58bbf35cf70da8b03fa25f97fcea970edbc1f8aa12739ac4c8608fb
2024-01-31 12:15:57 +00:00
drh
91981fe74e
Detect malformed nested JSONB earlier and stop rendering to avoid long
...
delays.
FossilOrigin-Name: 72f3e1d0eca2b9ebd7c4b4cdccc6d7a0173b2fdb204cb1aa207917aedab6098a
2024-01-29 21:09:56 +00:00
drh
af3824d5fa
When generated text JSON from JSONB, do not continue descending into
...
nested structures after an error is seen. This avoids long loops and wait
times.
FossilOrigin-Name: 97666ec052ebaceab002874d7ca5c5e6883c3d04fb7d3992235a8c4c8d08407a
2024-01-29 20:36:17 +00:00
dan
581bf002ce
Consider an index for queries like "SELECT count(DISTINCT col) FROM ...", even if the index records are not smaller than the table records.
...
FossilOrigin-Name: ad06868807a27f0c96fa5649ebd981e07909eb2c5e03781377c876fdec49abdc
2024-01-29 19:30:16 +00:00
dan
7f9a1ff3f2
Avoid a potential buffer overread when handling corrupt json blobs.
...
FossilOrigin-Name: 738473dc0ac353731080d0785cc7dc9810b564906c176916bd91d6cfbb1a7b18
2024-01-29 15:30:35 +00:00
drh
3fc7a34efc
When rendering JSONB back into text JSON, report an error if a zero-length
...
integer or floating-point node is encountered. Otherwise, if the node occurs
at the very end of the JSONB, the rendering logic might read one byte past
the end of the initialized part of the BLOB byte array. OSSFuzz 66284.
FossilOrigin-Name: b0eb279ea83c1c788c39fb90e178ec99fa4c782195c376a420c661fedf4545a7
2024-01-29 12:50:32 +00:00
drh
4c11a5251a
Use __ppc__ instead of __POWERPC__ to identify 32-bit PowerPC processors.
...
[forum:/forumpost/34794846ce|Forum post 34794846ce].
FossilOrigin-Name: c974d9313b60591bcd554c3ec652a8040d382930e30778e6be8a875145b0b3da
2024-01-28 20:42:12 +00:00
drh
5b480ead99
Automatically disable the DISTINCT optimization during query planning if the
...
ORDER BY clause exceeds 63 terms.
dbsqlfuzz afd1d61fc27d14938a0d78a50970fa1e9fbfee58.
FossilOrigin-Name: d4c193f0b49f4950b20c2f0e6aa037d2ed7d8c0b4687c14923b3a0d0d4a1b3fd
2024-01-28 17:39:31 +00:00
drh
d921533954
Apply the same fix found in [99057383acc8f920] to descending scans.
...
dbsqlfuzz afd1d61fc27d14938a0d78a50970fa1e9fbfee5.
FossilOrigin-Name: e1d463c2d6e93e0ae0a60a05a79cd346bd07142de2fe631b370a9b946763b5d6
2024-01-28 00:31:47 +00:00
drh
052f0a95d0
Improvements to parser stack overflow testing.
...
[forum:/forumpost/99e181b5bf|Forum post 99e181b5bf].
FossilOrigin-Name: 556c43a937f1d1c19117da24e6d892852241189f4e47e1c86aa1e8c36461c5de
2024-01-27 20:17:05 +00:00
drh
21bdfe5884
Performance enhancements to the parser template.
...
FossilOrigin-Name: 2db8b30acdeaeaf7ec92dc0382a25f96bca4561fb68a72713ff963e27f39c63b
2024-01-27 12:47:51 +00:00
drh
48e899a86e
Use an alternative memory allocator for parser stack space that includes
...
a call to sqlite3FaultSim() to facilitate testing.
FossilOrigin-Name: 7c36d560ff4e8e1b3f8fad972ec7f07837e4fa4e6861fafde970ffccfda5a2f1
2024-01-27 12:25:07 +00:00
drh
ad2689fe4e
Allocate new parser stack space from the heap if needed, eliminating the
...
possibility of a "parser stack overflow" error as long as heap memory is
available.
FossilOrigin-Name: d87a2054774aa6ce54d9ccd78899b638f1eaf4f9a1d847bf22500018049c9f8d
2024-01-27 11:35:35 +00:00
drh
7659ce22c5
Optimizations to ParseFinalize() to make up for the extra cleanup associated
...
with the allocated parser stack. This branch now runs faster than trunk
and is less than 300 bytes larger.
FossilOrigin-Name: f7290db63cc2568090c14dffc4ea4eadfacb5b94b50a1852ef6eefd9e2e32533
2024-01-27 02:21:25 +00:00
drh
3467698000
Omit the "parser stack overflow" error message, since it no longer occurs.
...
Replace it with an ordinary "out of memory".
FossilOrigin-Name: 33f17ec24880937892d47a5a321c43785ca18e03dde28a9a0d50ae86edb29679
2024-01-27 01:35:07 +00:00
drh
51f652de10
Bug fixes in the function that expands the parser stack.
...
FossilOrigin-Name: e91179fe849760771c3508b1e7d75325183e5c3b029752d0a97dbdbd57188b97
2024-01-26 20:57:19 +00:00
drh
82bf13796a
Experimental changes that prevent parser stack overflows by growing the
...
parser stack with heap memory when it reaches its limit.
FossilOrigin-Name: 3fd062905fc20507b7cfc97fa976ac5b57c5b68926bf9136bd5ea4265d2d6528
2024-01-26 20:34:48 +00:00
drh
539085ddf5
Add NEVER() to a branch that is no longer reachable.
...
FossilOrigin-Name: 9411337a7b3237366768fc708396da53d67a7a17b6cdc5c6f8932c5ab32217a9
2024-01-24 21:08:57 +00:00
stephan
4821b15dca
Update ext/wasm/SQLTester for recent internal-API reorgs.
...
FossilOrigin-Name: 996cfdf9b5f70408faeaa68ba2ea9494e419be8f2c59d89ab702419056e3569c
2024-01-24 19:54:49 +00:00
drh
fa079680f1
Slight adjustment to test results for Windows in mmap1.test due to
...
the previous check-in.
FossilOrigin-Name: 5cf9ea9b1fff4625a50a2343d0fd3812da6612d6b24c07e10edb6c1ff03ca2df
2024-01-23 21:10:01 +00:00
dan
bcf3df0192
In os_unix.c and os_win.c, do not allow xFetch() to return a pointer to a page buffer that is right at the end of the mapped region - if the database is corrupted in a specific way such a page buffer might be overread by several bytes.
...
FossilOrigin-Name: 2684feac3bc9c5463604900d72710be861527614f4957224c74a16a3b3c702f5
2024-01-23 16:09:22 +00:00
drh
1ff9a7bc8d
Improved error message when a double-quoted identifier name cannot be
...
resolved - ask the user if they intended to use a string literal.
FossilOrigin-Name: efc5c3c5e6ae1f9f0be61ea4ce7b3e34f3dc318791c78e0f4bebebeaccf6951e
2024-01-23 14:45:22 +00:00
drh
5ff513c16e
When a JSON input is a blob, but it looks like valid JSON when cast to text,
...
then accept it as valid JSON. This replicates a long-standing bug in the
behavior of JSON routines, and thus avoids breaking legacy apps.
[forum:/forumpost/012136abd5292b8d|Forum thread 012136abd5292b8d].
FossilOrigin-Name: e5dc81d5c7ee97866feb688dfa9b6fc225dabff2b020b9b96b49a8fea5640aec
2024-01-23 13:51:55 +00:00
drh
6bb8ce6375
Fix typo in the tag-20240123-a in a comment.
...
FossilOrigin-Name: 1f09541eb4203ccce476f6040ff134353850f22f07fb84f96a1d2c27b304a91b
2024-01-23 13:28:21 +00:00
drh
e318f10ce2
If a BLOB looks like JSON when cast to text, then treat it as if it really
...
were JSON. This replicates a long-standing bug in the JSON processing
routines, and thereby avoids breaking legacy.
FossilOrigin-Name: d79a37690ce7ebb91df203170d73511da44546328043c2b3fe1786b2f0087093
2024-01-23 13:21:40 +00:00
stephan
91cee17d83
Change the shell's --help flag to exit with code 0 instead of 1, per /forum and /chat discussions.
...
FossilOrigin-Name: df563a18578c5cf1aaecf5818c93967aaa70475598d3c099779622ac8911f926
2024-01-23 12:51:17 +00:00
dan
406eb5a146
Add extra checks for the validity of a numeric literal to sqlite3DequoteNumber().
...
FossilOrigin-Name: d57407ef59baf699b72c8c4859abfaa7977dd41f6f16eb8fe1d53a68806eb966
2024-01-23 11:20:58 +00:00
drh
727b35cbfc
Simplification of the error reporting logic.
...
FossilOrigin-Name: 59eb9d29e796886db17a578b64e75fd2797aebf969cbeeda70ecf2fda378c98f
2024-01-22 20:49:47 +00:00
dan
a545de6827
Fix a problem in the previous commit with hex literals that start with "0X" instead of "0x".
...
FossilOrigin-Name: c063c89b11487e6e712b97de604db316fa97bcf91ed810bb2dcbbcb54c68dbf4
2024-01-22 19:42:56 +00:00
dan
8374f7dfaf
Allow underscores to occur in hex literals.
...
FossilOrigin-Name: 81a56229460cc5b6acfd3c3729fcf89ea3cccb546ca2b4f4035b140c60911e18
2024-01-22 19:38:55 +00:00
dan
fbb72fae8f
Add extra tests for the code on this branch.
...
FossilOrigin-Name: b15bbb201a7727806b9fd6c02f2579b01e0e38155a8f9e24c5d6f487fe3e8b6c
2024-01-22 19:00:50 +00:00
drh
87ad06ed99
Do not allow digit separators that are not surrounded on both sides by digits.
...
FossilOrigin-Name: 5bbc378a3022e2013048c8e296d95de21d15a8d7c1b62e8ffb64782f952cfe12
2024-01-22 17:18:41 +00:00
drh
a67d63b481
Improved error message when a double-quoted string is used and it seems likely
...
that the user wanted a single-quoted string literal.
FossilOrigin-Name: 0a834bd81122b6e9c34c8253f9e45d53dab3274be28df60968366fa42237617b
2024-01-22 15:26:33 +00:00
drh
41fb2eed07
The -DSQLITE_JSON_BLOB_INPUT_BUG_COMPATIBLE compile-time option causes blob
...
inputs to JSON functions that are not JSONB to be processed as if they
where text, immulating historical bugging behavior which some applications
have come to rely upon. See
[forum:/forumpost/012136abd5292b8d|forum thread 012136abd5292b8d] for
discussion.
FossilOrigin-Name: 65572223583d43e1d61ec029641f9d3ff340e68ecfba8342c8d1b0a91a680f2a
2024-01-22 14:16:10 +00:00
dan
b4b7088d5f
Fix test script literal.test so that it works with SQLITE_OMIT_ALTER_TABLE builds.
...
FossilOrigin-Name: 4dc00f577632c7b13135505007804d42a12f81a9ebd58d4c380727256b054b7e
2024-01-22 14:01:07 +00:00
drh
776fe42c70
Fix userauth so that it works together with SQLITE_OMIT_SHARED_CACHE.
...
([forum:/forumpost/0bfc5888a384d430|Forum post 0bfc5888a384d430]).
However, also change to code to issue a deprecation warning whenever
SQLITE_USER_AUTHENTICATION is used.
FossilOrigin-Name: 249048b0cbc37058c229a785182e07b46029584aff9c385269b0b93503153476
2024-01-22 12:56:58 +00:00
drh
3b799b0fca
Add a notice to the user-authentication documentation to say that the
...
extension is deprecated and may disappear in the future.
FossilOrigin-Name: fe6fc7b91ad1771a2d2d4e3d9d60831b3056d528a700932bf11a336c7e3414a2
2024-01-22 12:30:17 +00:00
dan
17589f7811
Fix test script literal.test so that it works with SQLITE_OMIT_ALTER_TABLE builds.
...
FossilOrigin-Name: b57327be4be9638f5ee834a6c9e06135aaef9e499516f8b53f927ffe81033f61
2024-01-22 11:12:38 +00:00
larrybr
05ab0f72c3
Make CLI .dump immune to pragma reverse_unordered_selects, as reported in [forum:/forumpost/c42be01880e961eb|Forum thread "Missing ORDER BY in .dump?"]
...
FossilOrigin-Name: 488caed24453fcef6fddcf40353e3b44cf37fb9d21e0ed743d39d60cbff020a7
2024-01-22 01:11:24 +00:00
drh
199b0b2d6e
Fix a harmless typo in a comment.
...
FossilOrigin-Name: 382a8f94bffef3e5f715116e363a30e21e2c53cd42d4959dfbe90c4624143e6d
2024-01-21 21:20:33 +00:00
dan
b75dc61a53
Merge trunk changes into this branch.
...
FossilOrigin-Name: 03ade4a810516ff84bc5c1a716b0e454cc8a89374100415ff21a82449112811b
2024-01-20 18:45:30 +00:00
dan
f28bff745c
Ensure that values generated by DEFAULT clauses that specify real numbers that can be expressed as 64-bit integers (e.g. -1234.0) are not silently converted to integers.
...
FossilOrigin-Name: 298d6977285c71be917896bc875a8a26d985dcf0a74069b7c4d290e8ff0ac618
2024-01-20 18:41:13 +00:00
drh
514bf99b6a
Simplifications to the strftime() logic.
...
FossilOrigin-Name: aaa5a044d8a4942278eb4269fa8c7252f9f1dc161408e618e7c97c55a12283ff
2024-01-20 18:26:28 +00:00
drh
6c64e24f9d
Fix a memory leak in new memdb1.test test cases that were added by
...
[e638d5e408ea2e18]. No changes to SQLite itself.
FossilOrigin-Name: bb2b7a658e0186d8b09199170db17744536602d8282b83c71ed969494d2ca465
2024-01-20 18:21:50 +00:00
dan
95295a7e9b
Add test cases for the new code on this branch.
...
FossilOrigin-Name: 49f29a7b4f44f691ecf7a57b26477971e6ffaf2a0b1690b4926ffbb43fa3929b
2024-01-20 16:46:25 +00:00
drh
2e12890732
Make sure that %V and %G are testing for every since day in between 1970-01-01
...
and 2023-01-19.
FossilOrigin-Name: 39c475f5fb86526622a715860385f0a3a4b2c18d8ef209779c423527e0639385
2024-01-20 16:38:00 +00:00
drh
b23f61b73f
Rig sqlite3_serialize() so that it will initialize a previously uninitialized
...
database prior to serializing it, so that it does not have a zero-byte size
and does not return NULL (except for OOM).
[forum:/forumpost/498777780e16880a|Forum thread 498777780e16880a].
FossilOrigin-Name: e638d5e408ea2e189b6771d16bbc2e42c606e88e05fbea78079b6e39e41f344c
2024-01-20 16:29:19 +00:00
dan
3eae6664a0
Allow "_" characters to appear following any digit in an integer or real SQL literal.
...
FossilOrigin-Name: 401650aaccbc99246bd4e1ff37a28b78f528178aee2f294d87b9f7fecd7432bb
2024-01-20 16:18:04 +00:00
drh
4c43f1881e
When doing a text-affinity comparison between two values where one or both
...
have both a text and a numeric type, make sure the numeric type does not
confuse the answer. This is a deeper fix to the problem observed by
[forum:/forumpost/3776b48e71|forum pose 3776b48e71]. The problem bisects
to [25f2246be404f38b] on 2014-08-24, prior to version 3.8.7.
FossilOrigin-Name: 709841f88c77276f09701bf38e25503c64b3a0afbe2fbf878136db12f31cbe21
2024-01-20 15:13:13 +00:00
drh
8dca1905ed
Ensure that the replace() SQL function always returns a TEXT value even
...
when its first argument is numeric and its second argument is an empty string.
Fix for the issue reported by
[forum:/forumpost/3776b48e71|forum post 3776b48e71].
FossilOrigin-Name: 01868ebcd25fadb2034da234c0636e82d07c5abc902ef66493cadfc988e74d7b
2024-01-20 13:18:22 +00:00
drh
777a08893b
When backing out a character in a constructed string in JSON, first make sure
...
the string has not been reset by on OOM.
dbsqlfuzz 2fffbea91a5376526ea118d4fe4188c8dd35e317.
FossilOrigin-Name: 666690eb433fe38fa527ccbbb8e2c00041a33939da4f6b8bfb737d664f28f0d8
2024-01-20 12:13:00 +00:00
drh
a74a7f5b9e
Fix the version number in the TEA configure script. This should have
...
been changed by [1481baf3d55effcc] three check-ins ago.
It is unclear how testing missed this.
FossilOrigin-Name: eaf2cf73fca3355edd05fef5b0d0262a6555633908794068805d12b1948beedc
2024-01-20 12:00:20 +00:00
drh
f08287cc12
Implement a new algorithm for computing ISO week values in strftime() based
...
on the idea (from [forum/forumpost/3681cb1bcd|Nuno Cruces]) of shifting the
date being tested to the Thursday of the same week.
FossilOrigin-Name: b06ab46a9ee98719159ed3e05cdfbf26281353d781206f56ed7cb12859210fed
2024-01-20 00:31:44 +00:00
dan
a4802720a1
Allow large hexadecimal literals to be used as DEFAULT values.
...
FossilOrigin-Name: 8cccc1f27d7470d3cdd3c9c6d74f6a5ac49ec6eaa7002bcf96f4842fb8c79e1a
2024-01-19 16:51:34 +00:00
drh
0a626b2b52
Increase the version number to 3.46.0 to begin the next development cycle.
...
FossilOrigin-Name: 1481baf3d55effcc117f2097e2d49a6f60f5f74b21190c3be943fd785b8a4c5b
2024-01-18 16:52:11 +00:00
drh
d0603eda6c
Add support in the strftime() SQL function for conversion letters %G, %g,
...
%U, and %V.
FossilOrigin-Name: e1155d6aa4b960ecfd14fa3467f28672af3327699c547f5b9e75da3ac1348ff7
2024-01-18 16:50:25 +00:00