Commit Graph

600 Commits

Author SHA1 Message Date
mistachkin e50998859d Fix harmless compiler warning seen with MSVC.
FossilOrigin-Name: 648172de20d70532ed0fb9713b76161dd481e09bbd973c03dffb51fb61b731cc
2022-07-21 18:37:50 +00:00
drh 449b473ee6 Enhance the REGEXP extension so that it will accept the start-of-input
mark ("^") in the middle of parentheses.
[forum:/forumpost/0d6a9160f81ef1a8|Forum post 0d6a9160f81ef1a8].

FossilOrigin-Name: ed8a8ebd62a319b5dabbdf67ee27141153b9899d7c8f08eeb4bdf35271015c71
2022-07-18 13:55:21 +00:00
drh 18934137dd Fix a problem in the REGEXP extension for the {M,N} construct where M is zero.
See [forum:/forumpost/8694e55a2c29963c|forum post 8694e55a2c29963c] for more
information.

FossilOrigin-Name: af15bb75306a4b94593b8431a34768b3de3d6689293e85ca02db16bf3e9f39e2
2022-07-18 13:10:53 +00:00
drh 67a0bf383f Enhance the ext/misc/regexp.c code so that when it is compiled with
SQLITE_DEBUG, a new function named regexp_bytecode() is available that
prints out the compiled NFA as human-readable text, for debugging purposes.

FossilOrigin-Name: cb5c08978fe8f074e6ae16953575213709e98b8bbae4359e0d2e6de67a7ea9e5
2022-07-18 11:44:16 +00:00
drh 90120b9f4a Use 64-bit memory allocation APIs in the sqlite_stmt virtual table, to avoid
harmless compiler warnings.

FossilOrigin-Name: afb9e60ee3b194f33664a6722356e5d3c69ce1d4da1a0affd92b8e6aaf4dd2da
2022-07-11 19:47:57 +00:00
drh d5c2e08449 In the sqlite_stmt extension, store the result of strlen() in a 64-bit
integer to avoid a compiler warning, even though we know that the length
will always fit comfortably in 32 bits.

FossilOrigin-Name: 3fe19452499afc8e6b38905e1ce7e9153adbfebf10dccf39da4b7f1b0cd24f05
2022-07-11 19:12:47 +00:00
dan e7ebe0aa81 Avoid ignoring the last line of a csv file if the final field is empty and
there is no trailing CFLS. Also have the csv extension treat the last line of a
file in the same way as any other line if it is short fields.

FossilOrigin-Name: 587795d47fcaf5142526fabbcc4d5a632f561f258414c2846e8932a49b5b2e6b
2022-07-06 15:44:57 +00:00
dan c578e4f0eb Fix a problem in the csv extension that was triggered when the very first field in the csv file is zero bytes in size.
FossilOrigin-Name: b12ddabf07b5e06bcee8dda3f990af3a131ab52b8fa969ba061b26d38458f31d
2022-07-05 17:49:04 +00:00
drh 0e4ab0db7e Enhance the REGEXP extension so that the end-of-input indicate ("$") is
allowed to occur on one branch of an OR ("|").
[forum:/forumpost/0107d5d40dd273e2|Forum post 0107d5d40dd273e2], second
issue.

FossilOrigin-Name: 3c04d21e6c632feb3bea8d1fa76bedcbfe254b0dc59865633d158a3f1bddefba
2022-07-03 18:12:43 +00:00
drh f28727f61e Fix the initial-prefix optimization for the REGEXP extension such that it
works even if the prefix contains characters that require a 3-byte UTF8
encoding.  This should fix the problem reported by
[forum:/forumpost/96692f8ba5|forum post 96692f8ba5].

FossilOrigin-Name: c94595a6e15490b432f099fefbe2429fa19287f7bdc86332cba0fd1e08f65bd6
2022-07-03 14:25:47 +00:00
dan e26f592ea5 Have the sqlite_stmt table buffer all data for the current scan within the xFilter method.
FossilOrigin-Name: 84a91c255e3d77728820561f16bdd9a87b7ff42b5430a9e13f404dfc3365c716
2022-06-29 15:16:48 +00:00
drh d5c35f6d69 Fix the zipfile extension so that it knows that a zero-length BLOB returns
a NULL pointer.
[forum:/forumpost/ae86934905|Forum post ae86934905].

FossilOrigin-Name: 5f6d56737caefa78e542a7af2f95646e3a818e0ecdd8e838f3c2978500ce960c
2022-03-19 12:48:14 +00:00
drh e684ac6f12 Fix compiler warnings.
FossilOrigin-Name: 5e30c6ea707f9d381127e8b2bb59e0b39bc00997da2c14d32a0e302d0121203b
2022-03-08 13:59:46 +00:00
drh d1f0a86c12 Fix unimportant typos in comment text.
FossilOrigin-Name: 393460132994d6ca133e52af57374e43a2795a9e7fc7781bd9dea752a2b52c6a
2022-02-25 11:30:29 +00:00
drh a12500005f Remove stray tab characters from auxiliary source code files.
FossilOrigin-Name: e25e33582b69289a2c3a6bc403e3911de22a3b529db1a565efb9f1af01b9e382
2022-02-21 13:44:51 +00:00
drh 8f2c0b59da Query planner always honors the aConstraintUsage[].omit flag for the
SQLITE_INDEX_CONSTRAINT_OFFSET constraint.

FossilOrigin-Name: 38c5151eb8cc789ad082a1b40d16b2ddb55454219bd685b6e420995af6a15f55
2022-01-27 21:18:14 +00:00
drh 895bab3383 Give the virtual table xBestIndex method access to (some) OFFSET and LIMIT
clauses.

FossilOrigin-Name: 74fa5757ee0a8499bcd6546dac1a3ecc6048ba9cff9e3e574e28e6e82e894a3d
2022-01-27 16:14:50 +00:00
drh ec778d2724 An initial attempt to implement sqlite3_vtab_distinct().
FossilOrigin-Name: d571262d2345bb11e71bef395cf078e5d7303b974b38b4e319adda6194ccc1c5
2022-01-22 00:18:01 +00:00
drh 991d1085e3 Add requirements marks and tuning.
FossilOrigin-Name: ac951490fd7d5864fe422a80ee8557478e823e79461bec2ee538f57b6733eb5a
2022-01-21 00:38:49 +00:00
drh bd3a247c73 Test cases for sqlite3_vtab_rhs_value() based on the qpvtab extension.
FossilOrigin-Name: 577d3d66558368c34acab8a9e552957cf3fa054c348f1383a9121de6e8b281b7
2022-01-20 19:00:48 +00:00
drh fdb6f44fac Enhancements to the qpvtab virtual table to make it more useful for testing
and verification of virtual table interfaces.

FossilOrigin-Name: 850efc4cf3d136fba9173c380e9417b43bb93c050f7eeb85d07fd39a4b1cc6aa
2022-01-20 18:27:54 +00:00
drh 82801a5b72 Initial implementation of the sqlite3_vtab_rhs_value() interface and the
qpvtab extension used for testing the virtual table interface.

FossilOrigin-Name: 0873c76b9b96b66fa9d13ddc8bca126d575ea3352349c7fd648f0c2f75d770f5
2022-01-20 17:10:59 +00:00
drh 9dbf96bd70 An attempt to integrate the JSON functions directly into the SQLite core,
rather than holding them as an extension.

FossilOrigin-Name: 583b47d865fb8d2c9ae4d3a4e70356a8a758978efb0a282f6b19775bf41fb748
2022-01-06 01:40:09 +00:00
drh 017e363787 Mark the REGEXP operator in the built-in extension as deterministic.
FossilOrigin-Name: e654b57a9fc32021453eed48d1c1bba65c833fb1aac3946567968c877e4cbd10
2021-12-31 22:53:15 +00:00
drh f3c33c6235 In the json1 extension, which compiling it separately, ensure that either
SQLITE_DEBUG macro or the NDEBUG macro is set prior to including assert.h.
If neither macro is defined, then assert() statement do generate code but
VVA() statements do not, and that is a deadly combination.
[forum:/forumpost/858dee399e|forum post 858dee399e]

FossilOrigin-Name: d9f814a6402ca7fd999bbb847dc354b52ab9b97cae0c932344584d26c9430f24
2021-12-20 23:46:44 +00:00
drh 621a5e0c47 New defenses against OOM and corrupt database problems in the CLI.
FossilOrigin-Name: 5c9fd7fde16d8e335488b8bf5c691961d2636201b034d1f29d25de8708de291d
2021-12-16 17:35:27 +00:00
drh 22f018c938 Minor fix to the ORDER BY elimination logic in generate_series().
FossilOrigin-Name: a2e50712fca9dff1b8d19631f792270c82da3c8696a5d9890cf0d1e13e950d60
2021-12-14 18:11:46 +00:00
dan 4baf43ff64 Add the "static" qualifier to some internal functions in code for various SQLite extensions.
FossilOrigin-Name: 8c986782547211098eb0e4e722eda0097421223af279381373d0055211b5e9d2
2021-12-01 11:03:50 +00:00
drh a2852ac4d2 Fix a faulty JSON assert() added 30 days ago by check-in [7b8ea2298927fd34].
dbsqlfuzz f30366e7b02562398a387ddcc681422fd4251190.

FossilOrigin-Name: 0e0c23fcc493a5d6beb6ab9554981bbc36ba1554fea0f8ba78dc41738f4bd1c2
2021-11-15 01:45:11 +00:00
drh 16fc5e67a0 The VVA() macro in json1.c must be active during SQLITE_COVERAGE_TEST because
it affects the outcome of testcase() macros.

FossilOrigin-Name: 92c3d253797f9bde4670984d60bbd50b7b28540d2b5f503f318843580bab8765
2021-11-01 12:53:01 +00:00
drh 8b554e2a1e Fix an incorrect JSON assert() that was added 5 days ago by check-in [7b8ea2298927fd34].
FossilOrigin-Name: e162da3ab4c183b67872be004035c48fc8f20084bc5757aec27410ce23a36631
2021-10-20 20:22:37 +00:00
drh dec8572d8a Fix a problem with the CARRAY extension when the SQLITE_TRANSIENT destructor
is used for non-text arrays.
[forum:/forumpost/48e525b266|Forum thread 48e525b266].

FossilOrigin-Name: cac910c15f409c5358843643b2f90252eb90328b9e5ff84cedbccb604d9891af
2021-10-20 13:48:12 +00:00
drh 285f2ef4ad Protect the JsonNode.u union using nearby assert()s and branches.
FossilOrigin-Name: 7b8ea2298927fd34f27b3345add3ce751ed728387fe3d9207b601ba6449d5af9
2021-10-15 16:15:04 +00:00
drh 13ca72d011 Fix harmless compiler warnings, mostly caused by prior efforts to get static
analyzers to run without warnings.

FossilOrigin-Name: cddd3b382a118bb16be3a602ae711fe2c2a7d1c673dd30dd3977b67ee555e666
2021-10-05 18:59:05 +00:00
drh 6a726fa175 Fix separate compilation of json1.c, which was apparently broken by
check-in [32f33f356931242b].

FossilOrigin-Name: 0c7ece6792d30bdb314e2a6e61d0c051c3619a2d749f8b1df7dc2b1f521388bf
2021-10-05 15:30:52 +00:00
drh 7d4c94bc0f Fix harmless static-analyzer warnings.
FossilOrigin-Name: 32f33f356931242b59c01b5df7e180941231e3d9c91577ad33aa4a01e9d59092
2021-10-04 22:34:38 +00:00
drh 11a9ad5669 Fix harmless static analyzer warnings in sessions, rtree, fts3 and fts5.
Add the -DSQLITE_OMIT_AUXILIARY_SAFETY_CHECKS compile-time option to cause
ALWAYS() and NEVER() macros to be omitted from the build.

FossilOrigin-Name: 1c67f957fc77e37ce8f0d447c41ca975e8e79a35d332739c24a633649b5b0387
2021-10-04 18:21:14 +00:00
drh aa6fe5bf10 Fix harmless static analyzer warnings.
FossilOrigin-Name: 6604a085964121113e7b7f57537a0ba64ba058d0eb12bf0a3aeb6d1b7a29d516
2021-10-04 13:18:44 +00:00
drh 76fc88fe0f Fix harmless compiler warnings
FossilOrigin-Name: bdb9dc8a025b509960d08cdf0ff784dd075c156860548d7908de7d97e030701c
2021-10-02 16:39:16 +00:00
drh e85e1da07b Fix harmless compiler warnings.
FossilOrigin-Name: 94b59691ee50a4666b25e36d1529fc52f714bbe94c3e8ccb35bf0a4ea11050db
2021-10-01 21:01:07 +00:00
larrybr b3e4423137 Accomplish fileio standalone for Win32 with less intervention.
FossilOrigin-Name: af5dcc9c2a3a45d10b985f6b7ea18d39c75502ed10fa6496aad787dbe8c8c3fb
2021-09-20 21:42:39 +00:00
larrybr 3d99743423 Allow fileio extension to be a stand-alone DLL for Win32
FossilOrigin-Name: d1cc3105b2baceb9f426fd6bc8d8317de3af09a0f02517715bd292c68e282fa1
2021-09-20 20:15:28 +00:00
drh e46ec734c7 Modify the generate_series() table-valued functions so that its first
argument (the START value) is required.  Throw an error if that argument
is not supplied.  In this was the series.c loadable extension can be used
as a demonstration of how to code an xBestIndex function to require certain
parameters.  Compile with -DZERO_ARGUMENT_GENERATE_SERIES to obtain the
legacy behavior.

FossilOrigin-Name: 459d85a2898d6a53f43b4ad48d2f39edd1bbe37a4f97426a5d666c39c52576a4
2021-07-16 17:04:17 +00:00
dan f33e7795b3 Add the usual "#ifdef __cplusplus" magic to header file ext/misc/carray.h. Also update carray.h/carray.c to use SQLITE_API in the usual way.
FossilOrigin-Name: 0f97c2a459bfadc2fe19e710e8845039b4434010656d311074b9594b02d0826a
2021-07-09 11:52:53 +00:00
drh a959bf5311 Add NULL checks on all sqlite3_vfs_find(0) calls. This is not strictly
necessary.  There are no vulnerabilities here.  However, adding these
checks avoids unnecessary static analyzer complaints.
[forum:/forumpost/ce1193be15|Forum post ce1193be15].

FossilOrigin-Name: 272a15b9f418fb0b31a9808f7c42c20cf52318035ff98935d8e8519634357e8d
2021-06-15 15:15:40 +00:00
drh 9a4127a8c1 Remove unnecessary end-of-line whitespace from the regexp.c extension.
FossilOrigin-Name: 17e26a1f5e3cc4e96b9265dcdbf54f376304b0908f3ff0a0d3df33653e77e5b6
2021-06-07 00:54:38 +00:00
drh abc15f1b9a Fix harmless compiler warnings.
FossilOrigin-Name: 83aca2d8704e51eeed5652b1506c6fc883c0397728cda456f229369788b8608a
2021-06-04 16:11:19 +00:00
drh 9718bca77f Fix more cases in the regexp extension where the 0x00 terminator at the end
of the input string is being pattern matched.
[forum/forumpost/9104f0d9e7|Forum post 9104f0d9e7].

FossilOrigin-Name: 569e00d4acd426667990d675ca5da48a1859ac84af2412464ecd29c7c5da828c
2021-06-04 15:56:43 +00:00
drh de30a3d2e1 Fix a bug in the regexp extension in which the "." wildcard would match
the 0x00 terminator at the end of the comparison string.

FossilOrigin-Name: fa23108b299fc70e80540c449500e50ac6344a152f4f6b9c1b1f568bbda8f6e1
2021-06-03 13:44:19 +00:00
drh 75f7317722 Fix the case-insensitive version of the regexp() function so that it does not
use the prefix optimization incorrectly.
[forum:/forumpost/983b43ef8e|Forum post 983b43ef8e].

FossilOrigin-Name: 1a8e43cc1b7969c40140dd7fd481d5ffd9de80e214eb494567c286d93a2b06e5
2021-06-03 12:31:08 +00:00