aboutsummaryrefslogtreecommitdiff
path: root/src/json.c
Commit message (Collapse)AuthorAge
* Additional changes making it easier to prove that integer overflow does notdrh2025-02-17
| | | | | occur. No problems found. FossilOrigin-Name: e846743a875430a5c51d41f00ac9532214f97d9925e6261113b63580f92369fc
* Convert some expensive NEVER() and ASSERT() macros into assert()s.drh2025-02-10
| | | FossilOrigin-Name: 4aad891802d9d87f1ff3cbbf4bc70fa242c6782088189a2bd5d6f8863f552d29
* Small performance increase in jsonTranslateBlobToText().drh2025-02-10
| | | FossilOrigin-Name: 3b1dcac2eeaf5f97450919f2a6eed74a4d54fb2b812bdb4a580f79d075e99dfe
* Fix a bug in the parsing of some corner-case JSON PATH strings that containdrh2024-09-04
| | | | | escaped double-quotes. FossilOrigin-Name: 60ac55c4b76355aaf7cbde38bf1f6082ff5612bf4ffc49ab69d00fd4e3d64e64
* Doc typo fix. No code changes.stephan2024-05-27
| | | FossilOrigin-Name: eaf07fe69f383938dd394f58cedad3f16f146d9b48e66bc1ba17446cf75ffb3f
* For compatibility with PostgreSQL, when right-hand side of the ->> operatordrh2024-05-27
| | | | | | is negative, it should index from the right side of the JSON array on the left-hand side. FossilOrigin-Name: 82365a45b96536c1146a384e5d3efce80a6ec469a54713c7f40bf15eb834b5fd
* Fix the -> and ->> operators so that when the RHS is a string that looks likedrh2024-05-21
| | | | | | a number, it is still treated as a string, because that is what PG does. [forum:/forumpost/9e52cdfe15c3926e|Forum post 9e52cdfe15c3926e]. FossilOrigin-Name: de8182cf1773ac0d04268d896a613841cf6bf61f9f030342170657d5e06f2acb
* Add the json_pretty(J) function for pretty-printing of JSON. An optionaldrh2024-03-06
| | | | | | 2nd argument is text used for indentation, with a default value being four spaces. FossilOrigin-Name: 39552bd36c06fe9ee346cb71e0659baceccde031b67c0974f2dd14eb11ebc055
* The value returned by the json_each.json field needs to survive longer thandrh2024-03-05
| | | | | | the json_each virtual table itself, in the event that the value is used in an aggregate expression. dbsqlfuzz 5120bd0b3bb0b73eebbcb79ac37c6b0663fccad6 FossilOrigin-Name: 952ed71b9b61e79fe807ac3134bdfa7c94a415e02f13f94440a34d6d548d171e
* Fix harmless compiler warning seen with MSVC.mistachkin2024-02-22
| | | FossilOrigin-Name: e5db08993127dfc18cc2b621a13cbfef52974f0f504f4d8208093bfad1ffdcc5
* Fix the subtype on the value column from json_each/json_tree for casesdrh2024-02-16
| | | | | | when the value is an array or object. Fix for the bug reported by [forum:/forumpost/ecb94cd210|forum post ecb94cd210]. FossilOrigin-Name: 1c33c5db2e05019d1a375109f79ad8588a3c17f81e4f4b8d66c880c3c860e87e
* Detect and respond to an OOM on the jsonStringTerminate() call ofdrh2024-02-07
| | | | | jsonReturnStringAsBlob() routine. FossilOrigin-Name: 881f814c09b6896a448a2360b0b43dc99592ea3a1d72ac359770cbb0a2c7d38a
* Slight change to OOM handling in JSON to catch a corner case found bydrh2024-02-06
| | | | | dbsqlfuzz. FossilOrigin-Name: 6a2b3266c586d12b51e11fe63cda5881be9373207aa16671ab77f547830eb790
* Fix harmless compiler warnings seen with MSVC.mistachkin2024-02-04
| | | FossilOrigin-Name: e52c87420b072fa68d921eda66069542d50accbfaf1110ac4cc1543a4162200d
* Add NEVER() and ALWAYS() macros for the JSON5-control-character change.drh2024-01-31
| | | | | | Also fix an incorrect comparison used to determine if a buffer needed to be resized. FossilOrigin-Name: e3c0c0e686f3b7710f79587cf465b5aac52d8f2f2986a3de885a656f652cbfd3
* Fix failure to detect unterminated string literals in json_valid() in thedrh2024-01-31
| | | | | previous check-in. FossilOrigin-Name: 5d725644621cf640fb743d59ccf89dac777540410e67501eb00b83638c8c857f
* Allow control characters in JSON5 string literals.drh2024-01-31
| | | | | [forum:/forumpost/05182119f69c3a92|Forum thread 05182119f69c3a92]. FossilOrigin-Name: 34709c7cc910539e23a830ad8b589a97a88be25e924a59670c1017fb51447dad
* Fix a memory allocation bug in the (debug-use-only) json_parse() SQL function.drh2024-01-31
| | | FossilOrigin-Name: 32ce7dacf58bbf35cf70da8b03fa25f97fcea970edbc1f8aa12739ac4c8608fb
* Detect malformed nested JSONB earlier and stop rendering to avoid longdrh2024-01-29
| | | | | delays. FossilOrigin-Name: 72f3e1d0eca2b9ebd7c4b4cdccc6d7a0173b2fdb204cb1aa207917aedab6098a
* When generated text JSON from JSONB, do not continue descending intodrh2024-01-29
| | | | | | nested structures after an error is seen. This avoids long loops and wait times. FossilOrigin-Name: 97666ec052ebaceab002874d7ca5c5e6883c3d04fb7d3992235a8c4c8d08407a
* Avoid a potential buffer overread when handling corrupt json blobs.dan2024-01-29
| | | FossilOrigin-Name: 738473dc0ac353731080d0785cc7dc9810b564906c176916bd91d6cfbb1a7b18
* When rendering JSONB back into text JSON, report an error if a zero-lengthdrh2024-01-29
| | | | | | | integer or floating-point node is encountered. Otherwise, if the node occurs at the very end of the JSONB, the rendering logic might read one byte past the end of the initialized part of the BLOB byte array. OSSFuzz 66284. FossilOrigin-Name: b0eb279ea83c1c788c39fb90e178ec99fa4c782195c376a420c661fedf4545a7
* Fix typo in the tag-20240123-a in a comment.drh2024-01-23
| | | FossilOrigin-Name: 1f09541eb4203ccce476f6040ff134353850f22f07fb84f96a1d2c27b304a91b
* If a BLOB looks like JSON when cast to text, then treat it as if it reallydrh2024-01-23
| | | | | | were JSON. This replicates a long-standing bug in the JSON processing routines, and thereby avoids breaking legacy. FossilOrigin-Name: d79a37690ce7ebb91df203170d73511da44546328043c2b3fe1786b2f0087093
* The -DSQLITE_JSON_BLOB_INPUT_BUG_COMPATIBLE compile-time option causes blobdrh2024-01-22
| | | | | | | | | inputs to JSON functions that are not JSONB to be processed as if they where text, immulating historical bugging behavior which some applications have come to rely upon. See [forum:/forumpost/012136abd5292b8d|forum thread 012136abd5292b8d] for discussion. FossilOrigin-Name: 65572223583d43e1d61ec029641f9d3ff340e68ecfba8342c8d1b0a91a680f2a
* When backing out a character in a constructed string in JSON, first make suredrh2024-01-20
| | | | | | the string has not been reset by on OOM. dbsqlfuzz 2fffbea91a5376526ea118d4fe4188c8dd35e317. FossilOrigin-Name: 666690eb433fe38fa527ccbbb8e2c00041a33939da4f6b8bfb737d664f28f0d8
* Clutter the code with "fall-through" comments in order to suppress nuisancedrh2024-01-16
| | | | | compiler warnings. No logic changes. FossilOrigin-Name: 05d2cf5e90d2a6b8e7fbcdb9e12e7c1281db7cfbe212997bd63c8aa66797edda
* Convert the JSON functions to use lookaside memory allocation wheneverdrh2024-01-03
| | | | | feasible, to avoid hitting the global memory allocator mutex. FossilOrigin-Name: a79a244954f728596da3c0e28fa3b887258d1bd831f53881970f418f3fba84c7
* Performance improvement by unwinding a loop in jsonAppendString().drh2023-12-28
| | | FossilOrigin-Name: 190ab3c08431a0ba24d76392eab251f5c1792add05e4ec780998b299208eca95
* Enhance the (undocumented, debug-only) json_parse() SQL function so that itdrh2023-12-28
| | | | | | returns the text rendering of the JSONB parse of the input, rather than printing the rendering on stdout. FossilOrigin-Name: 056de8d551dcbdf1d162e2db15ed418fa9c786f900cd3972ef8a1dea3f4f3aa1
* Improved handling of malformed unicode within JSON strings.drh2023-12-26
| | | FossilOrigin-Name: e252bdf5f5de26ba8e2bcc6b0ad94121ed6fc4d86c02fe4a2a058ada93747beb
* Add internal core-developer-only documentation of the JSONB format.drh2023-12-21
| | | FossilOrigin-Name: 4d30478863b2a60512010de9ec6e3099bfaf75d4afee20acec536713fe94334d
* In JSON - minor code cleanup and refactoring with a small size reductiondrh2023-12-19
| | | | | and performance increase. FossilOrigin-Name: 215fabda38daecdbd38b1eca5a6aafbc61b6a36a8303f1d7164d5a1138e63134
* Remove a stray comment in the JSON code.drh2023-12-19
| | | FossilOrigin-Name: 6618bdf0679405b43911ea8cd94050b12a5dc469f3dfe4759ee3ff850a55229e
* Add NEVER() to an unfalsifiable branch.drh2023-12-18
| | | FossilOrigin-Name: 9a0c67db366d38a0b0741f6a1ae333cf27cfe6f6b7c6eed94bdec9686f9f9f8a
* Fix JSON to JSONB translation so that it deals correctly with Infinitydrh2023-12-18
| | | | | and NaN. FossilOrigin-Name: 178cb84f36bdb45ba17511900d6d8ea8dfa14912fc5bf7094a20348174a36c95
* Ensure that the insert/delete size delta on JSONB objects in the JSON cachedrh2023-12-18
| | | | | are always set to zero. FossilOrigin-Name: 4b4581668a908473dbf1322a3e98bc7cca122998c44518ea183af7f0d1ba9f95
* Fix harmless compiler warnings in JSON and FTS5.drh2023-12-14
| | | FossilOrigin-Name: 90135efccfeb1046f002bfcbd8dfec9a1a3b40cbe1b5c714ae065b06368e354f
* Bug fix in the JSONB validator.drh2023-12-13
| | | | | dbsqlfuzz ac6fa521a08609a642198e7decf64180e750b3c4 FossilOrigin-Name: 3e940a6a08b0a0434650cd3d8dd286e09ad8ab805b0a4d515e57bba5d3608577
* Improvements to UTF8 handling, and especially the handling of invalid UTF8,drh2023-12-13
| | | | | in the JSON routines. FossilOrigin-Name: 1b229c1101d6c384a30f343c5e47b471ab084b2d8e81170eb8f642afc1c67e3b
* Fix the JSON object label comparison object so that it works correctly evendrh2023-12-12
| | | | | if the label ends with escaped whitespace. FossilOrigin-Name: 4d5353cadd7b7c5f105bc197f3ec739e2d041472d6b3e939654c9f9cfc2749ae
* Add NEVER to two unreachable branches in JSON.drh2023-12-12
| | | FossilOrigin-Name: c96ebb086feb89341565cc52b970ae7799ce1327fe1ad4fc790f1b0dcaa6e229
* Improvements to JSONB validation - catch more cases where the input doesdrh2023-12-12
| | | | | not conform to spec. FossilOrigin-Name: be1864eac4eb75cc30bf98f73092c8608467f4bd956240df6a0cbea9f1e09e85
* Validity checking of text nodes in JSONB.drh2023-12-12
| | | FossilOrigin-Name: fa5160687c2f970d407e8af73c246f7cd806bb4ce35f29a79ac534a8646a6c8e
* The json_error_position() function now reports an approximate byte offsetdrh2023-12-11
| | | | | to the problem in a JSONB if there is a problem. FossilOrigin-Name: 80d5d94dff6a2d2557039be3d7d47c1a6003c4b98defe0bd411acfeb963ad5dd
* json_error_position() now uses jsonValidityCheck() to find the approximatedrh2023-12-11
| | | | | position of an error in a JSONB blob. FossilOrigin-Name: c3d60cf7028a333b825d5b89516945a73e0c158ac81d8bcc117d21bfd98602c8
* json_valid(*,8) allows minus-signs on hexadecimal literals.drh2023-12-11
| | | FossilOrigin-Name: c0d7f4520d839a268b3fd2474d0897a9832aa608bd6238b3e287fabecf07a350
* Rename the new test-control to SQLITE_TESTCTRL_JSON_SELFCHECK. Make it sodrh2023-12-11
| | | | | that the current value of the setting can be interrogated. FossilOrigin-Name: 7aff1d9a4cb17ecd5abab21ab032f35a78741dd641ddd8cbcc85fc4a81a0707d
* Add SQLITE_TESTCTRL_VALIDATE_JSONB, which if enabled under SQLITE_DEBUG causesdrh2023-12-11
| | | | | cross-checking of generate JSONB. FossilOrigin-Name: b410a4db74a650003539ffaaea18519d5159b504daac47db6a4874b730f40ac8
* Work toward enhanced functionality for json_valid() with deep checkingdrh2023-12-11
| | | | | of the JSONB (second argument has bit 0x08). FossilOrigin-Name: c370d573198b151767f04e91bf8baa4ae0076751ae468c5709742a0b0ed16770