Commit Graph

27779 Commits

Author SHA1 Message Date
drh
a3569fb2ca Extra ALWAYS() macros to verify state in the sqlite3ExprCanBeNull() routine.
FossilOrigin-Name: be19b84c9f3fe127165809908add148dbe9a827a55608b0490de7e69b7f7f191
2023-12-19 11:57:29 +00:00
drh
459f7b1090 Remove a stray comment in the JSON code.
FossilOrigin-Name: 6618bdf0679405b43911ea8cd94050b12a5dc469f3dfe4759ee3ff850a55229e
2023-12-19 00:07:38 +00:00
drh
d9252d09c2 New JSON invariant test cases.
FossilOrigin-Name: a6a1367b0bf364b1a2e20e153c5f4a578624b8846f9ec0b7c9c3cba0ea2ec346
2023-12-18 19:18:46 +00:00
drh
c4dd6b42ec Add NEVER() to an unfalsifiable branch.
FossilOrigin-Name: 9a0c67db366d38a0b0741f6a1ae333cf27cfe6f6b7c6eed94bdec9686f9f9f8a
2023-12-18 18:50:47 +00:00
drh
fc76750f61 Fix JSON to JSONB translation so that it deals correctly with Infinity
and NaN.

FossilOrigin-Name: 178cb84f36bdb45ba17511900d6d8ea8dfa14912fc5bf7094a20348174a36c95
2023-12-18 18:31:27 +00:00
drh
095f2c5082 Ensure that the insert/delete size delta on JSONB objects in the JSON cache
are always set to zero.

FossilOrigin-Name: 4b4581668a908473dbf1322a3e98bc7cca122998c44518ea183af7f0d1ba9f95
2023-12-18 15:53:48 +00:00
drh
cf6fe5abe3 Add randomjson.c to testfixture. Use it for a new set of invariant tests
against JSON functions.

FossilOrigin-Name: f1c040606bfe784804134d8f3ca130908fad5212b47e3c32792baab977470943
2023-12-18 14:24:13 +00:00
drh
0a46ff995b Ensure that all object labels for individual objects generated by
randomjson.c are unique.

FossilOrigin-Name: 29c46aca231b3f1e997ef306a5a651408185bf3ad09ab9fc1fe21ed18caa4d02
2023-12-18 14:16:58 +00:00
drh
52a4691fff Bug fix in the randomjson.c extension.
FossilOrigin-Name: 1f3a33df530dbe330ea8b14a69369b807b413b25a167d1a3938f8f0faf97cc91
2023-12-18 13:51:54 +00:00
drh
2ae95649de Enhancements to ext/misc/randomjson.c.
FossilOrigin-Name: a4e6d1f86f3a502e4170f5a90031e269e48363e95114a66b84d373e3ce0b2704
2023-12-18 12:18:47 +00:00
drh
0d201598a5 Enhancements to the "randomjson.c" extension. Automatically load that extension
into fuzzcheck.

FossilOrigin-Name: 70620405ab01d6a5d38bafa9ae175fd6e4eabaf2efb7854734278dafd7b05c99
2023-12-17 20:41:48 +00:00
drh
13264418ba Enable SQLITE_STRICT_SUBTYPE for default builds of the shell, fuzzcheck,
and testfixture.

FossilOrigin-Name: 5a0c517ed7e46c0f8a3db752cf5b9f8010c60f35084606abe9e7c1c4f993b4a7
2023-12-16 15:48:42 +00:00
drh
5f3dd8668c New test case based on Chromium bug report 1511689.
FossilOrigin-Name: 2c7ef4b4d215f99f8d6787adb64e2037ae96e5dd6cb49c8b81634249f5e1b328
2023-12-16 10:50:06 +00:00
drh
40e614e393 In the count-of-view optimization, deferring freeing obsolete parts of the
parse tree, on the off-chance that some other part of the code might be
holding a pointer to those parts.

FossilOrigin-Name: da442578856c87137eb1677d9b13b7c1cf15828cc41d4756572b278060f69bae
2023-12-15 20:13:09 +00:00
dan
97f7ead3f3 Avoid expiring prepared statements in the middle of an integrity-check.
FossilOrigin-Name: 88beb48472da4667c0727c8ebabe046ea526450ff837fe789d041ed3f1ff105e
2023-12-15 19:26:16 +00:00
drh
b7fad0dca3 Add mention of --buildonly and --dryrun to the testrunner.tcl usage screen.
FossilOrigin-Name: 23b92d915c12ee768857e2c3c961832f390cad9b53b8bcfc2b97664baab25bb7
2023-12-15 16:28:02 +00:00
drh
baa1aba8d7 Fix a new JSON test case so that it works even if SQLITE_OMIT_VIRTUALTABLE
is defined.

FossilOrigin-Name: b995aae510888a9746b46545d176a0885d4738e1f1bc0b7ad7937ed023efd7d6
2023-12-15 15:22:03 +00:00
dan
f2194605f8 Do not run test script fts5origintest4.test with either "memsubsys1" or "mmap" permutations.
FossilOrigin-Name: 05a63d9603ef42cbee6dadff72d97583a9c78e549f70e9a808534d5c1ae7c28a
2023-12-15 15:17:39 +00:00
dan
76dbb58700 Avoid running the "no_mutex_try" tests with SQLITE_ENABLE_SETLK_TIMEOUT builds as part of the release test.
FossilOrigin-Name: 6b4e1344a28c213cbe8fb97f7f3f6688de93fb73ed96bf460ff74c959da1a712
2023-12-15 14:33:50 +00:00
stephan
f062506002 Correct --enable-sab flag in ext/wasm/GNUmakefile to fix a silent alhttpd args-parsing error.
FossilOrigin-Name: 7b9b757d872a31395b0f6454e2309a6a4664b8bdd8749f6a15371cbe72c05b60
2023-12-15 13:38:47 +00:00
stephan
e982385619 Use SQLITE_STRICT_SUBTYPE=1 by default for the JNI and WASM builds unless they're explicitly built with SQLITE_STRICT_SUBTYPE=0.
FossilOrigin-Name: 990211357badf0ab08bd34cf6d25b58849d0fd8503e289c1839fc837a74e1909
2023-12-14 22:01:55 +00:00
drh
eb78d56ec5 Add assert()s to FTS5 to fix static analyzer warnings.
FossilOrigin-Name: 27d4a89a5ff96b7b7fc5dc9650e1269f7c7edf91de9b9aafce40be9ecc8b95e9
2023-12-14 16:34:47 +00:00
drh
4a5c96ace3 Fix harmless compiler warnings in JSON and FTS5.
FossilOrigin-Name: 90135efccfeb1046f002bfcbd8dfec9a1a3b40cbe1b5c714ae065b06368e354f
2023-12-14 15:38:57 +00:00
dan
e6289d6dd0 Improve the error message returned by an fts5 'rebuild' command on an external content table if there is a problem with the content table or view.
FossilOrigin-Name: 0fbf4b8a58fde1c187908934da6f59999b146f32e07ac255cc531c5c4d7007fd
2023-12-14 15:31:35 +00:00
drh
8a861a81e8 Enhance aggregate order-by so that it transmits subtype information through the
sorter.  Fix for the deficiency reported by
[forum:/forumpost/87347ad2fb5a8f76|forum post 87347ad2fb5a8f76].

FossilOrigin-Name: d302a389460d0c15775a8b5f5afbac2c1d8a91bc282bc9b04c583ca04a8c09c6
2023-12-14 15:11:39 +00:00
drh
07117f8118 Pass subtype information through the aggregate ORDER BY sorter for
aggregate functions that use subtype information.

FossilOrigin-Name: 3536f4030eab6d650b7ed729d2f71eb6cc3b5fbe16b4e96b99008d66522aaccb
2023-12-14 13:58:50 +00:00
larrybr
9e488a5a40 In CLI, fix .read inability to open 2GB+ files on WIN32.
FossilOrigin-Name: 56c80a62d2e033d64ba5d545ae9cbe3ed7c9d046c0a3fafb6cfa2f0b562d1ef0
2023-12-13 20:37:20 +00:00
drh
3e4195c60d Avoid invoking sqlite3ExprColUsage() on an unresolve column reference.
dbsqlfuzz fc34aa62df4de103705d11b807074687ffafbda5.

FossilOrigin-Name: ac9314c0e335694b48c613145f5397247bb88c51806cd0dc3ed4ec306db4bbad
2023-12-13 16:45:18 +00:00
drh
f7c78a2408 Bug fix in the JSONB validator.
dbsqlfuzz ac6fa521a08609a642198e7decf64180e750b3c4

FossilOrigin-Name: 3e940a6a08b0a0434650cd3d8dd286e09ad8ab805b0a4d515e57bba5d3608577
2023-12-13 15:27:03 +00:00
drh
001d1e795c Improvements to UTF8 handling, and especially the handling of invalid UTF8,
in the JSON routines.

FossilOrigin-Name: 1b229c1101d6c384a30f343c5e47b471ab084b2d8e81170eb8f642afc1c67e3b
2023-12-13 14:31:15 +00:00
drh
891f1dc054 Fix the JSON object label comparison object so that it works correctly even
if the label ends with escaped whitespace.

FossilOrigin-Name: 4d5353cadd7b7c5f105bc197f3ec739e2d041472d6b3e939654c9f9cfc2749ae
2023-12-12 18:38:53 +00:00
stephan
9710fa119e Worker1 Promiser API: when multiple db connections are active then use the requested connection instead of always the first-opened connection. Bug reported in [forum:894c330e7f23b177|forum post 894c330e7f23b177].
FossilOrigin-Name: 194276e18e0268829061c09317e7f9f527a703eb45f1755ff1dd30bd99dc1b68
2023-12-12 17:52:27 +00:00
drh
df25a8fd4b The json_valid(*,8) function does a much better check of the validity of
the JSONB input.  The json_error_position() function returns an approximate
byte offset to the point of the first detected error in the JSONB.

FossilOrigin-Name: 840efb33a3934a9bdccad65ea15c70d5c335a517502c9844aaad8405d16d1604
2023-12-12 17:31:17 +00:00
drh
78e636bba6 Add NEVER to two unreachable branches in JSON.
FossilOrigin-Name: c96ebb086feb89341565cc52b970ae7799ce1327fe1ad4fc790f1b0dcaa6e229
2023-12-12 17:13:10 +00:00
drh
87399a56db Improvements to JSONB validation - catch more cases where the input does
not conform to spec.

FossilOrigin-Name: be1864eac4eb75cc30bf98f73092c8608467f4bd956240df6a0cbea9f1e09e85
2023-12-12 14:33:52 +00:00
drh
cc1a39fd24 Validity checking of text nodes in JSONB.
FossilOrigin-Name: fa5160687c2f970d407e8af73c246f7cd806bb4ce35f29a79ac534a8646a6c8e
2023-12-12 02:31:12 +00:00
drh
ad6bc61804 The json_error_position() function now reports an approximate byte offset
to the problem in a JSONB if there is a problem.

FossilOrigin-Name: 80d5d94dff6a2d2557039be3d7d47c1a6003c4b98defe0bd411acfeb963ad5dd
2023-12-11 21:00:55 +00:00
drh
5a890b4ed2 json_error_position() now uses jsonValidityCheck() to find the approximate
position of an error in a JSONB blob.

FossilOrigin-Name: c3d60cf7028a333b825d5b89516945a73e0c158ac81d8bcc117d21bfd98602c8
2023-12-11 20:44:21 +00:00
drh
001caa714f json_valid(*,8) allows minus-signs on hexadecimal literals.
FossilOrigin-Name: c0d7f4520d839a268b3fd2474d0897a9832aa608bd6238b3e287fabecf07a350
2023-12-11 20:19:10 +00:00
drh
7445659559 Activate JSON_SELFCHECK within fuzzcheck.
FossilOrigin-Name: 4d14e733bb521aed65e98533969d2303738232ae87dab70fdf7962e6513195f5
2023-12-11 19:21:06 +00:00
drh
ba5505657f Rename the new test-control to SQLITE_TESTCTRL_JSON_SELFCHECK. Make it so
that the current value of the setting can be interrogated.

FossilOrigin-Name: 7aff1d9a4cb17ecd5abab21ab032f35a78741dd641ddd8cbcc85fc4a81a0707d
2023-12-11 19:00:44 +00:00
drh
7d2eaae83e Add SQLITE_TESTCTRL_VALIDATE_JSONB, which if enabled under SQLITE_DEBUG causes
cross-checking of generate JSONB.

FossilOrigin-Name: b410a4db74a650003539ffaaea18519d5159b504daac47db6a4874b730f40ac8
2023-12-11 17:03:12 +00:00
drh
ce46e0eb11 Work toward enhanced functionality for json_valid() with deep checking
of the JSONB (second argument has bit 0x08).

FossilOrigin-Name: c370d573198b151767f04e91bf8baa4ae0076751ae468c5709742a0b0ed16770
2023-12-11 14:01:38 +00:00
drh
b89e64d822 Fix a potential use of uninitialized value in json_valid() with 2nd
argument of 8.

FossilOrigin-Name: fa102036fe46eeb71b7df3e265be1935ae5c78e0b939b08841bcfb8abadbc77a
2023-12-11 02:39:11 +00:00
drh
bfa0de86e6 Fix a harmless UBSAN warning.
FossilOrigin-Name: 1503cba6d17e9bade7a5c103ddd23241ff4741f9a2e3032ffe2987af243dae65
2023-12-08 16:56:50 +00:00
drh
2a27be2107 Fix a potential problem RCStr access on a JsonString object that is not
really and RCStr.  Fuzzer/UBSAN find.

FossilOrigin-Name: d2f2174ce2cc89606034e158149a2d05fc3627ec4d5cdb772add7a2250f29d78
2023-12-08 14:54:22 +00:00
drh
9d2446dc13 Fix a harmless compiler warning about "confusing indentation".
FossilOrigin-Name: 34f9e9a8c4bea13f60f43062e25cd7d9422f2e7f5b371ed0ddadc9abeb3ca256
2023-12-08 12:58:41 +00:00
dan
05980f5931 Avoid dropping an error code in new fts5 tokendata=1 code.
FossilOrigin-Name: a66596e33dc9aa4bab2ec3ff45546e1321d0a11bdc764f8381b315292ca92423
2023-12-08 12:04:32 +00:00
dan
0b427eb796 Ensure an fts5vocab table never uses a special tokendata=1 merge cursor.
FossilOrigin-Name: 1e26510e83b40c9bd2e8bfa2a0e81f2cb915e78fed773204ef537683e48b61dc
2023-12-07 21:09:33 +00:00
dan
7c12666fe9 Avoid an assert() failure when querying an fts5vocab table that accesses a tokendata=1 fts5 table with corrupt %_data records.
FossilOrigin-Name: 386ba9e20423fb2f623d6adc9d3c310fb1b135f54a1dad15ef3b593d97886926
2023-12-07 20:46:40 +00:00
dan
1ddcf7dd95 Fix a null-pointer dereference in fts5 tokendata=1 code.
FossilOrigin-Name: d69fa8f0504887f968d9a190ecb889ddb40bb1b56d0d4479f9819c106aec719b
2023-12-07 19:08:25 +00:00
dan
5f2f8d0028 Fix a problem with handling OOM and other errors in fts5 when querying tokendata=1 tables.
FossilOrigin-Name: bc911ab5953532956510c199be72b1d3c556f2d0ddbd7fc0ae6f5f917b337b48
2023-12-07 18:41:49 +00:00
dan
2f3ccb8886 Different fix for the fts5 COMMIT-following-OOM problem first fixed by [fba3129d]. This one does not cause problems if an fts5 table is renamed and then dropped within the same transaction.
FossilOrigin-Name: d8c6b246944934a7a6e027b3f5b986fd64a19dd5c5c5175f4ea8586da59a6764
2023-12-07 14:41:58 +00:00
drh
5a238ffcae Rework the jsonEachPathLength() routine in json_tree() so that it is
less susceptible to problems due to goofy object labels.

FossilOrigin-Name: 858b76a00e8ff55215f7a2e6a4cd77fc4d4f98dea7224cd90488744f5ce246a4
2023-12-07 14:09:25 +00:00
drh
f86a07b0c4 Add ALWAYS() on branches added in [ec0ae4030968c782] that are always true.
FossilOrigin-Name: 451cef8609e96dd9244818adc5c6f240544694bcb4ae620e88f90e403e59d70f
2023-12-07 13:14:34 +00:00
drh
5b6b703461 Improved detection of corrupt JSONB in the jsonReturnFromBlob() function.
FossilOrigin-Name: b014736c1f80ccc46fb4b24ac04310a6ce5cb5b6653665efff366cb3bc742257
2023-12-07 12:55:39 +00:00
dan
00f3ac5544 Fix compiler warning about shadowed variable in fts5_index.c.
FossilOrigin-Name: ee70e4c1c9c41617850228e48d8df44f105cf2fbbe789340ceca6f27ad6ce5eb
2023-12-06 18:34:59 +00:00
drh
82fc1b63f6 Work around LLVM's newfound hatred of function pointer casts.
[forum:/forumpost/1a7d257346636292|Forum post 1a7d257346636292].

FossilOrigin-Name: ec0ae4030968c782af48d1c776351c14b2ada21d40aeb97915f33df30706e18f
2023-12-06 18:25:41 +00:00
dan
83ac79282a Update documentation comments in fts5.h.
FossilOrigin-Name: 38c50e22c98607e6c1fd78d7615cda534773b6d4fd85c712b54749fcd7af0c83
2023-12-06 18:10:50 +00:00
drh
a9c8469d03 Do correct comparisons between object labels in JSON even when the two labels
contain different JSON escapes.

FossilOrigin-Name: bda2e30cc22e180b19a7a05824dd345880eb402ae5450b2d2dd954946c3ae135
2023-12-06 17:50:16 +00:00
drh
b597fea894 Correctly handle 8-byte sizes in the JSONB format.
[forum:/forumpost/283daf08e91183fc|Forum post 283daf08e91183fc].

FossilOrigin-Name: 73d390f39c0bbbc017e01544e4d43c76761f2599bd57f900131c706270dfd202
2023-12-06 17:39:31 +00:00
drh
9df01b5ccf Fix the routine that determines the json_tree.path value for the first row
so that it correctly takes into account escape sequences in the path
argument.

FossilOrigin-Name: b9243ee8a37c62eb8848e765bd4af83bc1b3d3eb24fb4268a1357ad1f8b2e1fb
2023-12-06 16:57:18 +00:00
larrybr
3207199c98 In CLI, move -interactive flag handling back to arg-loop pass 2.
FossilOrigin-Name: 63cb05a862532d2d56e9e81fe32ced09bf58f03146587a118f11c2a84e195e69
2023-12-06 16:27:29 +00:00
drh
8dfbf4addc Test cases for object label matching with escape sequences.
FossilOrigin-Name: c6f2aa38e95b7888650cfa7bb773b18a28e01d883033ac77be6d504ffe417d18
2023-12-06 15:50:13 +00:00
drh
6a8581d828 The rule for the RHS of the ->> and -> operators when the RHS does not begin
with $ is that it must be (1) all digits, or (2) all alphanumerics, or
(3) contained within [..] or else it will become a quoted label.

FossilOrigin-Name: 0e059a546ec11fa5c6d007bd65c249ee2422f1facbdb2792c53e0bc0ccc97e14
2023-12-06 15:35:38 +00:00
drh
91ec00c25a Increased rigor in comparisons between object labels in JSON.
FossilOrigin-Name: 2bc86d145fccc07107b7753cb1a69122676d4096fe59c454497bd81a6142d45e
2023-12-06 14:50:48 +00:00
dan
e751596ee8 Add the tokendata=1 option and related APIs to fts5.
FossilOrigin-Name: a76a636b23c0ebd95d47fdf8358de4729e51a5f68f1a730cd4d89b378e94ac0d
2023-12-06 14:36:34 +00:00
dan
39b08db132 Merge trunk changes into this branch.
FossilOrigin-Name: 8f46eace86e7b2e556913575aa3cd6f7987ac0efcc880f0af649d42c253aeb81
2023-12-06 14:30:34 +00:00
stephan
1f2d7c4312 README.md typo fix reported in the forum and update all links from http: to https:.
FossilOrigin-Name: 5c48acdbb44185b352b54911a57a6986d6c7e624bdeba2af48b985d29f0292bf
2023-12-06 12:30:28 +00:00
drh
88208296c2 Rework the JSON functions so that they use the JSONB format internally.
The original JsonNode parse tree design is removed.  All JSON functions
that accept text JSON also accept JSONB.  New functions generate JSONB.

FossilOrigin-Name: 7f0c79b94e8f55e5013e52ba64ba8b32dad1dc4e2224d2099733cbc561de1810
2023-12-05 19:45:09 +00:00
drh
5afd67b3c3 Use extra assert() statement to silence harmless static analyzer warnings.
FossilOrigin-Name: 174c2b2eef5fecd96a5fc89b81032fe81f7801f12097cea10e7e7f0a02114813
2023-12-05 19:24:07 +00:00
dan
fb923fc4cc Further tests for the new code on this branch.
FossilOrigin-Name: 59d008b6c23ab900377bc696ee19381feb7614bac80546eae361e401c3620c4e
2023-12-05 18:36:23 +00:00
drh
a0de45459e Miscellaneous comment cleanup and typo fixes.
FossilOrigin-Name: 59446dc0bd0091572122a3c8b4653d7a2dc867d16c4a5919f79b81bc3a673ce3
2023-12-05 18:28:15 +00:00
drh
8eac91fab7 Use strspn() to accelerate whitespace bypass in the JSON parser.
FossilOrigin-Name: 843197df08352bdff4b87be91d160e574572aded0d0c66142fd960000c0b4701
2023-12-05 12:52:13 +00:00
drh
590aaff992 Small performance gain by unwinding the string literal delimiter search
loop in the JSON parser by one more level.

FossilOrigin-Name: 4c587feac153e8ebe526559ec3d254f545f81e8d1ed3126f91a5ff25ec4aa72e
2023-12-05 12:22:05 +00:00
drh
78f7d2f4c1 Clean up the JSONB performance test script.
FossilOrigin-Name: 905301075a7fc1010ee7e754867b1b698c9b8576d50e98125def32a5dfb7ee9d
2023-12-05 12:20:58 +00:00
drh
fa43e21711 Use an assert() to fix a harmless static analyzer warning.
FossilOrigin-Name: a249ca657e624028bc6b3d2c2bcedd7162d118addb7d62ce519920cecebf1860
2023-12-05 01:44:15 +00:00
drh
ae2e972802 Fix OOM and corrupt JSONB handling in json_patch().
FossilOrigin-Name: 1910feb0b7d5cc2b810c3322f6cca281d8730182d30d162bd7bb56800979ea91
2023-12-05 00:17:17 +00:00
drh
3cdb079476 Rename the internal routine jsonMergePatchBlob() to just jsonMergePatch().
FossilOrigin-Name: ebf667b616235bb64b83832008342ba5e7b10b2c170d7cebc431f040fef7ecfb
2023-12-04 23:12:57 +00:00
dan
49bfbc1ef3 Add further tests for xInstToken().
FossilOrigin-Name: 8582707f16133f003a6687f68cbea03d4eb6c2a0e2e07746b7cace0c44e84fa4
2023-12-04 19:48:08 +00:00
drh
f26e26afc5 Fixes to error handling in json_array_length().
FossilOrigin-Name: aa85df2d26b74c171c55bde19ef17c4f11f40b8af7181bbf7162f87cdea7e88b
2023-12-04 19:32:17 +00:00
drh
0b8b1c309d Do not make the input JSONB editable in json_remove() if there are no PATH
argument.

FossilOrigin-Name: 66594544f3ba9977475a3e3f74404eb2b2fb845053b28bd24c2b52c7df94e9d7
2023-12-04 19:14:13 +00:00
drh
3fedb7e59e Fix errors in rendering JSON5 escape sequences embedded in JSONB.
FossilOrigin-Name: f1a51ae3863557526a51c6e98e71fcdf4f1ed14a36212b3c90f7408f926345e4
2023-12-04 18:53:10 +00:00
dan
54318b382a Fixes for xInstToken() with tokendata=0 tables. And with prefix queries.
FossilOrigin-Name: 78fbb71598b1ca756acc078253880a1d0f7983a5a26b9efc683e6488122505a1
2023-12-04 18:45:14 +00:00
dan
910c77b049 Fix memory leak in new code on this branch.
FossilOrigin-Name: ebc160b9a05568df66f86e30804399ee29d34b44a60c57e062f98cb92826353f
2023-12-04 17:58:56 +00:00
dan
3dfc063705 Fix a problem with the xInstCount() API and "ORDER BY rank" queries.
FossilOrigin-Name: 317a50563d9e8586fda136e513727241b414e7267d50a06571c8ebd0eae710bc
2023-12-04 17:45:33 +00:00
drh
9c794b9bff Continuing simplifications and code cleanup.
FossilOrigin-Name: ddf92b5059a9106753fd18b82ba8daa269a62af947561c460790107b83416f0b
2023-12-04 17:40:28 +00:00
dan
9d373ca1c5 Fix bug in xInstToken() causing the wrong token to be returned.
FossilOrigin-Name: da78d07e77cbc783fbc725758911c230fd6a1c1885d9576125de955dcc2bd37f
2023-12-04 17:05:37 +00:00
drh
99c41692f1 Remove reachable ALWAYS and NEVER macros.
FossilOrigin-Name: f601de3eeabd85993c1f5ee96b62de6fdabbeae2fe8950e00d08feb48d42c498
2023-12-04 16:01:39 +00:00
drh
732fb64ad3 Two new NEVER macros.
FossilOrigin-Name: 52632c92cb06faf0e804654b3490fd6c199521107bd30c8fcbc3a2a5a488098f
2023-12-04 15:22:42 +00:00
dan
43b4864a98 Add tests for using tokendata=1 and contentless_delete=1 together.
FossilOrigin-Name: a2506b8c9718054912270055638204753c4156bbc115e55194e6df9d7e76cb10
2023-12-04 15:08:21 +00:00
drh
dc138cb186 Repair issues and inefficiencies found during testing.
FossilOrigin-Name: ae973cb1515f9d76409c92a2ca2ffd6b71f32b0b490a4886770e7c1b90f12611
2023-12-04 13:12:45 +00:00
drh
2ff73a5f3e Better pre-scan size estimations for objects in the JSON parser resulting
in fewer reallocations and memmove operations.

FossilOrigin-Name: 526b27f90897f5e35dfff7257daf6c4ce4798d649b09b8aecfb02df0449e3c51
2023-12-04 01:14:23 +00:00
drh
b7fd951be4 Back off on the use of strlen() for situations where sqlite3_value_bytes()
will work as well, for performance.

FossilOrigin-Name: 79fb54fbb8b9c30f47cdbd437d24a21542716241e822749e5e28c9fbc449bfa8
2023-12-04 00:31:58 +00:00
drh
9af45dc482 Remove dead code. Improved reporting of errors in JSON inputs.
FossilOrigin-Name: 2eaa738e6b5c1b67b3e57c868d9c3a30eea38a0b3b8b02482f06d57a45b10921
2023-12-03 23:38:24 +00:00
drh
16e8a5b2f3 Avoid problems when the path argument to json_tree() contains embedded U+0000
characters.

FossilOrigin-Name: 9f055091af01a5dddba1a7e9868ad030c8f206237e1569215cb161e53e54aa71
2023-12-03 23:30:59 +00:00
drh
a3bf077b60 Ensure that OOM conditions in the generation of the "bad JSON path" error
message result in an SQLITE_NOMEM error.

FossilOrigin-Name: aa0e02b5c26a2ef3d6216a0ed8bc01382be43173485f898cb63f2a8c559f2e74
2023-12-03 20:11:35 +00:00
drh
0a18a5807a Enable incorrect JSONB to be rendered into text without hitting an
assertion for a bad whitespace escape in a string.

FossilOrigin-Name: 4d6a9a217df6792b41766b774fb0c0553b45f9104c26a0955bf4a30862d7d7bf
2023-12-03 19:59:45 +00:00
drh
78fa0186b8 Do not let bad hexadecimal digits in malformed JSONB cause an assertion fault.
FossilOrigin-Name: 8dec1ba1e5076ff596756e00c1e2ada0245f168a503dd1cadadf848331acfac3
2023-12-03 11:54:39 +00:00
drh
eb18ae3089 Minor code changes for consistency and to simplify testing.
FossilOrigin-Name: df272bd837910ad9e03e222716a1201a601399664365f1dcf73d5932372518ed
2023-12-03 00:51:30 +00:00
drh
c78c3c91ae Implement strict JSONB checking in the json_valid() function.
FossilOrigin-Name: 0f26d38880fcbc207abcc94dbc170a7428bab1b4f0b7731aaf5bee0224000994
2023-12-02 21:39:34 +00:00
drh
8f8d481485 Fix harmless compiler warnings reported by MSVC.
FossilOrigin-Name: 419652c0c82980bd043584dcd2976f91dfff7b926b216d597698299850b855c0
2023-12-02 20:37:45 +00:00
dan
c22d2b7b7f Fix various compiler warnings and other problems with the new code on this branch.
FossilOrigin-Name: 3a623cfa173b4035c759cb84985d11d8727053beb383648503987d6ab15c0ef0
2023-12-02 20:35:04 +00:00
drh
c1e85742da Code and comment cleanup. Everything should work the same.
FossilOrigin-Name: c640754df0d3ffdad994745f0d0e10c8f19f424b87f6a6e6e269491a0350b950
2023-12-02 20:25:36 +00:00
drh
53c2160db0 Fix harmless compiler warnings. Refactor some identifier names for
clearer presentation.

FossilOrigin-Name: 7e3941502789c5afaf19b08112f464abf5e3cba7f92fc9290af2a0f96127ad9a
2023-12-02 18:17:38 +00:00
dan
94c521295a When tokendata=1 queries require multiple segment-cursors, allow those cursors to share a single array of in-memory tombstone pages.
FossilOrigin-Name: e0175d07e4094db5ea4b0378a5ff480dafb6ba9da86a113fa767c4c89c3c866f
2023-12-02 18:14:07 +00:00
drh
a11aaff05a Take extra care to ensure that JSONB values that are in cache are actually
owned by the JSON subsystem, and that ownership of such values is not handed
back to the bytecode engine.

FossilOrigin-Name: 1304534001e9ef66c6b12752b69d790bfa3427cc803f87cc48ca22ae12df0fdf
2023-12-02 18:04:27 +00:00
dan
c44041e03b Ensure that tokendata=1 queries avoid loading large doclists for queries like "common AND uncommon", just as tokendata=0 queries do.
FossilOrigin-Name: 7bda09ab404a110d57449e149a3281fca8dc4cacf7bd9832ea2a1356ad20fe8e
2023-12-02 17:32:16 +00:00
drh
05db513435 Protect a memcpy() against OOM conditions.
FossilOrigin-Name: 26144d1c25ae0435db568009ba05e485d23d146f2b1f29f3a426c87860316aed
2023-12-02 16:11:22 +00:00
drh
2c26bde4ff Do not allow a JsonParse object to be considered "editable" after an OOM.
FossilOrigin-Name: c6bacf57bd6fe0fee00c9d41163a270b60997c20659949971bbf5c6c62622bfe
2023-12-02 15:59:48 +00:00
drh
4cd397c0d9 Fix potential unsigned integer underflow in jsonAppendString().
FossilOrigin-Name: d2fba2cbdc3870d34228c1a9446eced884325acc183900d7dd0b96132570fb4a
2023-12-02 15:06:43 +00:00
drh
82136d90f8 Minor fix to the header comment on jsonXlateTextToBlob().
FossilOrigin-Name: c3677ba410208c07b711f5f526eb5cf039a8eee49f632c7ae04fa55cdfbb9058
2023-12-02 14:55:46 +00:00
drh
f0b8b16317 Performance optimization in jsonAppendString().
FossilOrigin-Name: fdf00e96239c73fb67e2acecc5b95f55a1fc51c3deed4512613c0d6070ce5805
2023-12-02 14:16:47 +00:00
drh
679c90850c Simplification and optimization of the JSON parser.
FossilOrigin-Name: f5ec9485119a2a6cb33eb864c7ca9b41d4a2ed08ab6ad9a6b0dd9358ab253576
2023-12-02 13:36:52 +00:00
drh
768b6e32f6 Remove a NEVER that can be true if a virtual table column is declared to have
a DEFAULT.  See
[forum:/forumpost/3d4de8917627d058|forum post 3d4de8917627d058].

FossilOrigin-Name: 8abc2ccaf8106f20243568cd7fa74174386eb85d7ea381201e97e2fd527033e0
2023-12-02 12:23:34 +00:00
drh
6df61985d4 Unroll a loop in the parser for a performance increase.
FossilOrigin-Name: a6dc29e4d5e13949e0fcd9d5dde575c2670eb10a230ab9df3806fc8c3016c540
2023-12-02 01:38:53 +00:00
drh
5ec9c916ad Fix harmless compiler warnings and enhance performance the parser.
FossilOrigin-Name: 285633da6d188547e52f07779e209c9e5f3dc33ce0668e14858f3337889ef4b8
2023-12-02 01:06:33 +00:00
drh
3af20cf3a0 Performance optimization in the JSON parser.
FossilOrigin-Name: 68d191f40e708962ec88e0c245b4496bc4a671300484b1cc0f3fc7e6d199a6e6
2023-12-01 22:01:26 +00:00
dan
f4c2962558 Remove old code for tokendata=1 queries.
FossilOrigin-Name: b0a489e8e1bf0290c2117ab32d78b1cc7d67bcb226b55ec044c8367ebde3815b
2023-12-01 20:37:11 +00:00
dan
ebd173a79f Merge latest trunk with this branch.
FossilOrigin-Name: 8258967411d3ff212424b25fec79ded0d8ae83e773cd35a0bbf300c94923f25b
2023-12-01 20:10:20 +00:00
dan
b5effc0605 Different approach to querying a tokendata=1 table. Saves cpu and memory.
FossilOrigin-Name: c523f40895866e6fc979a26483dbea8206126b4bbdf4b73b77263c09e13c855e
2023-12-01 20:09:59 +00:00
drh
03075fa868 JSON cache is now more effective.
FossilOrigin-Name: 443a3f3a8e64d81cad8300a30e2cc57c4e39f69b5669ac8b550c590ae9f1134a
2023-12-01 18:49:02 +00:00
drh
063d0d4c3a Fix up the JSON cache to work better.
FossilOrigin-Name: 1fdbc39521f63aedc6f08ecaafa54ea467b8c6316a692a18ad01eecbf22a0977
2023-12-01 18:46:14 +00:00
drh
5bfa7e65d1 Cache is working better, but does not preserve the hasJson5 flag.
FossilOrigin-Name: a12add7ab9f5aee5bb2ede0c4d22e599dd28f7a107dce72b2ea48ef92d233e8a
2023-12-01 13:28:13 +00:00
drh
ca1ce7773c First attempt to get the JSON text-to-binary cache working. All test cases
pass, but the cache seems not to help much.

FossilOrigin-Name: 25ed295f300fea6185104a73721076bccd2b2a6e411c78564266fa6dca4ff70c
2023-12-01 12:57:12 +00:00
drh
4b9ed1b256 Remove all trace of JsonNode from the JSON implementation. The JSONB format
is used as the internal binary encoding for searching and editing.

FossilOrigin-Name: 11ebb5f712cc7a515e2e0f2be8c1d71de20c97fe5b74c4f4d72c84fd21182d35
2023-11-30 23:36:14 +00:00
drh
38aeb97f27 Convert json_valid() over to using only JSONB as its internal format.
FossilOrigin-Name: 7b5756fa6d00b093bf083a8d7a5ef5485f7a09e4eac473785c8380688f861a1b
2023-11-30 20:57:48 +00:00
stephan
68003d9f18 Add a basic batch-mode SQL runner for the SAH Pool VFS, for use in comparing it against WebSQL. Bring the WebSQL batch runner up to date, noting that it cannot run without addition of an "origin trial" activation key from Google because that's now the only way to enable WebSQL in Chrome (that part is not checked in because that key is private). Minor code-adjacent cleanups.
FossilOrigin-Name: 883990e7938c1f63906300a6113f0fadce143913b7c384e8aeb5f886f0be7c62
2023-11-30 20:34:24 +00:00
drh
276042bd23 Convert json_type() to use JSONB internally.
FossilOrigin-Name: 83074835b900ce85cf67059e674ce959801505c37592671af25ca0af7ed483f1
2023-11-30 19:29:56 +00:00
drh
0ab1e25468 Convert json_insert(), json_replace(), and json_set() over to using only
JSONB internally.

FossilOrigin-Name: 4e2083e86f19ef7634f0b253fb924e52014b43ed0ce8acc51c36f3c5682180a6
2023-11-30 19:11:14 +00:00
drh
66795962b5 Enhance json_set() and json_insert() so that they create missing
substructure.

FossilOrigin-Name: cc7a641ab5ae739d31c24f0ad0caeb15a481a63fa8f13720718ea922c25862ff
2023-11-30 19:06:27 +00:00
drh
7394a6ef57 Simplification of the new JSON insert/set test cases.
FossilOrigin-Name: 04c0d5644372446c924a2e31a26edf51ddc563a1990d170b0ed4739e3e8b239b
2023-11-30 16:17:09 +00:00
drh
48222bef66 New JSON test cases showing insert or set with missing substructure.
FossilOrigin-Name: 6802b6459d0d16c961ff41d240a6c88287f197d8f609090f79308707490a49c2
2023-11-30 16:16:10 +00:00
drh
ad27c437ff New test cases for insert/set/replace with paths that indicate substructure
that does not yet exist.

FossilOrigin-Name: 146c717c51940b2139befc45ac74e7a1c36ef3c32fd3cfe35b334488eebe6298
2023-11-30 12:04:14 +00:00
stephan
bac2fe9f44 Update some OPFS-related help text in WASM tests. Minor cleanups in speedtest1-worker.js.
FossilOrigin-Name: 263f6d3a7784ef7d032dbf7a3265aca8dd70bf50797f28f6b2e8ddb6a301f83a
2023-11-30 10:00:25 +00:00
drh
bfc7e62be4 Convert json_insert(), json_replace(), json_set() to use JSONB internally.
Mostly working, but some corner cases are still not quite right.

FossilOrigin-Name: 99c8f6bd5c9a31b6d00f92e383bec8a8235ed553916ad59adbb1b7663f6ebff1
2023-11-30 00:52:33 +00:00
drh
694beecf2b Convert the json_error_position() routine to use only JSONB internally.
FossilOrigin-Name: e7a8ba35bff6fde55827f978de5b343b6c134c7fa53827f5c63915a9dc2598ad
2023-11-29 20:06:49 +00:00
drh
da2578391d The json_patch() function now operates exclusively on JSONB. This patch
also includes improvements to JSONB debug printing routines.

FossilOrigin-Name: fee19d0098242110d2c44ec7b9620c1210ef3f87913305f66ec85d277dd96ab6
2023-11-29 17:36:54 +00:00
dan
89fcfbb424 Fix signed integer overflow in fts5.
FossilOrigin-Name: 60e46c7ec68fd8caaed960ca06d98fb06855b2d0bb860dd2fb7b5e89a5e9c7b4
2023-11-29 16:22:39 +00:00
drh
ed088f5f8d In the recovery extension, if a payload size is unreasonably large, it is
probably corrupt, so truncate it.

FossilOrigin-Name: 988c3179e978a3a6d42541e9c7a2ab98150383671810926503376ed808f150ff
2023-11-29 13:47:46 +00:00
drh
6d7afd8ba8 Merge all the latest trunk enhancements into the jsonb branch.
FossilOrigin-Name: 1a59fcab2179cc3b52ecd3de7d2018db96ac149aaff521959773a517b8d9ac3e
2023-11-29 12:18:02 +00:00
drh
2ba5534101 The assertion change at check-in [7946c79567b0ccd3] is insufficient to fix
the problem of a Table object being deleted out from under the OP_VCheck
opcode.  We need to reference count the Table, which is accomplished here.

FossilOrigin-Name: cad269d5e274443c39203a56603b991accc0399135d436996fc039d1d28ec9db
2023-11-29 02:45:09 +00:00
drh
4b54d6cdaf Convert the json_array_length() function to use JSONB instead of JsonNodes.
FossilOrigin-Name: 5ab790736d943e08f097efcee5cfbf0d83c65b0a53f273060330ba719affa5e5
2023-11-29 01:38:15 +00:00
drh
748178a9fb Fix all known problems with JSONB json_extract().
FossilOrigin-Name: d5f48c57e975ac468cf29a43a5d0b56ef6d06cf35a8b0bddf87ec1c0fc7ae028
2023-11-28 23:26:55 +00:00
drh
1f8c7c7053 Do not set the J subtype when the output is JSONB.
FossilOrigin-Name: 4f106b64fe8988435872806bd0a6c223b61f53af0dd1c47c847bb4eec4e03e27
2023-11-28 23:18:04 +00:00
drh
1ef232c0e1 Preserve flexibility in the format of the RHS of -> and ->> operators found
in legacy.

FossilOrigin-Name: 6231ec43adb7436195eb1497de39a6c13c6b4f1c5032e6ea52515d214e61fdbc
2023-11-28 20:33:20 +00:00
drh
1cab41e290 Attempt to get json_extract() working with pure JSONB only, and without
the use of JsonNode.  Mostly working, but there are some differences from
legacy in corner cases.

FossilOrigin-Name: 8c324af1eca27e86adc45622af4f3b06a67a3f968596ac58aa7434b1f6f05f3c
2023-11-28 20:25:23 +00:00
dan
0d4a888485 Merge latest trunk updates into this branch.
FossilOrigin-Name: 554fc13f2ca5f2ebd9ad0206034c25b556ff40db3106051c5e539f2e142e88ea
2023-11-28 19:43:08 +00:00
drh
ef97f8360a The json_remove() function now uses only JSONB, never JsonNodes, internally.
FossilOrigin-Name: b69786e746ae2b927b64d9871fd120b7f8f06cc53739fd46a4da51aa16cf8576
2023-11-28 18:16:02 +00:00
dan
940b23bc3a In SQLITE_ENABLE_SETLK_TIMEOUT builds, use blocking locks in place of sleep() calls when opening a read-transaction.
FossilOrigin-Name: 4c055b7a6e4533e1e571773456226ca7038ce372df3eedbbbcd9a81e8652a6cf
2023-11-28 17:12:42 +00:00
dan
b8950e0f45 Handle an SQLITE_BUSY_TIMEOUT error if one occurs while attempting a shared lock on a read-lock slot.
FossilOrigin-Name: 5fbf3906d272df3eb981f67455eb35f649ad2774cba9fc3f077b28d9bef3f0cb
2023-11-28 15:29:04 +00:00
drh
26cd4b57df Activate the ability of json_patch() to work on JSONB.
FossilOrigin-Name: 11aba347ff7c639500eec904e212eabe889b077351b946cfeac2b74b9703672a
2023-11-28 13:38:22 +00:00
drh
ec1f59f0cd All legacy tests are passing.
FossilOrigin-Name: 2c436806b8d5f57de99c00f6154b038454fb9ae427d00d7b4a46ab9c7c69bcb9
2023-11-28 13:35:53 +00:00
drh
5026ddb83d The json_patch() code for JSONB compiles and works sometimes, but there are
still issues.  Incremental check-in.

FossilOrigin-Name: e0099464a0045a04f4ccf29bc2b8325fc8c7f39ccf4847e74818f928c9153588
2023-11-28 12:28:28 +00:00
drh
f46f89df97 More aggressive use of jsonBlobEdit(). Improvements to the MergePatch
implementation sketch.

FossilOrigin-Name: fbca9570fd2e1465739e4d3a8d9bb40fad594fd78ab49b2cb34efa27ebdd8361
2023-11-28 00:27:58 +00:00
drh
eb04a0bb7b Add untested (#ifdefed-out) code for the MergePatch algorithm against JSONB.
Add (and test) the jsonBlobEdit() routine that is needed by the new MergePatch.

FossilOrigin-Name: 4d353387fc10e1038cfdd86e66007bf728c231a928e588897bbee0fbfe76f225
2023-11-27 23:46:12 +00:00
dan
bae2d0f2eb Have SQLITE_ENABLE_SETLK_TIMEOUT builds block when locking a read-lock slot.
FossilOrigin-Name: f797baf47cf7859cfd8ce248f4f3087af4551a7040af990333426e5a7c269504
2023-11-27 20:37:03 +00:00
dan
e52854a9e6 In SQLITE_ENABLE_SETLK_TIMEOUT builds, use blocking locks in place of sleep() when opening a read-transaction.
FossilOrigin-Name: a51ef39998e25e86bd0600e71d15011b12e05f4319608018293bdaecb09e8c97
2023-11-27 19:22:50 +00:00
drh
8a3034add8 Enhance the (SQLITE_DEBUG-only) json_parse() routine so that it shows a
decoding of JSONB when given a BLOB argument.

FossilOrigin-Name: af267868562e0799ad691dccad05f17afbc34d609eede8c55f57d209290246ef
2023-11-27 17:13:18 +00:00
drh
821a4c9f8c Give the json_valid() function an optional second argument that determines
what is meant by "valid".

FossilOrigin-Name: a4e19ad43dac81e7655ec03ff69bb99d1d02b0c227034c90fb41415fd4793fe3
2023-11-27 15:57:11 +00:00
drh
85eafe6f3b Convert the json_tree() and json_each() virtual tables over to use JSONB has
their internal representation.

FossilOrigin-Name: ec18caa3f7790b780dde66c1ccbb6eb09d2f1507629cc45955fc1b08380b4017
2023-11-27 12:36:29 +00:00
drh
b4e5bc6cdb All tests passing.
FossilOrigin-Name: b5a5660ca22437640c9bf32c44d92c76a7293dafcbaf4fa6a4c171128d64871d
2023-11-27 12:30:55 +00:00
drh
15c0b03c5d Fix corner-case error conditions.
FossilOrigin-Name: ec23d34ab75e1d7e9366e59c633e0d30def8759f6d4717583ebeb4c90aeccf0d
2023-11-26 00:56:40 +00:00
drh
50b37832b2 Same results as the legacy JsonNode implementation on a small set of test cases.
FossilOrigin-Name: c3da4b079a1a15a4c0b1a6e71f876648b1d9eb32eddc67b9946c2475c7b6d085
2023-11-26 00:48:37 +00:00
drh
e09a38c2e8 Remove unused elements from the json_tree() cursor.
FossilOrigin-Name: 914a50117d477b2cd30d58388fb8d1b71ff7ff6842ba025f38efc6e9647d06d0
2023-11-25 23:00:50 +00:00
drh
796abda538 Remove the vestigal JsonNode logic from json_tree() and json_each().
FossilOrigin-Name: 66c2ab9ebbf90477742e6be0d30e061d827c409de038f2a5b73479ed9448c4a6
2023-11-25 20:59:03 +00:00
drh
aea2d23121 Almost working. Path is still not exactly right when Root is defined on
json_tree().

FossilOrigin-Name: 92258246916a9c0d72785964513113848a850dec78bdade8b3f274e410df4e7e
2023-11-25 19:28:44 +00:00
drh
c2474105ca Generate the fullkey and path columns of json_tree().
FossilOrigin-Name: ffaa468ab8871906121df9ee5ef3dc00129a0086ed9c18831ecda69bf7f71455
2023-11-25 18:11:11 +00:00
drh
b7d5cb711a Handle the path argument to json_tree() and json_each().
FossilOrigin-Name: fded888469565b2a4687185a926bd23fccfbf167c8bebe6c10696fc7f972f41e
2023-11-25 13:40:19 +00:00
drh
5e6500c81c Continuing work on json_tree() against a JSONB.
FossilOrigin-Name: 3df891cb11feee65e239ee2506eda34a9688341f05210d7c2e25a05338cb71ad
2023-11-24 21:57:38 +00:00
dan
48cca2422e Add the --buildonly and --dryrun options to testrunner.tcl.
FossilOrigin-Name: a0c87ae9d3db914d18e2c8811db0d0ae3ad7b15c63de84fa975efce28bace27e
2023-11-24 20:14:18 +00:00
drh
abbdbdfc1f Incremental progress toward getting json_each() and json_tree() to work
directly off of a JSONB blob.

FossilOrigin-Name: f8cab41b3bc65af6ff34b481db693d640ea025d09463d50b8e56d855e2abc913
2023-11-24 18:44:00 +00:00
dan
88a61ff8ba Allow a pattern to filter test scripts to be appended to testrunner.tcl "mdevtest", "sdevtest" and "release" commands. e.g. "tclsh test/testrunner.tcl sdevtest fts5%".
FossilOrigin-Name: f8ea0b58b37f4052ded448e595d6d2992988a33b8ecfe58d68f20532f8cb5a37
2023-11-24 18:33:40 +00:00
larrybr
f5232b3a97 Get all CLI print calls which went to stdout in 3.44.0 to continue going to stdout.
FossilOrigin-Name: e9951ede184ce07cf725152723d795f299922460715ab76225cd3071bf0f18ee
2023-11-24 15:58:14 +00:00
drh
ab70266698 Fix jsonParseReset() to properly clear the JsonParse.aBlob element.
FossilOrigin-Name: ab2644aacf4757a51cf62e05cff6711a0a3605d60502a3dd310887df1b993545
2023-11-24 14:25:56 +00:00
drh
c0f8d58b21 Omit precompiled binaries from the source tree.
FossilOrigin-Name: 7dbc2f496d7a362460bb4c262ecafe5f30e35a8744861163d12c996365c2142f
2023-11-24 14:03:20 +00:00
drh
d47719ee02 Omit the precompiled binary from the source tree.
FossilOrigin-Name: 4ff103d294b79cf7734e87e94e9d88c0e9f0b087cbb352e6da2f0a3a6b268f46
2023-11-24 14:01:56 +00:00
drh
ac8b6e70c9 Merge the latest trunk enhancements and fixes into the jsonb branch.
FossilOrigin-Name: a838ebcbbd9f554fd84a1d3176fb572faaef7d0ec0675f1a5bf9430865dafae0
2023-11-24 13:41:20 +00:00
larrybr
77044f30a2 CLI .output/.once to not redirect ".timer on" results.
FossilOrigin-Name: ce766ed51f772a960d0b7a52c113b55c7ae90ef35050496d8e2a77547eab1a4d
2023-11-24 13:26:42 +00:00
dan
226aebae07 Fix an fts5 problem that could occur when mixing regular and secure delete operations on a single table.
FossilOrigin-Name: 8eb3f40021994f0d25ef9d246873796c84886e5951bb8ab991e1e2df31998484
2023-11-23 11:18:06 +00:00
larrybr
5d175eb020 Fix output redirect bug reported in [forum:/forumposts/cbf4933cfeee74bb|the forum].
FossilOrigin-Name: ce542fee6f0150bbd13505dcd26b21a9d1d23eb2dc8e78e63f9da6b4298ec028
2023-11-23 07:08:49 +00:00
stephan
a328c42724 Minor doc fix in src/betreeInt.h, prompted by an email report. No code changes.
FossilOrigin-Name: 30d49aaed20454fe006e2f89db58f0c0b2433c99b2676a0b9583f56b7adb7fdb
2023-11-22 22:59:28 +00:00
larrybr
92752a31d9 For CLI build with unused function warnings on, #ifdef out a console I/O function, fPutbUtf8().
FossilOrigin-Name: da36f90d94b3b55de71aa7965421ea850ac677e9e63d60744633c4dc59448de4
2023-11-22 21:24:50 +00:00
dan
41c9e0b767 Add documentation for new fts5 auxiliary function APIs.
FossilOrigin-Name: 9be8969edd49e3da96fb8ac2279aff6fe2e215d6ac55162b4734aca1b6316580
2023-11-22 21:15:05 +00:00
dan
af54826e4a Defer building xInstToken() hash-table until it is to be used.
FossilOrigin-Name: 9b005085ff4a53cda0a1dff0c836630d6d3b95b9c40658ffd2a886f3e1b37faa
2023-11-22 20:02:55 +00:00
dan
5c268bbf67 Fix tokendata=1 and xInstToken() APIs for detail=none and detail=column tables.
FossilOrigin-Name: 37b271c19d772bd06524db816ded03377b426efed7a7783c8a96f6fb156ecd86
2023-11-22 19:02:54 +00:00
stephan
c0314bc01d Correct the URL for loading sqlite3-worker1-bundler-friendly.mjs from sqlite3-worker1-promiser-bundler-friendly.js, so that the promiser can be used in bundler-using environments. Problem reported via email.
FossilOrigin-Name: 753a75218913c3b9c7ec5438387107369c34d1775d68b04d19ae18197e558605
2023-11-22 17:11:39 +00:00
drh
cf72606a7d Inserts invalid JSONB should return "malformed JSON", not a json path error.
FossilOrigin-Name: 306ee66fbd0231a9f5b229e5630d5cc66c9cf08b466d2d9204e79e1f44a16374
2023-11-21 22:36:32 +00:00
drh
27fea97e44 Direct editing of JSONB using json_insert() and json_set().
FossilOrigin-Name: fffb7a9538838e26991e6f16ea3138346a30c33ea6c3d3834680ee6d1f6eece2
2023-11-21 20:13:08 +00:00
drh
e1df37b947 Correct blob-to-text rendering in some corner cases.
FossilOrigin-Name: 7822e0e59f9b611fe6289cc762b0aff61f9b87c3a82c60de110f447589a2c125
2023-11-21 19:05:22 +00:00
larrybr
d9f3d6d753 Merge console I/O changes for Windows CLI.
FossilOrigin-Name: 935a8a8ee76d0014df42c1480e044fd1c2dfc26e78abb587d99d861d2ae5eb27
2023-11-21 18:26:06 +00:00
drh
664fe310b5 Fix the translation of JSON5 numeric values from BLOB into text.
FossilOrigin-Name: 40c4fb441f220982e4d61fd42597cf18546791a302fbcc8eec2eed29ee15ef35
2023-11-21 18:23:43 +00:00
drh
e97f295783 Merge all recent trunk fixes and enhancements into the jsonb branch.
FossilOrigin-Name: 6d78d50ed2357e6c943c1ef97b1d2ea0902cbadef90c2c35dccdbdc2bdf8702f
2023-11-21 17:54:55 +00:00
drh
8a4cecaea2 Make edits directly to the JSONB BLOB when the input to json_replace()
is a JSONB.

FossilOrigin-Name: d69c6acef54a81f46a97a05d443fe648635b4b70772069d6705ef829b718e985
2023-11-21 17:51:58 +00:00
larrybr
e788255681 Sync w/trunk as pre-merge-to-trunk sanity check.
FossilOrigin-Name: 448d6a1182d29940d5d34be2ce67df5601b688cd902dbbe97e95073f982a49ce
2023-11-21 15:55:31 +00:00
drh
a4050f1434 Fix the trace3-4.4 test to be more rebust against timing quirks.
FossilOrigin-Name: 8936daa08243729d8538bb7288bbefb43f3bd842a0d4b2e8019092f5701c2926
2023-11-21 12:02:04 +00:00
drh
4f77a27032 Back out an incorrect change to the sqlite3ExprCompareSkip() function that
was added way back on 2019-08-22 for [44578865fa7baf97|check-in 44578865fa7ba]
and which was only today discovered to be incorrect by
[forum:/forumpost/45ec3d9788|forum post 45ec3d9788].

FossilOrigin-Name: f5b3eb0fc8936ba274a7654ff6dfa7d4654bd8dbca7f3a5ec1134b0b5260d59d
2023-11-20 15:54:00 +00:00
drh
0fcaf16f20 Convert an assert in OP_VCheck into a branch that aborts the opcode, as this
can happen on some very obscure conditions, as discovered by dbsqlfuzz.
Test case in TH3.

FossilOrigin-Name: 7946c79567b0ccd3a00d12390e99896d7dc11407d0b52bc39338a16a493f56f6
2023-11-20 13:06:59 +00:00
dan
56bb07bad6 Fix an assert() in fts5 that could be true following an OOM or IO error in contentless-delete mode.
FossilOrigin-Name: 3fe89238c31ca163d021ef1fecde594328815aaba7053fef9e9c789562a62f45
2023-11-20 11:40:18 +00:00
larrybr
033127af75 Cherrypick shell1.test fix.
FossilOrigin-Name: 91c888eddbcb1b461f7d562c2f0eee57f1a2be7f9959b9d69e80fc7c1da20e9e
2023-11-20 00:21:24 +00:00