aboutsummaryrefslogtreecommitdiff
path: root/src/json.c
Commit message (Collapse)AuthorAge
* Change json_group_object() so that it ignores entries where the labeldrh2025-05-24
| | | | | is NULL. [forum:/forumpost/e5bd251fb5|Forum post e5bd251fb5]. FossilOrigin-Name: 28215d131cd970a2756338579fb6b6091ab155be8f419505cae8ac918956165c
* Provide the SQLITE_BUG_COMPATIBLE_20250510 compile-time option that restoresdrh2025-05-10
| | | | | | the JSON5 bug fixed in the previous check-in, in case some applications need it for legacy compatibility. FossilOrigin-Name: 491cf31904fdbc9567b838d1ba27901e75f8ea3a117043017d08354bb09f9711
* Add enforcement of the obscure JSON5 syntax rule that the \0 escapedrh2025-05-10
| | | | | | sequence must not be followed by a digit. [forum:/forumpost/c061e87faf7d1c55|Forum post c061e87faf]. FossilOrigin-Name: 83c7477f2b9b0d6cb54cf6b14bf3c8ef4807e4bddc7986d275cf6717da8606b7
* Fix a harmless warning about and oversize shift operation on malformed JSONBdrh2025-05-07
| | | | | inputs. [https://issues.oss-fuzz.com/issues/415850463|OSSFuzz 415850463]. FossilOrigin-Name: cf8b55b3b6f0b73158e21731a206d5a8d8d9892989d91171a11c6dbbee34b338
* Remove an extra conditional that was inserted earlier today and whichdrh2025-04-21
| | | | | is unreachable. FossilOrigin-Name: 5ea56af2d27611c5a8ea275316d21a02e70032f93243549ae776e9a89edc6229
* Further improvements to the decision of whether or not a BLOB inputdrh2025-04-21
| | | | | is JSONB. FossilOrigin-Name: 6538813cb89f6109727481e29633e2e98f98e0257c58695e3b53e8ce237d9195
* Do a better job of providing bug compatibility with SQLite 3.44.0. Seedrh2025-04-21
| | | | | [forum:/forumpost/07e206fcd6|forum thread 07e206fcd6] for background. FossilOrigin-Name: 614d061b32c3bdf4825323d6f8e8a98624e4eeeb96dd442d8e365527122ed3bc
* Attempt to provide EBCDIC translations to the tables in the JSONdrh2025-04-16
| | | | | | | implementation. The SQLite developers do not have access to any computers using EBCDIC and so have no way to test this patch, and cannot vouch for its accuracy. FossilOrigin-Name: 84e698f38429c142caaa66ac086410f2035691b2ad39ad2fc4e0ebc31dd58a5b
* Fix a typo accidently added to the prior check-in.drh2025-04-01
| | | FossilOrigin-Name: fb2f283038f9329b6f791d92d6f943269f24f1a0efd5859165b63f517ed52ddb
* This is an experimental optimization that attempts to keep a JSONB valuedrh2025-04-01
| | | | | | | | the same size (same number of bytes) after doing a replace of an elements with a slightly smaller element, by denormalizing the size field. This can perhaps avoid unnecessary page updates and memmove() operations when making small changes in the middle of a large JSONB value. FossilOrigin-Name: b5de9584b7f49586c5387d8a74af5e41dba50f1817a54257bf9da00deb695f72
* Fix a harmless typo in a code comment.drh2025-03-31
| | | FossilOrigin-Name: dd251377bd1a8e95a4a0179c50595f290b08ea93659f4906f88f5a9dff534aa1
* Approximately 100 typo corrections spanning the whole tree, submitted via ↵stephan2025-02-27
| | | | | [forum:0db9827f0464bc33|forum post 0db9827f0464bc33] and individually audited and verified. Affects only code comments, innocuous test strings, error message text in tool (not library) code, and configure-level help text. FossilOrigin-Name: f50c21484d3cac73589da0376c423de39ae8b842218105786c5aa3726e4dcaed
* 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