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
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
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
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
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
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
drh
276042bd23
Convert json_type() to use JSONB internally.
...
FossilOrigin-Name: 83074835b900ce85cf67059e674ce959801505c37592671af25ca0af7ed483f1
2023-11-30 19:29:56 +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
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
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
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
drh
ef97f8360a
The json_remove() function now uses only JSONB, never JsonNodes, internally.
...
FossilOrigin-Name: b69786e746ae2b927b64d9871fd120b7f8f06cc53739fd46a4da51aa16cf8576
2023-11-28 18:16:02 +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
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
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
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
drh
ab70266698
Fix jsonParseReset() to properly clear the JsonParse.aBlob element.
...
FossilOrigin-Name: ab2644aacf4757a51cf62e05cff6711a0a3605d60502a3dd310887df1b993545
2023-11-24 14:25:56 +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