aboutsummaryrefslogtreecommitdiff
path: root/src/func.c
AgeCommit message (Collapse)AuthorLines
2026-11-11Fix a boundary case in substr().drh-1/+1
[bugs:/info/2026-11-04T20:19:36Z|Bug 2026-11-04T20:19:36Z] FossilOrigin-Name: 4ddf1761c0a0469fd0cfa9a724d700ee3158bdff48a75e6d4421e256b8045994
2026-11-07Have the substr() function correctly handle zero-length blobs. Report ↵dan-2/+9
[bugs:/info/2026-11-04T00:45:36Z | 2026-11-04T00:45:36Z]. FossilOrigin-Name: dbc2df5e5059c871ffaf8dae0ef9240e838bcf94a68d8d008d0f275b75c9263c
2026-11-02Minor changes to the abs() and round() SQL functions to better dealdrh-4/+2
with negative zeros. [bugs:/info/2026-11-02T08:17:41Z|Bug 2026-11-02T08:17:41Z] FossilOrigin-Name: 439cec35a883ee6f9b2602b2f100809c221a47a863f082188f83adf02318ffbc
2026-10-28Fix the log(B,N) function so that it works for 0.0<B<1.0.drh-1/+1
[bugs:/info/2026-10-26T16:32:25Z|Bug 2026-10-26T16:32:25Z] FossilOrigin-Name: 994f05ccd131604c5c6296fab93c1bb1e936ce5ef70d1168abf275c3f30a0158
2026-10-18Limit the size of the second argument of the (testing use only) SQL functiondrh-0/+1
fpdecode() to avoid a (harmless) signed integer overflow. [bugs:/info/2026-10-18T03:43:20Z|Bug 2026-10-18T03:43:20Z] FossilOrigin-Name: 72187f18fe8b207e5955f269a5e299e5b18d5b919ae9073b208454c994e9b18d
2026-10-18Merge recent branch-3.54 fixes into trunkdrh-1/+1
FossilOrigin-Name: f9e0ce3382e4787468bdb4029105fbffb2d4ab92b51c655ae762b555d8570efb
2026-10-18Check the datatype of the second (optional) argument to the log() SQLdrh-1/+1
function and return NULL if it is non-numeric as the documentation says it should. [bugs:/info/2026-10-18T05:05:18Z|Bug 2026-10-18T05:05:18Z] FossilOrigin-Name: a99e577b951fa38fcdff3693072c2f78e546be6a1c187b648f043b499a06768e
2026-10-16Fix a problem handling zero-length strings in some cases in group_concat() ↵dan-1/+1
when it is used as a window function. Report [bugs:/info/2026-10-16T15:51:51Z | 2026-10-16T15:51:51Z]. FossilOrigin-Name: 2f794cf18ac9e55a9a05349187d4322e160c99f9c6068aaf33d190cda929bc82
2026-10-15Avoid unnecessary recursive calls in LIKE and GLOB matching by checking the ↵jeffchen-0/+11
next ASCII literal before recursing. FossilOrigin-Name: f88d33b190bf96c22a17f32d901bf3882d464c44040df1d3a7b1b6ff0699ddf9
2026-10-15Deal with harmless 32-bit integer overflow on parameters to some extensiondrh-3/+9
SQL functions. [bugs:/info/2026-10-15T04:34:08Z|Bug 2026-10-15T04:34:08Z] FossilOrigin-Name: ca52702835d16afd04e936bc4d57f78f0c4d37f83b19b632122f6a699009ca3c
2026-10-12Speed up substr() start scanning for ASCII textjeffchen-0/+22
Skip bounded groups of eight nonzero ASCII bytes while advancing the start position. Keep the existing scalar handling for NUL, non-ASCII bytes, and short tails. FossilOrigin-Name: 5749b0489c50a9ea3ee576cb565810cb2f6d766635c6f1dd38cdc65a76a6d237
2026-09-20Adjustments to the substr() function so that it can accommodatedrh-1/+1
ridiculous values for the second argument. [bugs:/info/2026-09-20T18:42:27Z|Bug 2026-09-20T18:42:27Z] FossilOrigin-Name: aadf42e021fc55d457836c7cda68f3d22dcaae72a7bbc105c3c727b3eb5c4657
2026-09-02When -DSQLITE_DEBUG or -DSQLITE_ENABLE_WALSTAT is used, provide thedrh-0/+43
sqlite_walstat() SQL function that provides state information about the WAL subsystem. Used for debugging only. Function subject to change or removal. FossilOrigin-Name: 789d84e69171ef05d36486c38fbb0db10f8d827d9941472a2809f3113503e6c4
2026-08-27Built-in SQL function oom() invokes sqlite3OomFault() and then returns NULL,drh-0/+18
but only if compiled with SQLITE_DEBUG or SQLITE_BUILTIN_OOM_FUNCTION. FossilOrigin-Name: 90dfac7f2734078ae8c30b6f3379ed4d2283726fee9ea5799d73408d40e7e63e
2026-08-01Updates to build instructions, especially on Windows. Fix a harmlessdrh-1/+1
compiler working in debug builds on Windows. FossilOrigin-Name: be245e136a550faa7c84694156c40dc9778f50b00016892c29a2314bef14b6b7
2026-07-13Add assert()s and a testcase() to and fix and improve comments indrh-3/+16
the percentSort() routine. FossilOrigin-Name: be673351ebdeba8e78ee11941ecb3e178e4d5212ff07f1d2790320af1d52e6a0
2026-06-25Change the undocumented and unsupported sqlite_log() SQL function so thatdrh-1/+1
it is marked as unsafe and direct-only. [bugs:/info/3311f8d5b8|Bug 2026-06-25T10:19:43Z]. FossilOrigin-Name: c30ea3cefe346a3d87b57710a51b059371543c5abc75d08c4ca827bbe3b3f622
2026-06-19Further refinements and uses for sqlite3_result_str().drh-1/+1
FossilOrigin-Name: 974253a6058a7120354261b2134ed4803373031996957c7334161370b80bf428
2026-06-19Prototype implementation for a new sqlite3_result_str() API.drh-37/+6
FossilOrigin-Name: cdbc62c36a37ad687589917c6f1e92ded6d99959c54eb8d79eaaef6fa57dacd3
2026-06-19Fix the format() SQL function so that it returns an empty string not adrh-5/+8
NULL if the first argument is an empty string. [bugs:/info/2026-06-19T16:40:04Z|Bug 2026-06-19T16:40:04Z] FossilOrigin-Name: ece7af98a8bf982567b489cf82a52519f46a1c9360c82a486dbe1cd0664b1555
2026-06-15Improve comments in percentSort().dan-4/+13
FossilOrigin-Name: 9b43500f51ae7b43f0e2cc805bb8c93907eddbd8caf21ee5b5a3d2e795962088
2026-06-13Speed up SQL aggregate functions percentile() and median() by avoiding a ↵dan-15/+43
full sort of the array of arguments. FossilOrigin-Name: 9232b5f21d76dc702ccda5c689d61bcd0057fb1f2a4db6a70c607c25ad03a027
2026-06-11Fix harmless compiler warnings.drh-1/+1
FossilOrigin-Name: dd0c161fcd1619518cd4671d64afb6afeec44c140ec176ccb8616d381a88f42f
2026-06-09Change loop counter variables from int to i64 to avoid a potentialdrh-1/+1
integer overflow inside an assert() statement when SQLite is compiled with SQLITE_DEBUG and an extra-large SQLITE_MAX_LENGTH. Does not affect production builds. [bugs:/info/2026-06-09T08:53:14Z|Bug 2026-06-09T08:53:14Z]. FossilOrigin-Name: 77f615d9833b1f5eaabcb1a6b59af3a6698752abcd16592091f1630beec5969e
2026-06-06Minor performance enhancement and improved comments on the quicksortdrh-2/+8
algorithm used by the median() implementation in func.c. FossilOrigin-Name: 2800f6a75bbb6ddc86f2e029a7d36ff08febe03812302fb7931eb68da316f74d
2026-06-03Use tail recursion on the larger of the two partitions when doing adrh-36/+35
quicksort as part of the implementation of the median() function, to avoid excess stack usage on pathological inputs. [bugs:/info/2026-06-03T07:26:42Z|Bug 2026-06-03T07:26:42Z]. FossilOrigin-Name: 7dc987165c030c260ba90a8878291b5ceb037c48c2f437a8fb3f05b6c4f84fde
2026-05-31Fix the format() SQL function so that it reports TOOBIG and NOMEM errors.drh-3/+12
Fix a possible integer overflow on %#Q formatting. [bugs:/info/2026-05-31T02:00:07Z|Bug 2026-05-31T02:00:07Z]. FossilOrigin-Name: 3bfe0510aecccf113b9d008c308fca3096e9c45c59b919c0b91bb4703415988f
2026-05-15Have window functions sum(), total() and avg() correctly handle the obscure ↵dan-4/+9
case where integer overflow occurs as part of the same step that adds the first real value to the running total. FossilOrigin-Name: 614f8cbc374c7a2d39826706f16ab1c17e75abb420a70be356c7eefa95b271a5
2026-04-18Performance improvement in the substr() and length() SQL functions.drh-10/+27
Caution: The new code may give different results for malformed UTF8. I do not consider that to be a problem by the GI/GO principle. FossilOrigin-Name: 6124d27a33f4562f40777c2c6318d61709f7b481f23f9ade45064d8ad0700752
2026-04-15The sqlite3_str_new() interface never returns NULL, even after an OOM.drh-2/+2
Code that uses that interface should invoke sqlite3_str_errcode() to see if an OOM has occurred. FossilOrigin-Name: cb910047edc591102dd4ed0d57c863b366981b8aa1d3085d5f95b1fbbabf6c31
2026-03-28Reduce the compiled size of the quote() SQL function.drh-12/+5
FossilOrigin-Name: 9ea980a35628f7d0741ab6c65840ab9dab8abb576c6c60109147336452f9637a
2026-02-27Add an assert() to sqlite3RegisterLikeFunctions() to hopefully preventdrh-0/+2
future false-positive bug reports coming out of CodeQL. FossilOrigin-Name: 7c5f4dcd748baa60097bbf68d7aca99cc959bb1f7da92bd9ad86a4425a37d391
2026-02-16Refactor the sqlite3AtoF() routine so that it requires a zero-terminateddrh-2/+2
UTF-8 input. When the need arises to convert UTF16 or non-terminated strings, wrapper functions are used. Together, this makes the code slightly smaller and faster. FossilOrigin-Name: 67c7c72e9bdf04c920d77006538a202c923fa74b47c81dc3014c2929dac7277d
2026-02-13Add a "const" to avoid a harmless false-positive compiler warning.drh-1/+1
FossilOrigin-Name: d44af6cc093ab6b5a196249a84681148bbae3f624abf4bc8cc42c88f3f7320b2
2026-01-21Add a new encoding constant SQLITE_UTF8_ZT, which if used withdrh-4/+4
sqlite3_result_text64() or sqlite3_bind_text64() declares that the string provided is UTF8 and zero-terminated at the length specified. FossilOrigin-Name: 2d84ce88fed12766272f6b1293927eb4c7ce92da0334b09b4875ed2dfdd00ade
2025-10-27Fix sanitizer complaints in the regexp extension.dan-1/+1
FossilOrigin-Name: 6ff9ecb89d769bc2a27f8a57130f28ec7478979d3e35ba765c16017b5bdf775d
2025-10-25Rename the file control to SQLITE_FCNTL_FILESTAT. Rename the SQL functiondrh-8/+8
to sqlite_filestat(). Rename the enable macro to SQLITE_ENABLE_FILESTAT. FossilOrigin-Name: ee797fec4eeace78caa2c5e463108bf1a6568db7c33d94d9fe6624cfc6b0d4fe
2025-10-25The sqlite_file_info() function should always return JSON, unless theredrh-0/+2
is an OOM. FossilOrigin-Name: 65aed79c29bf1aac0934475c02b358b916f413b20d2475ec7b631011f21f4e2b
2025-10-24New diagnostic SQL function "sqlite_file_info()" and its associateddrh-0/+51
file-control SQLITE_FCNTL_GET_INFO. FossilOrigin-Name: 56ab9692583d5b64e1ab727e08a01c0a65b4e318b455c94397663ef8d3d7b6b8
2025-10-18Increase the range of integer indexes in the the merge() family ofdrh-9/+9
SQL functions. FossilOrigin-Name: 8d3943890ef3b533df35c4784c2a42c52503a4d9c3dbe67241510d8b70669b48
2025-10-13Fix a bug in concat_ws() in which an initial empty string was treated as ifdrh-1/+3
it was a NULL value. FossilOrigin-Name: eb2e4e46171c12f59aa5d571eeb310534360b110c3e7bda6eaf68f0e25546264
2025-10-08Add ENABLE compile-time options to enable carray() and median(). Hencedrh-1/+4
there is no new code and no increase in library size without the ENABLE macros. FossilOrigin-Name: 7dec290b413ca1bc67694743d8b771e1634fd85251f1a23d60aaf36c63f0f366
2025-10-08This is how the percentile() family of functions might be integrated intodrh-0/+458
the amalgamation, should we elect to do such a thing. FossilOrigin-Name: c2cfc9c92e35105e26a4c0887b0401ace15a874fd18046135de4b375ba968795
2025-10-07Fix some integer overflow warnings in the base64 and base85 extensions.dan-1/+1
FossilOrigin-Name: 06b4bd2aba22c57f5a5fed606c3bee225dee6fdc13bb16cc58194040ef0d7d85
2025-06-11Fix the concat_ws() SQL function so that it includes empty strings in thedrh-3/+3
concatenation. [forum:/forumpost/52503ac21d|Forum post 52503ac21d]. FossilOrigin-Name: 80a78987da484d435a8242c05c48d546d430920df713b24a9d9d9fff7ba1113d
2025-02-27Internal doc typo fixes reported in [forum:01d15f21b6|forum post 01d15f21b6].stephan-1/+1
FossilOrigin-Name: d6514c20ff583ccc4fb3a526fb8f86a563224f513ee10bb39a978046bd952726
2025-02-25Consolidate two different UTF8 encoders into a single subroutine.drh-32/+4
FossilOrigin-Name: 6208e494858b9d362efc7db4e8aac6f8e93fe51d2e038c94dfa97c55a74688a0
2025-02-24Add the unistr_quote() function that works like quote(), but also escapedrh-3/+9
control characters using unistr() if necessary. FossilOrigin-Name: e99e37b54baf7283588ead4983e613a1e14c58a0b92be5f7b25b4d9d287b5324
2025-02-22Prototype implementation of the unistr() SQL function.drh-0/+127
FossilOrigin-Name: 7cc302de05ed2a973372c05f55b048bf99af3d2590dd29f6fd0f379fb451aa0e
2025-02-17Code changes that make it easier to prove that no 32-bit integer overflowsdrh-1/+1
happen during memory allocation. No problems fixed; this change is just to make future maintenance easier. FossilOrigin-Name: 215650a5a1d55bdbca9c92524804a1a54456a17f42a17e53747b21a6507506f5