Commit Graph

2887 Commits

Author SHA1 Message Date
drh
ff9186137d The fix in the previous check-in was only correct if the OOM occurs on
the initial allocation.  This changes should make it correct for a resize
as well.

FossilOrigin-Name: 57087ab2f297e4d96da5b9f3b89a26d8dd2bc4d22c2be8045b5d956d86282f39
2021-05-22 11:00:03 +00:00
drh
d42dbd9dfe If an FTS5 Cursor fails to enlarge the space for the aInst array, set the
size of the aInst array to zero.
dbsqlfuzz 294254b8105cca409f27a711f1eb2e9e63cbcac5.

FossilOrigin-Name: 4ae5e5b5ecbce580d3f7f970076e828fc6fb5fbcdc3bbe8381ab38f52870a54f
2021-05-22 01:30:30 +00:00
dan
01ec691979 Fixes for cksmvfs and rbu so that they work together.
FossilOrigin-Name: f35f6972cdcf16915cc37908b65a3780742a1f75f65e974714b16e86f0c9e3f0
2021-05-06 20:47:49 +00:00
drh
e31cba5675 Remove an assert() in FTS5 that can (rarely) be false in the event of an
OOM while processing a corrupt database file.

FossilOrigin-Name: 5f12f89154843e83b1d69ea1652e881d583aa329df732af72dd59029cd7eb577
2021-05-06 13:45:37 +00:00
dan
4fd82a2a78 Fix an undefined-integer-overflow problem in fts3.c.
FossilOrigin-Name: a0bf931bd712037e44e8d7cac3c00a6715c1b451f222bad3184d3ecab1a4c7f4
2021-05-05 11:47:34 +00:00
drh
e103a8de2d Fix a potential memory leak following OOM in the decimal extension.
FossilOrigin-Name: 5127f7376776e6220eb8f83a30aa6b823c23ae0ac76e7ae41b33ca4e03ce236a
2021-05-03 13:24:30 +00:00
drh
76baad95f4 Guard against a NULL-pointer dereference following OOM in the JSON extension.
FossilOrigin-Name: ea221f3c8e243a5dc4952e510cbe396614a24876bacdc04fb1ebd4127c7ef0d9
2021-04-30 16:12:40 +00:00
larrybr
5f5719bd07 Reduce API lifetime requirement for objects passed to sqlite3_bind_...() with SQLITE_STATIC.
Also fix broken session doc links (by zapping refs.)

FossilOrigin-Name: 327eb4792f9b98f6220fd35ba744002d36ed53f43a016924117b3cea32343947
2021-04-29 19:30:35 +00:00
dan
a4cd0bbcb3 Fix a segfault that could occur when querying a corrupt data structures with an fts5token table.
FossilOrigin-Name: cbedfa05501f3eb9750fb21e2ab8516f8f14c479c847f454e52572af278aab71
2021-04-27 11:28:57 +00:00
dan
f3d5a68461 Fix an assert() in fts5_index.c that may fail if the database records are corrupt.
FossilOrigin-Name: dfadb96edfef1d49e48a659264b9eb8d7f98d95d159d95c92c30dd4ba6c6e739
2021-04-23 11:37:01 +00:00
drh
214b50314a Fix harmless compiler warnings of unused function parameters in FTS5.
FossilOrigin-Name: 14273915979f8fbf80111e795b5511a6ee24638896b9d434d6ccf4bf7f7a7f62
2021-04-22 19:34:31 +00:00
dan
743b5fd589 Further tweaks for comments in sqlite3session.h.
FossilOrigin-Name: 553ada28f356d773c145b502163d766285e73fd4f64dc05f98e3e43ade806331
2021-04-22 18:52:36 +00:00
dan
9ad39a33ff Change to comments in sqlite3session.h. No changes to code.
FossilOrigin-Name: 353ebb71c4113a35a92011c72f9c1d6c56f3bf681d94426a6a73e40f219ff2f4
2021-04-22 18:39:02 +00:00
dan
a5b51b8715 Add the experimental sqlite3session_changeset_size() API.
FossilOrigin-Name: 3de544d495fee553d95fde3fb656745d633138115d25ed39760a1ea7c8c3fae6
2021-04-22 17:55:42 +00:00
dan
6d29a4fe5b Add the sqlite3session_object_config() API. Current used to enable/disable collecting data for sqlite3session_changeset_size().
FossilOrigin-Name: 4d5fd2151e024d11289b6c4fbce2996d8d07b2b5a1c953ef895c237e79d3aa55
2021-04-22 17:40:28 +00:00
drh
68b63c0195 Fix the date/time translation logic in the zipfile extension so that it
works with boundary cases. See
[forum:/forumpost/d82289d69f|forum post d82289d69f] for the trouble report.

FossilOrigin-Name: c8de5f061359c174e143e5e81ade8aa9b7d71ba57287459cf0f4f2c94459c345
2021-04-22 14:43:16 +00:00
drh
1da9c97bc0 Ensure that the typedefs for specific-length integers in zipfile.c are
correct.

FossilOrigin-Name: f1f2a49007e938ea7a00dda6f8898b1cd38525c0de1e1cac00a7aebcd7b625f5
2021-04-22 13:59:54 +00:00
dan
a23a873fbb Add the experimental sqlite3session_changeset_size() API.
FossilOrigin-Name: b5564a6fd54875db1de884fdc0e5eeabcd6aa5595ad03a8a60843503e830a2d8
2021-04-21 20:52:17 +00:00
dan
6a4f7f0225 Remove fts5 test functions fts5_expr(), fts5_expr_tcl(), fts5_isalnum() and fts5_fold() from release builds.
FossilOrigin-Name: c68a6c6c898d2acd1f7032ff98f8f3f99eb0b37ffbc6ee88d0dd7badf55a0e0a
2021-04-19 16:45:09 +00:00
larrybr
1929cc0d8a Add geopoly to $::sqlite_options() and use it to pass more tests.
FossilOrigin-Name: 23da5016b66f3947cc902dbe2766ea9f5a00f85312a652b536ab51d657446ab7
2021-04-16 23:43:22 +00:00
dan
6c68e55689 Fix another undefined behaviour in fts3 that could follow an OOM error.
FossilOrigin-Name: fac3ff857c4abdb44f59849af80d93a5bd4b64f088e5164fb5ad0be8d14748b7
2021-04-16 17:09:58 +00:00
dan
7f2eb8fff2 Avoid signed integer overflow when finding snippets in fts3 by using 64-bit integer offsets.
FossilOrigin-Name: 4cc09a872f627f4a2b94345bef07cd49c3ec3627f8d78c1eb091741cdb4ec0b3
2021-04-16 16:55:28 +00:00
dan
11a6e9d9f0 Fix an assert() in fts3 that might fail when handing corrupt records.
FossilOrigin-Name: d0e2d6742f314f71562e404980aad20de6b17e0b04c08582c18bbc4fd0360751
2021-04-16 11:25:37 +00:00
dan
385b982865 Prevent an assert() from failing if sqlite3_blob_reopen() is called on a blob-handle that has already hit an SQLITE_CORRUPT error.
FossilOrigin-Name: b5dc7aba036cfd6d09c68dd17608328063634ca99ff341f97bab2dc2a1f59b11
2021-04-14 15:25:10 +00:00
dan
8505d73dc0 Fix a potential crash when using json_group_array() as a window function.
FossilOrigin-Name: 3c266690c753d093c2cb74138a46ed69276d85cd119d687a6858c84211e84eaf
2021-04-14 12:11:39 +00:00
dan
304cbc17c2 Fix an undefined signed integer overflow in fts5.
FossilOrigin-Name: e6f0adb00da84561e686a8db83858c7fd6b008756dd1aef807ea68f878ca3db7
2021-04-13 17:45:36 +00:00
drh
b3d2ba7cb0 In the rtreedepth() function, detect OOM when converting a zeroblob() on
input.  dbsqlfuzz ed23eda7cc3a8a054f85ea19d55c59ba2ca72744.

FossilOrigin-Name: 69f843c8fa6e21500b5777169c3b394453ba818b4e32427428480dca5b4ed615
2021-04-13 12:28:55 +00:00
drh
0e5cd34915 Fix an error in the inversion function for json_group_array().
dbsqlfuzz 68a4b0f668b7bc27235e3f1c5cff8a2d94cfa17e.

FossilOrigin-Name: e718a62ed1d5ba9b1404ba67fae1ad731809e2ebd9253edc57d2b34a19fbef24
2021-04-13 01:12:32 +00:00
drh
f1f12661c3 Avoid taking the address of a NULL pointer following an OOM in FTS5. Doing
so is harmless in actual practice, but it technically UB so we want to
avoid it.

FossilOrigin-Name: 1cfcd9dceb56b5987e6900a36a0ec092f0e1b13a7e754b8c3d8efb943e5bcc66
2021-04-12 18:32:33 +00:00
drh
6af2a728e4 Fix an obscure memory leak in FTS3. dbsqlfuzz 26a51001beeff35649d2e328b05ec06f93c577a5
FossilOrigin-Name: be7cd9ebb1ba360c60469073b2e526cb1cceea702e43fcc07f47b47986908c8f
2021-04-08 13:41:20 +00:00
drh
e7e7481a29 In FTS3, if the xBegin method fails to start a transaction due to an OOM
error, then make sure that the virtual table is left in a consistent state.
dbsqlfuzz 85ef48423fda4eef79a551654445d8ef3537a590.

FossilOrigin-Name: dd553578333f49950a197fe894d02e08cce011c9ae1a7270604186af204dcf6d
2021-04-07 12:59:09 +00:00
larrybr
6536c4f18e Fix seg-fault upon appendvfs attempt to open non-existent file.
FossilOrigin-Name: 04f6439f4d9b9b1f717c3aa243a93585df7e7844c216fab5d15bebb050ab00b1
2021-04-07 09:31:32 +00:00
drh
a74364ae13 Detect OOM earlier in the geopoly extension.
dbsqlfuzz 0986e7b020e6137fc6b96331f91d15753d18e42d.

FossilOrigin-Name: 7237117595a3519717a0a4b03eb427c6ec55b214e7ecd6d0f63a613adec355d4
2021-04-06 22:56:28 +00:00
dan
d73ade7d87 Fix issue with failing --enable-debug --enable-fts5 build.
FossilOrigin-Name: e7491acc0c93b7b0b5a27130d956bb23f876b90ced11cdd416a86727af076ee1
2021-04-06 17:51:18 +00:00
dan
f22c590bab Remove some test routines from release builds of fts5.
FossilOrigin-Name: 3088bf15ca53fac3bad94f241e648836631b6d801d42837c238ff27d85074ca4
2021-04-06 14:46:50 +00:00
drh
ec435c40ed Fix a problem with the geopoly_bbox() function.
FossilOrigin-Name: f3a2eb979f1003e8249e613b34afd345f157c0d54b4f05ea0db230ef70e71351
2021-04-02 18:59:13 +00:00
dan
acbae3ba10 Add "#ifdef SQLITE_DEBUG" blocks around test variables sqlite3_fts5_may_be_corrupt and sqlite3_fts3_may_be_corrupt.
FossilOrigin-Name: 004559544e661f9afa60306c4ac6842c29a8630b3663d62aa0cdc637f176932e
2021-03-29 20:04:31 +00:00
drh
8210233c7b Revise tests cases to align with the new EXPLAIN QUERY PLAN output.
FossilOrigin-Name: 50fbd532602d2c316813046ed6be8be2991c281eb5f295c4c28520a0de73862c
2021-03-20 15:11:29 +00:00
drh
49e6e5a04f In the wholenumber virtual table, increase the cost penalty for running
open-loop.  This appears to fix the problem reported by
[https://sqlite.org/forum/forumpost/b52a020ce4|forum post b52a020ce4].

FossilOrigin-Name: f12b54042e27b2fe99f23f97c103ee4371f8d4df3b049d9bb5d64891db56eee5
2021-03-19 17:54:43 +00:00
drh
8b04094c4f Fix a harmless compiler warning in the appendvfs.c extension.
FossilOrigin-Name: 0ed7eb9115510511f13dca715bb2b178580648517d8d30436a992d70a2e85ac1
2021-03-17 19:05:59 +00:00
dan
42470513b7 Fix a problem in sqldiff virtual table hanlding to do with tab and other non-space whitespace characters in the CREATE VIRTUAL TABLE statement.
FossilOrigin-Name: 1737e4fdfc9a3628415b234338a68a64cbbaadb23598517761e571ab7ed7ad14
2021-03-17 11:25:42 +00:00
drh
3fee67533e Comment and stylistic changes to the appendvfs.c implementation.
FossilOrigin-Name: 25c3186aa143328157fb506a29802e87099cd14be4fa218230484a3212f20621
2021-03-16 14:12:26 +00:00
larrybr
67d4bbf6c1 Fix assert typo.
FossilOrigin-Name: 3aedf818c1cfc88ee1103abd8b20e787f6be1bcc4c9350963f0cd52f5ac04154
2021-03-16 07:06:29 +00:00
larrybr
5cad178b86 Fix appendvfs bug exposed with bigger files, and add tests for such conditions.
FossilOrigin-Name: 19b1f53a1c0a14440ae8ac71660a2595d37a4a5b201055c19366c7dca75d6660
2021-03-16 06:41:51 +00:00
larrybr
ab6098cfa6 Conform description of sqlite3changeset_op() arguments to implemented behavior, some reformatting.
This is a comment-only change; no code is affected.

FossilOrigin-Name: 9d6e544c47b9a5d97bd02a658db5cd202bd1952f8ba3bc50e8cf47d7206041c0
2021-03-12 00:44:10 +00:00
dan
3ddc3809bf Fix a Tcl object leak in test_session.c.
FossilOrigin-Name: 07150cf15ad36c7fc681a911f66db23d610ddf110a7be7f1fcefbd8750cd135a
2021-03-11 15:57:25 +00:00
drh
407cfe994d Bug fix in appendvfs.c: Adjust the size parameter for
SQLITE_FCNTL_SIZE_HINT to account for the prefix.

FossilOrigin-Name: 41df3bbefd63151f2ddb920066777eab8e07ecfc0edb0f71f9493debe0a4a2c4
2021-03-11 13:43:29 +00:00
dan
3fb7bd5ee0 Fix sanitizer complaint in fts3 code.
FossilOrigin-Name: 424b39eaeb578f85e58214af4b467e6e363431308ab7a327774e62fa70d3c2db
2021-03-10 20:04:21 +00:00
dan
55b2e8b062 Fix further sanitizer complaints in the fts5 code.
FossilOrigin-Name: 4cb00b9d4020a51f690720c6f51009c5be8c22ef8c70807ead1d953d19784f26
2021-03-10 19:32:47 +00:00
dan
3be2b860d0 Fix a few sanitizer complaints in fts5.
FossilOrigin-Name: 4fe4fee00e9294fa384bd073ed8e9a2a4ad10dcf653b6ad4851e44a64443ede9
2021-03-10 14:57:10 +00:00