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
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
drh
9c794b9bff
Continuing simplifications and code cleanup.
...
FossilOrigin-Name: ddf92b5059a9106753fd18b82ba8daa269a62af947561c460790107b83416f0b
2023-12-04 17:40:28 +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
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
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
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
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
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
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