Commit Graph

2906 Commits

Author SHA1 Message Date
dan
30b5db1261 Fix a problem that could cause an infinite loop in the fts3 'merge' command.
FossilOrigin-Name: be545f85a6ef09cc6c762f7d2ab7a0b3adf5590c3fbdc9903e6b5b5cec6e823f
2020-06-26 20:41:18 +00:00
drh
85c4754697 Add the ieee754_to_blob() and ieee754_from_blob() functions. Fix the handling
of subnormal forms in the two-argument version of ieee754().

FossilOrigin-Name: c78cbf2e86850cc6882d3f0bd5415f6e731c3c675ffe77bb343682c619cb8cd9
2020-06-26 15:32:29 +00:00
drh
8cda77d44a Add the ieee754_mantissa() and ieee754_exponent() functions to the iee754
extension.  Build the ieee754 extension into the CLI.

FossilOrigin-Name: db2f0836b64cd2e119684f1cf75fa3b19a84ca6aca1a239f7e2b9298016e2c95
2020-06-24 15:06:29 +00:00
drh
ec18b6e5b9 Fix the decoding of subnormal values in the ieee754 extension.
FossilOrigin-Name: 838817b680f02b3845d6d56f85d5d36fa5ae7453afef7a1a5a24624255f2dc3e
2020-06-24 13:52:10 +00:00
drh
b5b9bf8540 In the one-argument version of the ieee754() extension function, if the
argument is an 8-byte blob, interpret that blob as a binary64 floating point
and decode it.

FossilOrigin-Name: 4199c1e8aa47d77df3ef598cb6f5418f67970dd00f34823463c85eabfc8d2b77
2020-06-24 13:14:00 +00:00
drh
9f683de872 Add the decimal extension. It is built into the shell, but is an optional
add-on for the library.  It is not included in the amalgamation.

FossilOrigin-Name: 5391687bf8563b3fdd157b436b2cbb6a0ee5f676727d41bbddfaa8eacc39729b
2020-06-24 12:29:19 +00:00
drh
e78c027b64 Fix a harmless compiler warning.
FossilOrigin-Name: e1416c8b0628afa062d8cff40d0cd3576dc85460e55b21a271f88fcb608b9f59
2020-06-23 15:29:22 +00:00
drh
6b64718618 Avoid unnecessary normalization in decimal_sum(). Trim excess trailing
zeros off the result of decimal_mul().

FossilOrigin-Name: 0294ce071c863eb517e97beff31c3d95a4370e979a969415162302a90d3fda0e
2020-06-23 14:44:57 +00:00
drh
427af8dc3d Add the decimal_mul() function.
FossilOrigin-Name: 72eee04b67268ad38fd51ff32849f08c0a54cf1b481d5ecb11d77cc9c729ee03
2020-06-22 21:25:37 +00:00
drh
beb9def059 An extension for doing decimal arithmetic on strings.
FossilOrigin-Name: 4c3b85607feb53462ccc8b89bea699fdb132c402eae597afa33cc40a85c32329
2020-06-22 19:12:23 +00:00
dan
3259295533 Fix problems with handling return value of mmap() in lsm_unix.c (mmap() returns MAP_FAILED on error, not NULL).
FossilOrigin-Name: da06168c09df5c0e8e10d0f9618e69217d4c0173a8199660bad2805f009d7b08
2020-06-22 16:02:06 +00:00
drh
067b92ba00 Extend the refactoring into extensions. Clean up stray newlines.
FossilOrigin-Name: 7a876209a678a34c198b54ceef9e3c041f128a14dc73357f6a57cadadaa6cf7b
2020-06-19 15:24:12 +00:00
dan
0ad1b3284a Fix an assert() in fts3 that could fail when processing a corrupt record.
FossilOrigin-Name: 4adc0a1b0d84c2df6d6bf0d5d9d3fa9f7d048af8d232c4beb77518727890f212
2020-06-17 14:54:06 +00:00
dan
5d237bfab1 Fix a problem with retrying constraint failures within sqlite3changeset_apply() calls with the SQLITE_CHANGESET_INVERT flag is set.
FossilOrigin-Name: d73e857b833dfc29400049ca7f01ca465f980466e3aa67214c3c5e5573181419
2020-06-17 14:14:11 +00:00
dan
b65ce39607 Fix an assert() in fts3 that can fail when processing a corrupt record.
FossilOrigin-Name: a58a6d6fb241a50c4c7c9af8a9c65bc4746e905b2ae12290c7182afa944053a2
2020-06-16 14:06:20 +00:00
dan
56e38185fe Fix a buffer overread in fts3 that could occur when decoding a corrupted record.
FossilOrigin-Name: 9a4a40c45feb2bb89020dc7711b4753479112ceae7ce2a44521d72afeddfac83
2020-06-12 15:17:27 +00:00
drh
ac4f7cf8d3 Make sure the bbox object is fully initialized in geopoly, even if reading
a corrupted database.

FossilOrigin-Name: fd5abb1a7b5a55127d5c0d5ff448020d8bccab44e4f5afe1eb88fc19578af735
2020-06-10 14:30:15 +00:00
dan
5c10930fa9 Fix a case where a corrupted fts3 record could cause an assert() failure, or spurious SQLITE_NOMEM error in builds with assert() disabled.
FossilOrigin-Name: d48af4d2cfff3d5f4ccc3db5d658e8b503255b577e6e62b5c2b4a4437875b895
2020-06-08 14:43:41 +00:00
drh
a3d6b8e5a7 Fix the cksumvfs extension so that it will not register itself more than
once.

FossilOrigin-Name: d5cdd57150db914b61b8b9c61c6caac9690fe7b647ee2c003e75b9b62be62752
2020-05-26 20:33:18 +00:00
drh
efc752b131 Fix minor compile issues with optional extensions.
FossilOrigin-Name: 3261ee9ec26bbeaa64190c12556a1d8146270b6660c70004830bd38c1b5b63f4
2020-05-25 12:49:58 +00:00
dan
23e3c340b5 Avoid another potential OOB read in sqlite3expert.c.
FossilOrigin-Name: 0ccea80092f16e7f17f4c4de4f8be3fdef217199fcc08ace37e179c1b22c1294
2020-05-21 19:13:46 +00:00
drh
1a7feefac5 User-suggested improvement to the README.txt for the ICU extension.
FossilOrigin-Name: 1d1293c25abdd4b0fca64e5b1d0a118e2f339635dbc89422c0c2463fbf9ee27f
2020-05-19 12:29:56 +00:00
drh
c795e3df7a Avoid harmless UB in memcpy() in the JSON extension.
FossilOrigin-Name: 69e149f76853d196c8855fedfc98848b60fb116ac36bc08824b1a122469f8ece
2020-05-17 13:47:28 +00:00
dan
becd68ba0d Fix a use-after-free bug in the fts3 snippet() function.
FossilOrigin-Name: 0d69f76f0865f9626078bee087a22fb826407279e78cf9d5382e1c985c9f64a9
2020-05-16 17:26:58 +00:00
dan
b2c6fe225a Update code in sqlite3expert.c to account for the fact that "-- TRIGGER xyz" VM comments are now omitted for some builds.
FossilOrigin-Name: 7cf93dc55c48c68731a1fe3ae3517fcfeb5c252bfa87e715a333c6194bcc0ace
2020-05-15 18:48:31 +00:00
dan
d48eafb984 Fix another build problem for SQLITE_OMIT_VIRTUALTABLE builds.
FossilOrigin-Name: 5e1eb0fa3afd74251bc8f484e3edfa81b15610479431af205bd952c91eecd21f
2020-05-15 16:19:35 +00:00
drh
219b8e7e75 Fix a null pointer deference that can occur on a strange matchinfo()
query.

FossilOrigin-Name: a4dd148928ea65bd4e1654dfacc3d8057d1f85b8c9939416991d50722e5a720e
2020-05-14 23:59:24 +00:00
dan
2d3ed22a3f Fix a failing assert() in fts3 triggered by a corrupt database.
FossilOrigin-Name: cb299a090c81cdc5c116c4e15ab38fce112916f8b0fad0c7f2ab127e79238a94
2020-05-07 19:55:40 +00:00
drh
eb8305bbc7 Fix a compiler warning in cksumvfs.c.
FossilOrigin-Name: 68033bcade87e6046f4c0a49936d63ce531c680c1def98fae02afa0c79db2c7f
2020-05-05 13:41:40 +00:00
drh
3d42fb788a Fix harmless compiler warnings.
FossilOrigin-Name: 8eee591d3cb9fadfd5cac5543bd66ef9cb371a72d3ad3241fb3bfd67fb216eda
2020-05-04 19:52:00 +00:00
drh
44a5c86c6c Minor change to the sqlite_stmt virtual table, for test coverage.
FossilOrigin-Name: 838987b2097c4b7acaa65aea99cfdaf199f04d76bcf6ef12743c60b338a965f7
2020-05-04 19:04:23 +00:00
drh
fcf31b28ff Add the SQLITE_FCNTL_CKPT_START file-control. Use it to optimize the
cksumvfs extension.

FossilOrigin-Name: b40f5aa344ae10cf4da83b3aa9e4866d6f6ffb06ba7e34ec1ce80c92468cf3bf
2020-05-01 18:37:34 +00:00
drh
cdb6ce980b Add the new SQLITE_IOERR_DATA result code and use it in cksumvfs.
Also enhance cksumvfs to emit an sqlite3_log() message whenever it finds
an invalid checksum.

FossilOrigin-Name: a094e8bfdef10d9e5d97f5a9f7c15b0fc547358b83367762ba5c2dfd2c9d0117
2020-05-01 11:31:43 +00:00
drh
95063d8c90 Do not allow page_size changes on an active cksumvfs database.
FossilOrigin-Name: 2c17cdce26fd935e6d81ff828f4670291fc014013c93b2a1578506598345ee86
2020-04-29 01:09:46 +00:00
drh
065e4a8d29 Add the cksumvfs extension.
FossilOrigin-Name: 237c10f941cc6cb775693ae87513ff1b816f12b5e9c3d57b057421204d2d02cf
2020-04-28 20:47:40 +00:00
dan
fc7f31742d Fix an integer overflow in fts3 causing a usan error.
FossilOrigin-Name: e256f85289a78e629acdf83e5bf1f8df2a0ffb3d559738eb9e49db6c228dc8c0
2020-04-22 11:11:17 +00:00
dan
054a081555 Merge accidentally created fork.
FossilOrigin-Name: cb772b7a8fb53694cb267e74c11f49d2b9fd6920821c4e232f90ec35739c8904
2020-04-16 15:56:03 +00:00
dan
7576a68c8c Improve corruption detection in fts3 shadow tables earlier in order to prevent an assert() from failing.
FossilOrigin-Name: a9ec8c8f80a59badabb0afdb4189f0fd2934f936530d4151de395b3a7e7c1f1f
2020-04-16 11:35:27 +00:00
drh
e6a85962e7 Add the UINT collating sequence extension. The implementation is copied out
of the "natsort" branch.

FossilOrigin-Name: 6f46c6e3e3c471ca864d7596e0211ee90316b784c8fe22c7ae177c9d29731dc7
2020-04-14 15:48:55 +00:00
mistachkin
43e862723e When compiling the shell for WinRT, avoid using Win32 APIs that are unavailable.
FossilOrigin-Name: 85d3dc8c50d8dbb8eac1956e8976e861d3b671e03355ca9257060fa3dca51cc4
2020-04-09 15:31:22 +00:00
dan
00bd55e1ae Allow "main" to be used to refer to the main database even after SQLITE_DBCONFIG_MAINDBNAME has been used to assign another alias.
FossilOrigin-Name: 75c85ca32f9ae4a28fd8f8ff2f7639599413d22af706e9799a0e76cc560d14eb
2020-03-20 20:54:28 +00:00
dan
ec8e689a20 Avoid an undefined integer overflow in fts3 by detecting data structure corruption earlier.
FossilOrigin-Name: 86e98ddc19470410ccc6d2cf4ad56ef0bc5a23b7fbe6331b8cae374689f54529
2020-03-20 20:18:49 +00:00
drh
589c787620 Chagnes the ESCAPE clause on the LIKE operator to overwrite wildcard
characters, in order ot match the behavior of PosgreSQL.

FossilOrigin-Name: 11e0844f71e8f2d27ce9363fb505e02fd7795c61dae0b3886cf0d8df4484dd97
2020-03-19 18:13:28 +00:00
drh
b3f0d92b91 Improved detection of corruption in the interior nodes of a segment btree
in FTS3/4.

FossilOrigin-Name: cc99447ac923166104e8a7c75088ed95279f4491b30cfa37dc3ee5e005dd9fac
2020-03-03 01:16:04 +00:00
drh
2826918d10 The RTREE extension behaves has if data columns have type REAL, so we
should actually declare them as REAL so that automatic indexes handle
them correctly.  Ticket [e63b4d1a65546532]

FossilOrigin-Name: 85a9b6a92fd5805d5936f02d555af395441607b9eb5f4dae63560b5e65663b00
2020-02-28 16:04:28 +00:00
dan
9e5ecdc172 In sqlite3changeset_apply(), ensure that DELETE and UPDATE changes are always executed on main database tables, not similarly named temp tables, as documented. INSERT statements are already being handled correctly.
FossilOrigin-Name: f71a13d072398c9fc3556f42d75159cc2d0edc2c42f6c47f64503a7fbbca6e37
2020-02-27 17:16:45 +00:00
drh
ac9e184e1f Avoid an infinite recursion on an illegal recursive definition of an
fts5vocab table.

FossilOrigin-Name: 109ee07433b274a39954cef62bf67d47bcda960df9bef56127210ebf1c3c104c
2020-02-16 17:40:35 +00:00
drh
df9b5cab93 Mark the sha1() extension function as SQLITE_DETERMINISTIC.
FossilOrigin-Name: 7d8dcfb95cea732e7588e7505bf80a171dd2e371b164c9435c6ac286060df6df
2020-02-10 19:24:49 +00:00
dan
fcbc673752 Fix some fts3 problems found by usan.
FossilOrigin-Name: fb7ccf61bed8d862986eda7096bec3df5947f1d1c88f27e7d9c8acf420f40c50
2020-02-06 10:55:10 +00:00
drh
7aedd5d70b Fix a minor typo in a comment in the btreeinfo extension.
FossilOrigin-Name: b5a66d10f4bbaf10def7b50b9ed98b05b41bb2c2af5ab9a90f6cda61169ab123
2020-01-31 14:52:19 +00:00
drh
9ca9a53a42 Modify a couple of FTS test cases so that they work on big-endian platforms.
FossilOrigin-Name: b20503aaf5b6595afafee6aa2bc6276354a62b0f583f6d94e31fedfdfc130347
2020-01-29 12:37:59 +00:00
mistachkin
8122c6e9be Fix variable declaration issue seen with MSVC.
FossilOrigin-Name: 8a6fe3066cf0599fcf2960e8fb3ae39e4e7a61ec81e8ec71d0b5910aee2c16f6
2020-01-23 00:08:25 +00:00
dan
39ef8b31fb Fix a problem in the userauth extension causing it to occasionally set "PRAGMA count_changes" (and some others) to true.
FossilOrigin-Name: 3a62f64222ebd176c06e89b9fe5275b7b1f09df0afbae1c5c148a4e527e9d80b
2020-01-21 13:40:35 +00:00
drh
988af251d8 Fix the series.c and spellfix.c extensions to use SQLITE_VTAB_INNOCUOUS
correctly.  Fix the documentation on sqlite3_vtab_config() to take into
account SQLITE_VTAB_INNOCUOUS and SQLITE_VTAB_DIRECTONLY.

FossilOrigin-Name: 9265cb7f026c0e959bd034d4cd94fe597744e0dd455d0a20736ee5f5bee880c8
2020-01-21 12:29:02 +00:00
drh
929a940678 The compress() function should not be deterministic since the same input can
have multiple possible compressed outputs.  The uncompress() function, on the
other hand, is deterministic.

FossilOrigin-Name: 84f314902c48336849081c7e9fe2a52caf171b8215a1c6e80cded0700c447eb1
2020-01-17 21:12:22 +00:00
drh
be22a85406 Fix the urifuncs.c extension (used for testing and debugging only) so that
the sqlite3_filename_database() SQL function and its siblings correctly handle
an invalid schema name passed in as the argument.

FossilOrigin-Name: 3d7434a9d85dae9135473d1c58c22ac01a282e654807aa10be9b39f127291594
2020-01-14 16:50:09 +00:00
drh
299b102b93 Add the new noop_nd() debugging function to the noop.c extension.
FossilOrigin-Name: 72911fb1b010ae093a161b9c0d21cbdedcbc1f924a55f12227fbe342bd978e08
2020-01-14 16:33:07 +00:00
drh
d8df36bd4e Change the zipfile virtual table so that the xBestIndex method gives a
reasonable cost estimate even if no filename is specified.  The missing
filename error continues to be raised in the xFilter method.  Meanwhile,
the more reasonable cost estimate avoids unnecessary wierdness in the query
planner.

FossilOrigin-Name: 0e468aa6decc73be307596782a778a739ff1b5dc0eb10fc4bd6776e460f99f8b
2020-01-12 22:25:58 +00:00
drh
8080403e44 Redesign for better legacy compatibility. Add the sqlite3_uri_key() interface.
FossilOrigin-Name: bcb43d11c4d0be36888c9e968ccdf85e7d7fccd72a29866f85c014e0562d4b93
2020-01-11 16:08:31 +00:00
drh
2e22579dea Fix the fossildelta.c extension so that it will compile on mingw.
FossilOrigin-Name: 20237d5dc4451f142b511e50a4acef4574cef17b9222c87dcebfe1ed1bab0ad9
2020-01-09 23:07:21 +00:00
drh
bebce86cde Merge in the untrusted-schema enhancements.
See [/doc/87aea3ab1cdda453/doc/trusted-schema.md|doc/trusted-schema.md]
for details.

FossilOrigin-Name: 5720924cb07766cd54fb042da58f4b4acf12b60029fba86a23a606ad0d0f7c68
2020-01-09 20:44:37 +00:00
drh
32d184e049 Only register the fts3_tokenizer() function using a single text encoding.
FossilOrigin-Name: 966964af1021feebc56cfda7b08bc787be7f447d682299f7958463aca30a73af
2020-01-09 20:33:36 +00:00
drh
6d35956c86 Fix the rot13.c extension to be deterministic. Add the noop.c extension.
FossilOrigin-Name: a679122ca8ec95d5c8afba3a1a50170db9dd519a3810e56877b8f56e858d0175
2020-01-08 15:43:29 +00:00
drh
2b1c2aad9f Create the "trusted_schema" pragma. Add sqlite3_vtab_config() calls to set
the risk rank for many virtual tables.

FossilOrigin-Name: 4c21373c21c9b17b222ae65297a039a035e6ec6b505c00c33704e3c03f94f834
2020-01-07 19:45:40 +00:00
drh
46d987405c Merge recent fixes from trunk.
FossilOrigin-Name: 5dfa33a09e608d26549e46c58a5563754688af68fa99415f9a548e91f81aca7c
2020-01-07 15:44:22 +00:00
dan
262efe4a43 Fix an instance of an undefined behaviour (a left-shift of a 64-bit unsigned integer by a value greater than 64) that could occur in fts3.
FossilOrigin-Name: e1f12978b53683114ab0ef0e84a14dd4fabc72750b214aac19cd9da22a582a27
2020-01-07 09:06:43 +00:00
drh
af23236660 Merge the latest fixes from trunk.
FossilOrigin-Name: 26ef709a47294c512a70aecd37d29caecec2af261977d9fb2c4d78d09b12f77a
2020-01-04 15:37:57 +00:00
drh
79d5bc80c7 Enhance PRAGMA function_list so that it shows all instances of each FuncDef,
the number of arguments, the encoding, the type, and the flags.  Use this
capability to locate and fix incorrect function flags in the standard build.

FossilOrigin-Name: 9ca906d24a2e88eddb2fd067783512b66cfc49dce1596d816a1c38a09d128218
2020-01-04 01:43:02 +00:00
dan
e455e3acf0 In fts3, avoid making a very large memory allocation if the merge-hint record is corrupt.
FossilOrigin-Name: 9add58fe9688d5c1f675736e7f1c6ff7831d2ff6fdeb884a2e62c1bf9536ee50
2020-01-03 20:16:32 +00:00
drh
0d21eae099 Improvement to check-in [7405e98225761180] so that missing or null filenames
given to the zipfile extension throw an immediate error.

FossilOrigin-Name: 523e09bd228750fb7be1d4e68d18f6c1bf9db19293d66fbf30b86409321e9814
2020-01-03 16:38:54 +00:00
drh
0c4f82051c Do not allow the zipfile virtual table to start a transaction if no
filename has been specified.

FossilOrigin-Name: 7405e982257611803792617f5d8142c54f9831b4a030f4de8607888c525e6289
2020-01-02 21:30:13 +00:00
dan
9f3e6fadde Handle blobs that are the return values of functions being cast to text in utf16 databases in the same way as blobs read directly from the database. Fix for [771fe617].
FossilOrigin-Name: e782096aa06fcf410c3a0a6ee26a9e4f44333da39b28b2efe675814a8652911a
2020-01-02 16:24:22 +00:00
drh
1e732787da Set the SQLITE_DIRECTONLY flag on the fts3_tokenizer() function of FTS3,
thus preventing that function from being called from within a trigger or
view.

FossilOrigin-Name: f3171dc22e4d3a40ca17fe609391d92fc6a997b775bfefa5947aec69c889aa73
2019-12-31 18:12:36 +00:00
dan
9d41af23a4 Do not use HIDDEN columns for NATURAL joins. Fix for [7c0e06b16].
FossilOrigin-Name: ab09ef427181130be09a087b7e572ad4cfb6b3e1b459769ee5ebf046b3ead682
2019-12-30 14:32:27 +00:00
drh
8d7f44c03a Fix buffer underflows in the zipfile extension associated with zero-length
or NULL filename in the ZIP archive.  But report on the mailing list by
Yongheng and Rui.

FossilOrigin-Name: 465a15c5c2077011befa854a77f9d295bb751ef20b7d2937ac0ba47cc84587c9
2019-12-27 00:19:53 +00:00
dan
e752040c09 Fix an assert() in fts5 that could fail if an xSavepoint() call on another vtab fails.
FossilOrigin-Name: a5d7f5d24a239f729de0b8aa5becf5af35ba87160565ee0713c335b8d1bbf12d
2019-12-26 14:36:31 +00:00
dan
4fcce747e2 Fix a problem causing fts5 integrity-check failures if numeric values are inserted into a table within a utf-16 database. Fix for [752fdbf6].
FossilOrigin-Name: bae060f382e4386c0793db4aa280fe9cd4893307d17a1801a17218ae4dc031c2
2019-12-24 20:51:01 +00:00
drh
a194d3152c Make the zipfile() extension function more robust against zero-length filenames.
FossilOrigin-Name: b9c2005f0291d58d7f3bfd4a2286eb6563e9c9433519c3329035f325fc723445
2019-12-24 18:53:13 +00:00
dan
3fee9de239 Fix another case where malformed utf-8 was being mishandled in fts5. Fix for [df46a6f3].
FossilOrigin-Name: 1c0a05b09a97e6e2e9b11c31ed6ec7e6484686614b587ebfd0cfe27d973ba461
2019-12-24 16:20:05 +00:00
dan
84d17bdaa7 Fix an assert() added as part of commit [a11b393dc] that can fail if fts5 database records are corrupt.
FossilOrigin-Name: 4630c1ec013a4c2e54a34c9a64b2c803ac3912450de660497eb34ee21c91f426
2019-12-24 15:35:53 +00:00
dan
c26e78d275 Fix a spurious report of corruption that could be made by the fts5 integrity-check in SQLITE_DEBUG builds if the fts5 index contains malformed utf text.
FossilOrigin-Name: a11b393dc2c882cf0b3c47c3405bf43ca1d6459605bd39cccce4d32da653a72d
2019-12-24 14:27:03 +00:00
drh
d8f2d46cbc Fix the zipfile() function in the zipfile extension so that it is able to
deal with goofy filenames that contain embedded zeros.

FossilOrigin-Name: cc0fb00a128fd0773db5ff7891f7aa577a3671d570166d2cbb30df922344adcf
2019-12-23 21:04:33 +00:00
drh
5f0dfc00de Thoroughly reset the rtree cursor at the start of each VFilter operation,
including clearing its cache.  This prevents left over pages in the cache
which can cause problems on shutdown after a LEFT JOIN.
Ticket [5eadca17c4dde90c]

FossilOrigin-Name: 4c50afafce8416369f89477ba7fe7d9b047399a5ee5754c73d0e67bbea8d877c
2019-12-23 20:41:39 +00:00
drh
192cf36de6 Remove an extra deflateInit2() call accidently left in
check-in [f5ee30426e8876e7]

FossilOrigin-Name: 953e6aa6d9ca09e549c88bc728c322fabdcef581f3b4a7763d95488dddbbd6a5
2019-12-23 20:07:28 +00:00
dan
7a1d7c3968 Fix "PRAGMA data_version" so that it works the same way with locking_mode=PERSIST and journal_mode=PERSIST configured. Fix for 7a458c2a5f.
FossilOrigin-Name: 45748e2db028ffbda5d3e747493721a5a89af3fbc06823081a2f27f570e40e73
2019-12-22 14:29:55 +00:00
dan
e88af0179e Fix a spurious report of corruption from the fts3/4 integrity-check triggered by using the languageid option.
FossilOrigin-Name: 70815e273f511481c310dc33b3b49079901d891078fad49b663fbce06c77ecc2
2019-12-21 20:43:34 +00:00
dan
879f1a1ea6 Fix a bad interaction between RBU and [df51ae19].
FossilOrigin-Name: 0b9d8a1202c4220fd2ef299b6194533c1bf4018a0cd2d13da7e22c1a7de05ffa
2019-12-20 20:03:21 +00:00
dan
42ae633ab9 Fix two more cases in fts5 where sqlite3_value_bytes() was being called before sqlite3_value_text(). Fix for e431c355.
FossilOrigin-Name: a1ba9a37d7a68a6d31f8197c6350589ebe6a12f4e3c193a178dd7ead8bcd565a
2019-12-20 19:41:01 +00:00
drh
b2ab3dcff0 Fix harmless compiler warnings.
FossilOrigin-Name: 2bbd014c900e0d71fd30ec647739b82c5dc3aa237a0203f5a1db50593dae199e
2019-12-20 14:08:34 +00:00
dan
73b21382d4 Ensure fts5 consistently calls sqlite3_value_text() before sqlite3_value_bytes(). This matters when storing blobs in fts5 tables within utf-16 databases. Fix for [cf36cb4e02].
FossilOrigin-Name: c16305eba0eb14368f2631b9a82b7eb4483c93f3b31257ee7c33f9b00c344379
2019-12-20 13:24:11 +00:00
drh
6ad0e25fa4 Fix the regexp extension so that it correctly translates all over-length
3-byte UTF8 sequences into 0xfffd.

FossilOrigin-Name: 3d4c0bf8904135fa68c75801bfa738715cacc3b19dc8ad6ef550b11798d4b121
2019-12-19 21:11:48 +00:00
drh
54d501092d Fix the zipfile extension so that INSERT works even if the pathname of
the file being inserted is a NULL.  Bug discovered by the
Yongheng and Rui fuzzer.

FossilOrigin-Name: a80f84b511231204658304226de3e075a55afc2e3f39ac063716f7a57f585c06
2019-12-19 15:15:40 +00:00
dan
5be1b20aec Fix problems in fts3 with processing corrupt records and undefined integer overflows.
FossilOrigin-Name: 3b873029ef1903f76442445343af3786cd59ee66b0e5e0e6b76a0b6b1b5eb88a
2019-12-14 14:15:21 +00:00
dan
db5ed35609 Avoid a buffer overread in fts5 that could occur when parsing corrupt configuration records.
FossilOrigin-Name: 355afd77df21a2265871ca6d075f26b1fa121c7c2682cf512281944ff0c2186d
2019-12-10 03:40:11 +00:00
dan
c19e22f397 Fix possible null pointer dereferences in the fts5_expr() scalar function.
FossilOrigin-Name: c5d44143599f3fe98492b2b900fa3d77925c7be545096251055ceeab899a41f1
2019-12-09 02:20:37 +00:00
drh
c7a046e282 Ignore type affinity for auxiliary columns in RTREE as it is too error-prone
to try to parse out the type from other constraints.
Ticket [8bf76328ac940d52]

FossilOrigin-Name: 7fa664ea0ea1e0283a9af50c9ff8dd360ee6042f9e491a136f53d9bcbbc9c7ef
2019-12-07 12:13:54 +00:00
drh
5102cf8df5 Early detection and reporting of too few columns in an rtree CREATE VIRTUAL
TABLE statement.

FossilOrigin-Name: ef73107f475e40e6bdd8b722e96992070f81fd2b7a3cb718ec8f251c89ca3e81
2019-12-06 19:07:44 +00:00
drh
0a64ddbe76 In the rtree extension, actively suppress extra tokens on the column names,
and be pedantic about column affinities.  Ticket [367a86e28859f1ff]

FossilOrigin-Name: 97fb5a72f91a44d579466e67c33aa862384c4d1c95c2010cf4ae9dbd172bbcfb
2019-12-06 13:10:29 +00:00
drh
e5748a5502 Further enhancements to RTREE, following up to check-in [f898d04cf272ef01]
so that constraints are allowed to be compared to strings that look like
numbers.  Ticket [aa573a787b8f1fdf]

FossilOrigin-Name: 32772dfd50b602c049d8c30bc28cde60a18b7495a997d728081f689ff417c956
2019-12-06 01:38:24 +00:00
drh
b6c947251b Fix to the rowvalue logic that avoids disabling rowvalue inequality
contraints on a virtual table when the virtual table sets the omit flag.
The logic has been incorrect since row-values were added.  However, this
does not come up often as very few virtual tables implement inequality
constraints using the omit flag.  Ticket [f096d191b6641daa]

FossilOrigin-Name: b7810062ec2489e1c5ca6638dbeb0892e4ce376c5c1834a31d1a332ebab8a871
2019-12-05 21:46:23 +00:00
drh
cb224ab139 Make sure the rowid of an RTREE virtual table has integer affinity.
Ticket [9fe487ba3c064b4e]

FossilOrigin-Name: 7ae8c0d52f6aa7f27537216f85456ef49dade040366cfb250c789206ecd4dc5a
2019-12-05 14:42:26 +00:00
drh
348d7f64f2 Be strict about type enforcement on rowid look-ups in the RTREE extension.
Ticket [30e2c183b6b356e4]

FossilOrigin-Name: d43e0efb9642037dd751cfed13438e71cfceb50e14a0ec603880c6c3be2e93b1
2019-12-05 13:34:13 +00:00
drh
674a9b3425 Enhance the RTREE extension so that it give correct query results even if
the query uses non-numeric constraints.  Ticket [a55ab6d97d01ecbc]

FossilOrigin-Name: f898d04cf272ef0130dcae146cb86d8630b10a6f19aecfc2fa70e97e082bd51c
2019-12-05 00:44:47 +00:00
dan
8aa706e748 Fix a buffer overread that could occur in fts3 with corrupt %_stat records.
FossilOrigin-Name: e01fdbf9f700e1bd9dd5283c65547d10d26ce4f4506d3cfef9e1087aecdc2305
2019-12-04 03:46:50 +00:00
drh
d79967adbe Avoid a harmless zero offset of a null pointer in FTS3, so as to not provoke
unnecessary warnings from run-time checkers.

FossilOrigin-Name: 85d95abec4a596eb3ffd2ea19b4067dc1a6970264222ed5d69e75764ac21597c
2019-12-03 03:31:11 +00:00
drh
2bbcaee833 Fix various documentation typos suggested by Mark Benningfield.
No changes to code.

FossilOrigin-Name: 08f09dc4f986a27f4e4e69f8226dbfaf0cfe1269cefc2830bf0fbef7b9bbda48
2019-11-26 14:24:12 +00:00
drh
51690f26bc Fix to check-in [5d9a369301a65f32] so that it compiles without SQLITE_DEBUG.
FossilOrigin-Name: fefe2d046725254367f9f82a8c8cb137e8b75dbbf4bc48debf0649479ff2f0c2
2019-11-26 11:10:59 +00:00
dan
597f1eb195 Fix an assert() in fts3 that could fail due to corrupt database records.
FossilOrigin-Name: 5d9a369301a65f320a0696fcf1f062ca5976ef34350590c07aecf5335c66d872
2019-11-26 02:03:16 +00:00
drh
0f31327eee Enhance the path arguments in JSON functions to access "#-N" array indexes.
FossilOrigin-Name: ffeec62cb5223ae70bc1889df4c0b241f5d17b1a10156362ca59953028741480
2019-11-23 08:51:21 +00:00
dan
7e88d6364c Fix a memory leak in fts5 error handling code.
FossilOrigin-Name: de6637e15d95b7aee2caea8b8d5b9865f276cbbf152ecf0401c4c7bfdf6dee6f
2019-11-23 08:36:35 +00:00
drh
5281864f0c Extend the json-path mechanism with array indexes of the form "#" or "#-n" for
some positive number "n", to reference the end of an array.

FossilOrigin-Name: 35ed68a651f4cf8740597433b0f1c3b345841868022e0904e9f342840ba0e502
2019-11-22 17:37:56 +00:00
dan
6637332988 Prevent direct and indirect recursive content= options in fts3/4 and fts5.
FossilOrigin-Name: 2eb997327c2c369c10b7835be80112d77cb2a7cfa9fe4d564042984c21d94698
2019-11-21 14:20:59 +00:00
dan
70d1a1a3ed Further improve detection of corrupt records in fts3.
FossilOrigin-Name: a0f6d526baecd061a5e2bec5eb698fb5dfb10122ac79c853d7b3f4a48bc9f49b
2019-11-20 13:31:52 +00:00
drh
594b124f21 Changes to extensions and test logic so that the build works with gcc
and with -std=iso9899:1999

FossilOrigin-Name: 2575a68c3965e72f2ab211d933012442755afe6a9b7de9e9e50cdd2155fd1ec8
2019-11-20 12:07:40 +00:00
drh
804725a6b9 Improvements to detection of corruption in the %_stat shadow table of FTS4.
FossilOrigin-Name: 6b67eba54e7b4887a8cdab7537b12a95e9f17bcdaa0b423af5ed5bd91f69f2c6
2019-11-18 14:04:21 +00:00
drh
13a8f203d9 Further improvements to shadow table corruption detection in FTS3.
FossilOrigin-Name: e35d8c76aae59f57cc5193f79b21b4298029bea78e1aab7af67432162ce63e00
2019-11-18 12:04:17 +00:00
drh
3e72bdb5fe Detect and prevent infinite recursion in fts3SelectLeaf() due to a
malformed FTS3 btree.

FossilOrigin-Name: dfcf081d842629a0b177be7eb2eb8ce719324068991040a581e33ea1d5db3d27
2019-11-18 11:14:59 +00:00
drh
19d4175d65 Improved detection of corruption in the %_stat table of FTS4.
Chromium ticket 1025467.

FossilOrigin-Name: 10f8a3b718e0f47be528fba086c318e1dfe18ead383d01cfa24dedabad41e0a2
2019-11-18 10:37:57 +00:00
drh
feb5dcf1a6 Better detection of corruption in the %_stat and %_docsize shadow tables
of FTS3.

FossilOrigin-Name: 1e449687881f4d388e54a0e51bcabba41ab10cf7e596ff65e31e88a23c70d497
2019-11-17 02:41:06 +00:00
drh
fd6bf04bba Remove a reachable NEVER() in FTS3.
FossilOrigin-Name: 8bd75bf636f72f32d66c6c38e1918f27daf2f13290f00a001f41d50838bbda47
2019-11-17 00:08:24 +00:00
drh
c72f2fb7fe More improvements to shadow table corruption detection in FTS3.
FossilOrigin-Name: 51525f9c3235967bc00a090e84c70a6400698c897aa4742e817121c725b8c99d
2019-11-16 23:47:40 +00:00
drh
94febb3a77 Improved detection of corrupt shadow tables in FTS3. Enable the debugging
special-inserts for FTS3 for both SQLITE_DEBUG and SQLITE_TEST.

FossilOrigin-Name: 04b2873be5aedeb1c4325cf36c4b5d180f929a641caf1e3829c03778adb29c8e
2019-11-16 21:40:49 +00:00
mistachkin
b88eaf1619 Add header guard to the expert extension.
FossilOrigin-Name: 7e3151855fd4370fb7d4fff20516c2c2d1980134620df924106e6989bc130583
2019-11-13 18:50:36 +00:00
drh
48eb03bd0e Proper surrogate pair decoding added to JSON functions. See the mailing list
bug report and [https://bugs.python.org/issue38749].  More test cases
needed here, but it seems to work so far.

FossilOrigin-Name: 51027f08c0478f1bf9d7545d9e268c772c0a5cd5dda4b03d78f16c7d94f2f50d
2019-11-10 11:09:06 +00:00
dan
b1c479b61d Fix an fts3 assert() that could fail when operating on a database containing corrupt records.
FossilOrigin-Name: 7c52f5478f9ecf5c078208759143ae9de43c1bf191dfcd74acb8bd169d4dc883
2019-11-01 13:37:26 +00:00
drh
20cee7d0bb Always disallow the use of non-deterministic functions in CHECK constraints,
even date/time functions that use the 'now' or similar keywords.  Provide
improved error messages when this requirement is not met.
Ticket [830277d9db6c3ba1]

FossilOrigin-Name: 2978b65ebe25eeabe543b67cb266308cceb20082a4ae71565d6d083d7c08bc9f
2019-10-30 18:50:08 +00:00
dan
9930cfe878 Fix a problem in fts3 causing it to report corruption if a doclist contains consectutive rowid entries that differ by more than 2^63.
FossilOrigin-Name: 0b0a3048f9df88bbc8979f2ac5247bee7d7bc1e585faca252610d2fcbe36d51d
2019-10-28 13:54:59 +00:00
dan
ef2df8f343 In fts5, fix a case of overreading a buffer by 1 byte when counting characters in malformed utf-8. Fix for [dd1f67bf].
FossilOrigin-Name: 8d964e1c21d4cea699023e02b0616a75c5859dd083c9365cdcbc0676ebbdaae4
2019-10-24 20:35:27 +00:00
drh
31269a9f5f Add an experimental set of UUID processing functions as the uuid.c
extension in ext/misc/uuid.c.

FossilOrigin-Name: 1a6e009372cf9571e540812c8607e95a86740112a1091f03e3f632339eccb629
2019-10-23 21:00:40 +00:00
dan
52612bec3c Fix a resource leak in fts5 that could occur if an auxiliary function is called from within a query that does not use the full-text index.
FossilOrigin-Name: b528bdcd45db1b783ecd9739c3d3c890f04de7003f079668970eafaf8e23b2f3
2019-10-20 08:26:08 +00:00
dan
b2075011a7 Avoid an infinite loop in fts3/4 incremental-merge in the case where the lowest level in the database contains segments but no data (because there is a delete-marker for each valid entry). Fix for [bf1aab89].
FossilOrigin-Name: 35beaee059a6cccead4311886ca928d936f23584cf435e35e265e98feea723dc
2019-10-17 15:41:36 +00:00
dan
2d82269ca8 Fix a problem with row-value IN(...) operators and virtual tables.
FossilOrigin-Name: aa57d7abac0bb92d4d5fd4e093a11cf8efc04e4eed748b2a400d01f137250649
2019-10-14 15:15:50 +00:00
dan
d681626a8b Update the zipfile extension to use deflateBound(), instead of compressBound(), to learn the maximum possible size of a deflate()d buffer.
FossilOrigin-Name: f5ee30426e8876e70304f852153b56991a2a66e0f6a82597e9dcccf49163272d
2019-10-11 18:55:10 +00:00
dan
8b4d0e2cba Ensure fts3/4 prefix indexes are flushed to disk before an 'optimize' command. Fix for [745f1abc].
FossilOrigin-Name: 4ed905b18847d4dbf5a2570052abced338065f824137b90300f62d77b3159d80
2019-10-11 15:33:13 +00:00
dan
9613c9f4a6 Fix the fts3/4 integrity-check command so that it works with "ORDER=DESC" tables. Fix for [8a6fa2bb].
FossilOrigin-Name: 5863546df99abd1ad4ebcaba18dec647be4368e2c13ce0b28e48c8608d3e87ef
2019-10-11 14:27:17 +00:00
dan
cd79010964 Fix a problem in the fts3 integrity-check routine causing it to report as corrupt tables that contain values with embedded 0x00 bytes.
FossilOrigin-Name: 629e20c9880acc2cb9e2fa6da39a15a90483e9a8f433df29d285c23bdfb03b0b
2019-10-10 16:41:44 +00:00
dan
ae55737fbf Do not allow users to effectively disable fts5 crisismerge operations by setting the crisismerge threshold to higher than the maximum allowable segment b-trees on a single level. Fix for [d392017c].
FossilOrigin-Name: 86e497209217abb7bcb491a023cd353f3c7c9c103ebd9f58dd8661b12cf3694c
2019-10-09 18:36:32 +00:00
dan
a6bd1871d1 Disallow fts5 page sizes greater than 65536 bytes - as there are 16-bit offsets used in the page header.
FossilOrigin-Name: 75775c5ab44e497cb19be10397229637f1374f05c3244e8f92d6c54fcea94f5f
2019-10-09 15:26:45 +00:00
dan
fbd79cc585 Fix problems with using the fts5 'rebuild' command inside a transaction that contains other updates of the same table. Fix for [e258f008].
FossilOrigin-Name: 238e0835714696aba0631f288fcc30ec5fddb43893d469c6bf017f386b3cddee
2019-10-08 13:34:24 +00:00
dan
b186a622ee Disallow page-sizes smaller than 32 bytes in fts5. Also ensure the fts5 integrity-check works even when "PRAGMA reverse_unordered_selects" is true. Fix for [265e935b26].
FossilOrigin-Name: 8ab0aebdb3c2d6fb3160b2c58ce6cc0495a6ddd960878a6395958c837f3d1b71
2019-10-07 20:36:18 +00:00
dan
03e025e217 Fix a problem with running ALTER TABLE ADD COLUMN statements within a transaction that writes to one or more virtual tables.
FossilOrigin-Name: 31e85fbbc4cfd09a98b4a6dc6624f863816f376c6a4eef1fafc657c8e1abbc36
2019-10-07 18:43:21 +00:00
dan
23d3f5d661 Fix a long-standing problem in fts4 incrmental merge.
FossilOrigin-Name: 67da31e24ebb49c4cac81c9e7cfca37ca422555fd0fdb01d8f180890783c84ff
2019-10-02 19:33:34 +00:00
drh
5e81e9fdae The nodeReaderInit() function in FTS3 may not assume that the node is
non-empty.

FossilOrigin-Name: 361eb2f682a303bba72b39d322d9de630494ca044fe0508dcb23b6130d312d85
2019-09-30 19:13:31 +00:00
drh
5c0666d9e3 In FTS3/4, the poslist end marker must be larger than any other possible
poslist value, even on a corrupt poslist.

FossilOrigin-Name: 752679aea5a6bbde24cbf39e2fa018f7dd1c226d463ca4bd74125303b2255170
2019-09-28 11:19:56 +00:00
drh
e39f388eb1 Fix harmless compiler warnings.
FossilOrigin-Name: 8ea1dc727d391b15d0c4fa858ff68d5b8a63dde46408f24027dac8d28f044cbd
2019-09-21 17:31:03 +00:00
dan
14e3e22773 Fix an assert() in fts3 that could fail when accessing a corrupt database.
FossilOrigin-Name: 601ce9532d34f97a5faa170b6d8a272e5c54f2eabff84660201a1840e0fd9929
2019-09-19 13:51:52 +00:00
dan
572b0dddee Add extra tests for the handling of corrupt records in fts3.
FossilOrigin-Name: 40e29a47d1266c16a4992e43579a51addcc632503099c4cd128f77dd4e67da3c
2019-09-18 17:22:00 +00:00
dan
4b48c72721 Fix a "jump depends on unititialized value" valgrind error in fts5 triggered by corrupt database records.
FossilOrigin-Name: 6b6751cd90601a1e2744a7d233c973291ecb783801b9327c3b99734dd22bcd27
2019-09-18 11:46:34 +00:00
drh
fab5b07395 Fix the windows inverse function on the JSON aggregates.
FossilOrigin-Name: f464d847af490dd3ec45565dcc4c2e6ff4ed1ebb65036f30ca0b3ce2e73080e6
2019-09-14 00:21:34 +00:00
dan
cd9cb85a41 Add the SQLITE_SUBTYPE flag, which may be passed to sqlite3_create_window_function() to indicate that the window function uses sqlite3_value_subtype() to check the sub-type of its arguments.
FossilOrigin-Name: ba2ebc3a348decc5cedaf14960e30e7ae26a26824cfa198727f2499162142ef3
2019-09-13 18:27:17 +00:00
drh
477f1f12e2 Fix a typo in the carray extension header comment - the comment that serves
as the documentation to this extension.

FossilOrigin-Name: 658a42d3633b31fda260f2c5a1a2c7dd8eb4eb0114d322369017c56faf5ecd42
2019-09-13 17:30:24 +00:00
dan
01a3b6b1b2 Change the meaning of the SQLITE_SUBTYPE flag so that it indicates that the user-defined function cares about the subtypes of its arguments.
FossilOrigin-Name: af1bc20f502816db460d2b2d353f715da5cf660e59095de5214c829c1cb20981
2019-09-13 17:05:48 +00:00
dan
945a3527d5 Merge latest trunk changes with this branch.
FossilOrigin-Name: 14ef7543465dd14d8fa141fcceb1950b5c2d265a3e862323969d747b39c0cd8c
2019-09-13 16:19:53 +00:00
drh
3f3f2c7357 Ensure that the idxStr for FTS5 is always zero-terminated.
Fix for check-in [e6db945454a0dae2]

FossilOrigin-Name: 090cd07d37904da4610d6a6787a3cc825c9a8bdcc5f051267d4608bba9b49d03
2019-09-13 13:23:13 +00:00
drh
fbb9a5b1e3 Fix harmless compiler warnings.
FossilOrigin-Name: a8927d14f88c44828e794787bab080455ab62705c93f65ce7d8db83478aa5a8e
2019-09-13 12:24:58 +00:00
dan
685b2ee0c3 Allow fts5 to filter on multiple MATCH clauses in a single scan.
FossilOrigin-Name: 9d418a7a491761eeb38a70898677a493e2631e5d62e75ee88431f52d3dfd2344
2019-09-12 19:38:40 +00:00
dan
e2ba6df9f0 Add the SQLITE_SUBTYPE flag, which can be passed to sqlite3_create_function() and similar to indicate to the core that a user function is likely to use sqlite3_result_subtype().
FossilOrigin-Name: 6aa438ce41d460a6782ae63503128b9140c28ff59c2b2eed48b004acf83e0560
2019-09-07 18:20:43 +00:00
dan
229ae1ae72 Fix a potential crash in fts5 caused by using an auxiliary function on a "special" query like '*id' or '*reads'.
FossilOrigin-Name: 9490683ae883561fa347cbe54ebdd61188d849b4852d904b508250ba5d0807ef
2019-09-02 14:46:12 +00:00
dan
50b3ea2daf Fix a potential buffer overrun in fts5 caused by corrupted database records.
FossilOrigin-Name: c465d0eb478e42045e08efe8b6fa64d4bd4d747cdf743beae4608562b014169e
2019-08-29 14:25:44 +00:00
drh
512e46a74c Merge in recent fixes from trunk.
FossilOrigin-Name: ad816d01d4bd3908ff2c574d79d1a29b6d732df308f2f1b1cdf7c0bc7c1bd7cf
2019-08-26 20:41:33 +00:00
dan
298680d15a Fix a potential buffer overrun in fts5 caused by corrupt database records.
FossilOrigin-Name: 156d612800a7282fe0ebb20feb31d3fd577f4ab60fab8c00940c87143997aefb
2019-08-24 17:11:29 +00:00
dan
37874d7dcc Disable broken test case in expert1.test.
FossilOrigin-Name: 73e30c2e92ccab274ff7cee48511c461de148786bb9d338921c1ecb193822282
2019-08-21 17:46:34 +00:00
dan
6fcb9f3ad9 Fix a broken assert() in the fts3 snippet code that was failing for queries containging more than 64 phrases.
FossilOrigin-Name: 4c01e0170e113ad052b6c3980beb4be9f1dc03fb3cf34132b90e8b82b23f654e
2019-08-21 11:31:48 +00:00
dan
35fb866ea3 Fix a problem with fts5 "ORDER BY rank" queries when the fts5 table name requires quoting.
FossilOrigin-Name: 00e9a8f2730eb7239bf7fd107c97c409e4f9fbd968510766373440a9079898eb
2019-08-20 19:11:29 +00:00
dan
dac7e69dc2 Add some extra tests for the lsm virtual table module.
FossilOrigin-Name: 4cb009b0f724f72eaea90e45488122f7c2a7d0caf31a8422da4060469507e921
2019-08-17 19:58:26 +00:00
drh
5976b2c805 Fix to the query planner for the LSM1 extension.
FossilOrigin-Name: 7496e872a1a50ac65ad04709365a43038fb015ac9c690196de3cb02ce54c2e57
2019-08-17 19:55:26 +00:00
mistachkin
87ae34ba1a Add some static to the 'regexp' extension.
FossilOrigin-Name: a21d1dde73f811244b5b43f9fed5877263a9c5061470221f417e501f5530edfa
2019-08-13 20:34:35 +00:00
dan
3c1970fcee Update some corruption test cases to take [724f4df9c] into account.
FossilOrigin-Name: 927cd7b4c52fae665e57fb6039c6829e339cff5ad5c405800cac3ee149ef5be1
2019-08-13 17:27:43 +00:00
dan
b8a8d523cb Fix a problem with RBU function sqlite3rbu_bp_progress() when used during an RBU vacuum.
FossilOrigin-Name: 8c44b02f1479cec61554800702a3c1d806e4ee64b41ba2af17320f62794a02fe
2019-08-13 15:11:25 +00:00
drh
3728b84c03 Fix more compiler warnings.
FossilOrigin-Name: 1b85442b614df0808c10c34ec281282e5dfd93d6d5f9737b51263ffaa4da5c72
2019-08-09 01:11:32 +00:00
dan
3cbbd195ca Prevent an fts5 table from being its own content table, or part of a view that is the content table.
FossilOrigin-Name: b6d52c9364767ff4ab7279ae981afb97799299dcfaf38a0110c40ca82c72a825
2019-08-05 12:55:56 +00:00
drh
7e35e81dcb Do not allow the json_set() function to overwrite the same element more than
once.

FossilOrigin-Name: f237f60e4fa9171dfe9a77c8637595c2701e971034d41bd6018944e8b2b27a6f
2019-07-31 12:13:58 +00:00
drh
8fbcb04811 Convert an assert() in R-Tree into a database corruption detection case.
FossilOrigin-Name: 48b518eb6f76fb0beb161d1ebcf3b793efc36262d6d77a1ad5906b6501138e28
2019-07-29 17:18:45 +00:00
dan
8279fe8a4b Fix a crash in fts3 caused by corrupt database records.
FossilOrigin-Name: 11f7f94f1c5d761e7f381e277658b7e857cc369283996c509061de55fd6aad52
2019-07-29 16:53:30 +00:00
mistachkin
ac713403fd Fix harmless compiler warning seen with MSVC for x64.
FossilOrigin-Name: 857b2ba6d05d6f5a8cfdf269bae9005b25e1903ab9dc6b70546979d8c633f03b
2019-07-29 02:49:14 +00:00
dan
b8293a5bee Update RBU so that it supports indexes on expressions.
FossilOrigin-Name: 6bfa44da226fd758a2ee924d1e8e3a742b0635b6d3f922a4a7919cb14b2418e6
2019-07-26 20:33:23 +00:00
dan
dff1d5b61b Fix RBU handling of partial indexes with comments embedded in their CREATE INDEX statements.
FossilOrigin-Name: e1ccf211aa975a6688a27f7dc4cea80784ed8dcfe1950b2fa6eb0a3cb938838a
2019-07-26 16:16:31 +00:00
dan
bfe33f80dd Fix a potential buffer overread in fts5 triggered by a corrupt database record.
FossilOrigin-Name: 16472112b6886ada18d45cfb409cca2e83dde5a8ba8a36d481e87b61100b0186
2019-07-25 19:29:24 +00:00
dan
1c70f71e12 Avoid redefining types u32 and u16 when fossildelta.c is compiled as part of the amalgamation.
FossilOrigin-Name: d8e88248e3204b5f2b95b9b8921ee7ee2f7574ae81e6abd5b4f2ddf187f7d71b
2019-07-23 13:26:43 +00:00
drh
7fc296aa66 Early detection of a corrupt R-Tree in the R-Tree search algorithm.
FossilOrigin-Name: 2bf5a4c16457562dc942bcc6ec06d9b4e795ef3ea8e31550e18857bbebd08a76
2019-07-20 18:00:46 +00:00
drh
bcb0e64c82 Performance optimizations in the rtreeStepToLeaf() routine of RTree.
FossilOrigin-Name: 4e34e3615ff31f4a6432033797b2e1a6604007ea0e501d714ecb362632776150
2019-07-20 17:43:28 +00:00
dan
f446a7a8cd Update rtree.c so that SQLITE_DEBUG is required to turn on assert() statements, even if it is compiled separately from the amalgamation.
FossilOrigin-Name: b6e17f0139482a22c2fc84552767bc9a293b282499e3a790de069e0e84455fb2
2019-07-09 17:36:26 +00:00
dan
7d840e530f Fix a valgrind problem in fts3corrupt4.test.
FossilOrigin-Name: cb3dec427e399064eeec31c15565346f045bd7c46d2f7860b1cd346bbcccb124
2019-07-05 15:16:22 +00:00
dan
fe9a832e80 Fix a problem with handling with handling quoted path elements in extension functions json_set() and json_insert() reported on the mailing list.
FossilOrigin-Name: 45bfcb88e71451a656982e217375e257fc8e68374349c2984be1266bf86fb8cf
2019-06-17 14:50:33 +00:00
dan
471e88f732 Fix a segfault in fts3 that could occur when processing corrupt fts records.
FossilOrigin-Name: dff24c6c7a4e7623984b5bb24c2ff14fe079dc49a0ad048cbfc66f84c08875b0
2019-06-04 13:11:37 +00:00
dan
efdb371a1d Fix an assert() in fts3 that could fail when processing corrupt records. Also some minor sanitizer warnings.
FossilOrigin-Name: c736c40aab071a69bd5c5347b7c116d87ea3954019e967ca8ff7bdb4b518e5bf
2019-05-28 14:42:32 +00:00
drh
0a0e89fa21 Fix an error message on the blobread() extension function so that it says
"read" instead of "write".

FossilOrigin-Name: 7cbb9a5fe835d01be158edd1e2f9d553dc257f2d27b53a5d5bf6660d0bd101c4
2019-05-27 11:21:43 +00:00
drh
3517cc7f36 Fix a memory leak in the delta_parse() table-valued function of the
fossildelta.c extension.

FossilOrigin-Name: c86ca3f0220a5f9e7f7f1818f6e1220d851f3ebed6a5f0aae6ac38309bd2930e
2019-05-27 11:09:55 +00:00
dan
98d63579be Fix an fts5 segfault that could occur after parsing a corrupt structure record.
FossilOrigin-Name: 600daa9c27206628bf74892376ded35dac11fe0a34894fcd975ad5041a0a0fda
2019-05-24 11:55:01 +00:00
dan
29fa6b6642 Fix a buffer overread that could in fts3 when dealing with corrupt records.
FossilOrigin-Name: 1660d7733eb443ab085ddef7666b998a1c75ac81cc54a9620960a8d3b377e28e
2019-05-22 14:22:44 +00:00
dan
595d9f5f3c Fix a segfault that could occur in sqlite3session_diff() if NULL were passed as the pzErrMsg argument.
FossilOrigin-Name: aee73fd28f031a2568ac723de0826be7f1dca6be3b049e4a04fb47af75dcf4bf
2019-05-20 19:46:30 +00:00
dan
36c9301816 Add new test file fts5corrupt4.test.
FossilOrigin-Name: 5dfc4fe98a4821cbdbfd7dfddf221b00251b2a26bf58767a3956b64e9a4e92da
2019-05-16 16:44:47 +00:00
mistachkin
3196abb7cb Fix harmless compiler warning in the session extension.
FossilOrigin-Name: dff823ca8b5ca4a5611407b0231f89b2e8c981f50e85e361e76d3e4973cea8ca
2019-05-16 03:47:38 +00:00
dan
2a71b17f2f Fix a problem with corrupt db handling in the fts5_vocab module.
FossilOrigin-Name: 456ced57774a92acff23cad975b78ff0e5cbbf5204ea48599fe1761a018a92e4
2019-05-14 18:33:58 +00:00
dan
c12655df87 Fix an assert() and potential buffer overrun in fts5 that could occur if the database was corrupt.
FossilOrigin-Name: 8be8bd0d562e571b73a93f4ed18258ebd114bbab67ee3cdcd66a4c8f2987f8dc
2019-05-14 11:33:09 +00:00
dan
d6712f3638 Fix an assert() failure in fts5 that could occur when processing a corrupt database.
FossilOrigin-Name: f158c048be1dc7c80d38787a20495caa55b86416967efd57f4888548d42b4819
2019-05-13 11:52:19 +00:00
dan
90255b8149 Add tests for the RBU module.
FossilOrigin-Name: a194e53670e25a48c2bb51b54755abff88ed6ae2596c5858fb4aac16cb452bdf
2019-05-10 20:44:10 +00:00
dan
5985dcbf5e Fix another small buffer overread in sqlite_dbdata triggered by a corrupt database page.
FossilOrigin-Name: 1dfc95b8673b0e8c9ef5040c2fa0fbe9846e430d104e9b83f3f1f3ad63446380
2019-05-09 18:37:37 +00:00
dan
39e04f83b9 Fix a problem in the ".recover" command allowing a circular loop of b-tree pages in a database file to cause an infinite loop.
FossilOrigin-Name: 8d2a062eb8a3e6fdc6a61b571c8da0070382bf208c53e797151eac8679c975a1
2019-05-09 18:33:32 +00:00
dan
4d2175613f Fix a crash in the sqlite_dbdata module that could occur if a pointer within an overflow chain in a corrupt database pointed past the end of the db.
FossilOrigin-Name: 3eae4e301e3e4bcf14e96066f77be1434c5d4b3daadb10153cd36382589ac128
2019-05-09 17:54:27 +00:00