drh
86db4555ca
Fix a missing zero-terminator on a string when processing
...
JSON aggregates into JSONB.
FossilOrigin-Name: fb81d570a3d9b8f55e9f278d5240605c5d0f3c5abde51550797999d03cf193a7
2023-10-11 13:19:37 +00:00
drh
2b7a1f5926
Fix an issue that can arise when processing corrupt JSONB.
...
FossilOrigin-Name: e50045c22296be84c6bea82bb8b310f07bca820c84d4a7349b16da0cf5d2657c
2023-10-11 12:44:17 +00:00
drh
33b56217cb
Improved robustness against corrupt JSONB.
...
FossilOrigin-Name: 0fbda92bb0eeb40f95c83f717e4e8f5bff1ac82f1c899e9f6d400d67df67214e
2023-10-11 12:21:29 +00:00
drh
2a96a1584d
Fix an assertion fault in json_patch() that can occur if the patch JSON
...
is malformed JSONB. Report the malformed JSONB instead.
FossilOrigin-Name: a72d54645ca0dd80c60a5ed586049dead3ea7f5fa9ad05c6610a506242a7032a
2023-10-11 11:42:06 +00:00
drh
71dc3c714b
Improved robustness in the decoding of JSON5 text escape sequences found
...
in malformed JSONB.
FossilOrigin-Name: 35e0108af2bdd830375c31c525f8ed0e8df64959d89649a88402dc1a5c376612
2023-10-10 23:02:31 +00:00
drh
6b7b23c580
Fix an off-by-one error in the changes from the previous check-in on
...
the jsonb branch.
FossilOrigin-Name: 216191b113da43516d31301fb133173add66358d503677ab997bc82cc88bfea4
2023-10-10 18:55:29 +00:00
drh
59ded6b5f1
Improved robustness when translating corrupt JSONB into JSON text.
...
FossilOrigin-Name: 0caa320d9099adbaf98e3719003dbdc4d158abcb3d8a1af20fbcd4c08c970f4a
2023-10-10 18:42:08 +00:00
drh
d88f378c7d
Fix a potential buffer overrun due to corrupt JSONB.
...
FossilOrigin-Name: 5cbb861fc6cb7421a81c957ba9d576e0ae92cb4ed725cdb539b364d66f4ee145
2023-10-10 18:32:14 +00:00
drh
064c1688da
Fix bugs uncovered by the fuzzer.
...
FossilOrigin-Name: c96eb7fb618dc0a5aeec8a5e85076475b77dcd56309438aba1f9bddfc8921e3c
2023-10-10 18:04:40 +00:00
drh
f32aa34346
Systematize the names of some of the translation function in the JSON
...
implementation.
FossilOrigin-Name: db44bd1d62084ef69c808f7d07e0a25d5a089dcb8b98b1b5d026777591bbdefc
2023-10-09 18:33:01 +00:00
drh
0dead8d3d1
Merge the latest trunk fixes and enhancements into the jsonb branch, and
...
especially the JSON cache spill UAF fix.
FossilOrigin-Name: 9422c24f4a8b290dcae61e50ec81be5b314b22c61a2bca1e194e47da1316b6e6
2023-10-09 12:57:03 +00:00
drh
faef28e6bd
Fix a potential UAF caused by JSON parser cache spill.
...
[forum:/forumpost/b25edc1d46|Forum post b25edc1d46].
FossilOrigin-Name: a163fecca90cab9d1b7bf8ebac78d498775eed7b6d81e7920e3401633c3a4b60
2023-10-09 12:46:53 +00:00
drh
a7e9386e88
Remove some unnecessary code. Report errors for invalid JSONB input on
...
an extract.
FossilOrigin-Name: cbea16c29eb0507f39b5a1cf744a3bb9bb7c71ac156e84a19d03a37cb1816891
2023-10-07 23:35:07 +00:00
drh
de8ccf00fb
The return from sqlite3_value_blob() in jsonFuncArgMightBeBinary() might
...
be a NULL pointer. Check for that case.
FossilOrigin-Name: 7b52b266b066f1385144c1103a3a411306db5f44568366ae1e93cd8cce799bbc
2023-10-07 19:46:22 +00:00
drh
3efb2c4791
Improved detection of malformed JSONB when parsing it into a JsonNode array.
...
FossilOrigin-Name: ed99a788415e1f8375bd5ec004dd18b1cd0fae4aa94558170882ca487f6dff93
2023-10-07 19:40:20 +00:00
drh
f26833d783
Fix the jsonbChangePayloadSize() routine so that it shifts the payload in order
...
to always render the most compact encoding of the payload size. This is
necessary as sometimes (as discovered by dbsqlfuzz) the payload size can
grow significantly due to json_insert() or json_replace().
FossilOrigin-Name: 8d6d04ca975ec55c419d40d8463c433b0db698c9fb4812ab9f16d4ee5bee460e
2023-10-07 19:05:10 +00:00
drh
1244b6cbf6
Improvements to error messages returned when the ->> operator fails.
...
FossilOrigin-Name: 2f3388f14c843f1c02926e8b929365c06c1f1f4ea6fe6316092c3799c14549d3
2023-10-07 17:50:06 +00:00
drh
bae197c175
Improved error messages from search on JSONB.
...
FossilOrigin-Name: 96cfdc31e305406123f6ef1b920423f71902dc4b34381c3efb720274343d37cc
2023-10-07 11:36:16 +00:00
drh
522e880bc2
Report unknown JSONB element type when parsing JSONB into JsonNode.
...
FossilOrigin-Name: 1f4d3268257bda234c66c3767451b3d39d7b4c7c73a779ad396d9dfc5315905c
2023-10-07 09:13:59 +00:00
drh
11aa2adca3
Correct handling of "raw" strings in JSON. This requires three test-case
...
changes in TH3 to add double-quotes to the path outputs from json_tree().
The new behavior is correct, I believe.
FossilOrigin-Name: ab2bf3e3596dfa7566f4a130adeccbef4056c7321181112a875477193583f30c
2023-10-06 23:02:06 +00:00
drh
6b8aa95c3c
Improved error detection for JSONB inputs.
...
FossilOrigin-Name: 6945e11aa441ace52b93cdbb81ac45b6f809987f3dbc522251e63f8cb948fddd
2023-10-06 22:16:09 +00:00
drh
7b4349735f
Incremental improvements to the JSONB logic.
...
FossilOrigin-Name: fe326829c27715e249f727ba797c7df6491e874ec205a0a82ee09c78d61c6e1f
2023-10-06 18:21:47 +00:00
drh
98dbfa69d3
Fixes to rendering JSON5 extensions encoded as JSONB.
...
FossilOrigin-Name: 5a17e4479aad2d8313170e5de83a1c52f30b55d9d4fb776024fa6622e175c63b
2023-10-06 15:35:42 +00:00
drh
e690d5ad80
Fix compiler warnings.
...
FossilOrigin-Name: 5227add3c8d509de2e081249163fafdf30ac3173a6d710957f3c3b6f03e7017e
2023-10-06 14:59:40 +00:00
drh
e1e2f2dcc5
Improvements to error handling.
...
FossilOrigin-Name: b41dd237fb6c0dd7daedeaaf81dbc4fdb31cf511fd32cd3d4ee69db34e389915
2023-10-06 14:52:49 +00:00
drh
91f3cd9874
Merge compiler warning fixes from trunk into the jsonb branch.
...
FossilOrigin-Name: 6409d307915f8969f12df2d5ffa961645bd4db7ccfbd6f52237a217b6a867252
2023-10-06 13:05:42 +00:00
drh
1935887a68
Ensure that all fields of static sqlite3_module objects are explicitly
...
initialized, in order to hush-up nuisance compiler warnings.
FossilOrigin-Name: f3b3d712d6e58b1cb8fdebd2b6b3125080b6b3ac8c7c849a8cc1e5e778d62fe7
2023-10-06 12:51:05 +00:00
drh
dd7f09e6c0
Improvements to coping with malformed JSONB.
...
FossilOrigin-Name: 563cde404cec4c6559ae0c5fc5edbc878fee874b36562ce2fac5049cc8349343
2023-10-06 00:06:26 +00:00
drh
27401d38d8
Better error detection when doing a lookup on a JSONB.
...
FossilOrigin-Name: 6e8e0eedbf06e175af6ef230f1ce9a5ad84698b1c6dcd2794d878c746e7b6be4
2023-10-05 23:05:35 +00:00
drh
f7af8f3270
Improvements to comments. No changes to code.
...
FossilOrigin-Name: ac74d7877685006e43684edd6a2d22be8c9857f9f9eb52fc5b3c182d5e2fdb8d
2023-10-05 22:52:43 +00:00
drh
dac2707152
Turn an unreachable branch into an assert().
...
FossilOrigin-Name: 0f75199160e48fa8c44f986f1af777adf19e40fbd114a6f58e24d5e6dede779d
2023-10-05 20:17:01 +00:00
drh
51d507d432
Fix the parsing of non-standard "Infinity" and "NaN" values from text into
...
JSONB.
FossilOrigin-Name: df1fbbeb83a2b4a496c9de0d86c7c8c677f8fe3bc770da163dcc1d338a17b58b
2023-10-05 18:33:19 +00:00
drh
5b6cfb7906
Change the json_valid(X) routine to return true whenever X is a blob that
...
could plausibly be a valid JSONB.
FossilOrigin-Name: 425f0b85a6f8ad0604c4a5faa18efb90436fedb1fe2612a559147c62cff8b7e7
2023-10-05 18:09:12 +00:00
drh
14fce24a9b
Fix the text-to-JSONB parser so that it handles some JSON5 floating point
...
literals correctly.
FossilOrigin-Name: 564edb3b6dd752e09e445e3a25c2f5394ceede2a2cdff251d6433dadc0b3644f
2023-10-05 17:52:39 +00:00
drh
0585d9f08f
Slightly stricter testing for when a BLOB is valid JSONB: If the element
...
is a null, true, or false, its payload size must be zero.
FossilOrigin-Name: 487781be8a93d9b8d870efb9f25822bb4bbcf9d39d571d1017e9c29043ea515d
2023-10-05 16:33:00 +00:00
drh
01acfd5805
Fix a memory leak following a syntax error in jsonb().
...
FossilOrigin-Name: bf4b36eda8e200b67041ebdf60fc31d0325bd84185272f8d390c56a91d6ac1ee
2023-10-05 15:05:33 +00:00
drh
9061e22a05
Allow the PG-style syntax for the PATH operand on the right-hand side of
...
the ->> and -> operators.
FossilOrigin-Name: bae5071b0834aa3b7fd4bd871f863e1b148c6558989c8f6cdd02dc4da4770953
2023-10-05 15:02:00 +00:00
drh
4500d87e76
Fix a memory leak in JSON group-aggregates when the output is JSONB.
...
FossilOrigin-Name: 08e7db138b636890cb29a76d65c2069c6e2ff44470fa4bca14f4526fe5f195ae
2023-10-03 22:40:22 +00:00
drh
f362731c1c
Fix a bug in the jsonReturnFromBlob() function that causes a positive result
...
for a negative value for when a JSON integer is too large and needs to be
converted into double.
FossilOrigin-Name: dca684da0c29ec78460362f972ea7747be42c13c4d1325da9d62c1ea58022e39
2023-10-03 21:54:09 +00:00
drh
51cc3041fe
Fix problems in the "json" output column of the json_tree() virtual table
...
for the case when the input is JSONB.
FossilOrigin-Name: fefa4475c496aab32fe7b9cc203747ce4faf7448da4f29b807e5486c7686238d
2023-10-03 20:58:39 +00:00
drh
6e737b9252
Improved handling of OOM while translating the JsonNode representing into
...
the BLOB representation.
FossilOrigin-Name: ef5956710bb542d6045c82937d02218a7ed45af94cf3959b0c180268e04d14e1
2023-10-03 19:37:19 +00:00
drh
ee0f6777f9
Fix a problem in the JSONB parser that comes up following an OOM.
...
FossilOrigin-Name: 355acfb18897254f6b6444a21d781b5e10e930b81952850dd2a40d88bbf2f3db
2023-10-03 10:59:01 +00:00
drh
8405e1140a
Fix an issue with the use of jsonb_group_array() and jsonb_group_object()
...
when used by window functions.
FossilOrigin-Name: 808bd349ba587fbcdc4aea3f9c08e0df01ba08dec181c5af5ea157e89d86ff7b
2023-10-03 10:43:30 +00:00
drh
e5c384e9a5
Fix jsonb_insert() so that it does not behave like jsonb_set().
...
New test cases added.
FossilOrigin-Name: 54197149b811d30b6c4487eedf5692b164ed0f90cfcc541aa3157094f5f17f6a
2023-10-02 20:16:06 +00:00
drh
dee29e8c7a
New test cases for JSONB.
...
FossilOrigin-Name: d624c31e5c49e1ce63b4b72caa42a61c5167866f47d842fbcfe4e826fd079d7c
2023-10-02 14:51:28 +00:00
drh
c97407fdba
Allow json_replace() to accept JSONB arguments as the new value.
...
FossilOrigin-Name: 95eb7b37fab29931924311f541d52173ef77a448efc8771b1a1783ccd786d23d
2023-10-02 13:35:06 +00:00
drh
8eeafb7544
Improvements to error handling for BLOB inputs on JSON.
...
FossilOrigin-Name: 14f20ecbfab44934e86f1ac7a3f745b989aa8190c6df119ff5aa8100fa248d93
2023-10-02 13:20:43 +00:00
drh
5624b0b4cd
Gather forward references into a single place for the JSON code. Allow
...
JSONB arguments to json_array() and json_object() and similar.
FossilOrigin-Name: c352201b8c299c330d9abbff6dbcbcbcf00ada53183d3cd91020ec772e066357
2023-10-02 12:40:04 +00:00
drh
9b176f863b
Fix problems following OOM in JSONB parsing.
...
FossilOrigin-Name: 0d8cd6b5fb592f88f593ceaad9cdfa95dcfdf14169c3a56a5becbd66d62fd02b
2023-10-01 18:59:34 +00:00
drh
7e86d3fc69
Finish adding jsonb_ versions for all JSON routines that return JSON text.
...
FossilOrigin-Name: 6daa7b69695e1b68dba317abbcad4d0205c91963d4a9eb2d595a3ec10fa0fdf4
2023-09-30 14:34:39 +00:00