Commit Graph

63 Commits

Author SHA1 Message Date
drh 3fb153cb29 Cache the JSON parse used by json_extract().
FossilOrigin-Name: 44ca6c2c4639f3c50ae9233ee299ff0fc4566462c31f28d8676f8de7ffdcd7f0
2017-05-11 16:49:59 +00:00
mistachkin b1ed717f18 Make USE_FULLWARN=1 the default for MSVC and fix harmless compiler warnings.
FossilOrigin-Name: 6bf673767b8e5cedef1acff795cbe524fab8db2525c06424db4e038934a33936
2017-04-14 14:50:34 +00:00
drh 8671538cad Fix a regression caused by the fix for ticket [6c9b5514077fed34551f98e64c09a1] -
control characters allowed in JSON.

FossilOrigin-Name: 8e7b611863247a3bf46a96ec4b47d24c0ae0d60c9cee968a1cfd1da157e7c9bb
2017-04-13 00:12:32 +00:00
drh ff6d50e973 Limit the depth of recursion for valid JSON in the JSON1 extension in order
to avoid using excess stack space in the recursive descent parser.
Fix for ticket [981329adeef51011052667a9].

FossilOrigin-Name: 1f68c184596912d742b50b1ca38252a9e783aacf121619a27b17a7ae9f6df041
2017-04-11 18:55:05 +00:00
drh e12e24ded8 Change the JSON extension so that it disallows control characters inside of
strings.  Fix for ticket [6c9b5514077fed34551f98e64c09a10dc2fc8e16].

FossilOrigin-Name: 475d8f82ec61a4ff3e6a7650731230ccecb6cc580d1397d189d0ba479d9bad4d
2017-04-10 12:25:05 +00:00
drh 9fa866a8d9 Disallow leading zeros on numeric constants in JSON.
Fix for ticket [b93be8729a895a528e2]

FossilOrigin-Name: 204e72f0080e8f08f99978870bd3cb9d59b068ecffee82192d707c650548b43b
2017-04-08 18:18:22 +00:00
drh 2fb79e9b04 Fix two harmless compiler warnings.
FossilOrigin-Name: 32be9c3faaafd736da3f49d475dc9279af4e4ba38070b60033d898345080acf0
2017-03-25 12:08:11 +00:00
drh ba7cce317b Fix a harmless compiler warning in the JSON1 extension.
FossilOrigin-Name: c2c3dd84534bb5ea81c974847b74a166c9cba1545fc749ce625929f303bf22e4
2017-03-24 19:45:05 +00:00
drh 29c9969871 Fix an error in the new json_patch() routine discovered by Ralf Junker.
FossilOrigin-Name: 9d5350418b2f6113e0b50c57e8a872006f27753067baf08ffdfa7943c0c9a148
2017-03-24 12:35:17 +00:00
drh 37f03dfb1f Change the name of the json_merge_patch() function to just json_patch().
FossilOrigin-Name: 04d4100445a3373986ee962618bc03ec304f6ba2f867c8e9eee415daffb593fc
2017-03-23 20:33:49 +00:00
drh 1fe162fd0c Avoid redundant edits in the json_merge_patch() function.
FossilOrigin-Name: 4a8e6437dd610c5376a07867a73e5a7e2ea90357a018e1788ecce6f4e10bc939
2017-03-23 12:56:44 +00:00
drh 0002d246a9 Fix harmless compiler warnings in the new json_merge_patch() logic.
FossilOrigin-Name: 5d2cf5a2f8afd88d041d89b3936042ce5a43629d23c48738cb2791b24da3e6af
2017-03-23 00:46:15 +00:00
drh bb7aa2d85e Various fixes to the json_merge_patch() function.
FossilOrigin-Name: f49fd2554b0723eb7cf2fd765d655c6820833ee7e5f7d7629d98c27a6fffa1d9
2017-03-23 00:13:52 +00:00
drh f07b249f92 Change the name of the new function to "json_merge_patch()".
FossilOrigin-Name: 53bf70f37bbca319ea35f70849e2a34ae628a504486158fdad5c4bb7431c68e0
2017-03-22 21:45:20 +00:00
drh 633647af75 Initial implementation of the json_mergepatch(A,B) SQL function.
FossilOrigin-Name: a267444039af519f088dd8f8ee33f686cc3071c087677075af2364ebc2587514
2017-03-22 21:24:31 +00:00
drh 666d34c791 Fix SQLITEINT_H macro usage in two extensions.
FossilOrigin-Name: 0803390c152141c9ab4e7a28406b2a5d72a5c2fa
2017-01-25 13:54:27 +00:00
drh 6850a63393 Fix OOM error reporting in the json1_group_object() SQL function. Remove
an unreachable branch from the JSON1 logic.

FossilOrigin-Name: b54098491531cd26ed461275ef4aae3d3ec9065e
2016-11-07 18:18:08 +00:00
drh 27b2d1b88b Replace some unreachable branches from the JSON1 extension with assert().
FossilOrigin-Name: 145cd13e3c5a42a717807bcc13c0f7212f38bff8
2016-11-07 15:15:42 +00:00
drh ad875e7416 Fix the JSON1 extension so that the JSON validator correctly rejects malformed
backslash escapes within string literals.

FossilOrigin-Name: 7a63539169a384960e30a63e0c8e9b0f07fa431e
2016-11-07 13:37:28 +00:00
drh b0df540d7a Fix other harmless compiler warnings.
FossilOrigin-Name: 90d2c490fc2ed4e073711b84f989ca4d496dcfb5
2016-08-01 17:06:44 +00:00
drh 2ad96f5880 Add the json_quote() function to the JSON1 extension.
FossilOrigin-Name: 2c3714aebf5e40e3728877a235b3c1f93defa33e
2016-06-17 13:01:51 +00:00
drh df3a907ecc Add JSON1 and FTS5 to the set of extensions subject to close compiler warning
analysis.  Fix some warnings in each.   More (harmless) warnings still exist
in FTS5.

FossilOrigin-Name: cfe2eb88b504f5e9b1351022036641b1ac4c3e78
2016-02-11 15:37:18 +00:00
drh 4a642b6060 Improvements to the way that OOM errors are processed.
FossilOrigin-Name: c3ef03478a5788c855b3aef385d43ae7f494f440
2016-02-05 01:55:27 +00:00
drh 3b7f9a68d5 Escape control characters in JSON.
Fix for ticket [ad2559db380abf8].

FossilOrigin-Name: 4f1b5229a3bbc9d40b7433a5eb3139d59d31dcb1
2016-02-04 10:28:57 +00:00
drh 2307926ea9 Remove unreachable branches from the new JSON aggregate functions.
FossilOrigin-Name: 6e30f8c6c3af9b0df39783888a1479f88271f989
2016-01-01 00:15:59 +00:00
drh ff135ae4c3 Add the json_group_array() and json_group_object() aggregate functions to
the JSON1 extension.

FossilOrigin-Name: 7f386a9332237100a345035ca213327e21d95855
2015-12-30 01:07:02 +00:00
drh 49472655d4 Fix the JSON1 extension so that it does not depend on isdigit() and
strtod() from the standard library when compiled into SQLite as part of the
amalgamation.

FossilOrigin-Name: bc9a9a60c31ebf9b11ac89ae5f99a3b66d6efc67
2015-10-16 15:35:39 +00:00
drh b9e8f59b63 Form-feed is not valid whitespace for json.
Fix for ticket [57eec374ae1d0a1d]

FossilOrigin-Name: 28957d635961c525f735a52b8ffe3e69ccf31382
2015-10-16 15:16:06 +00:00
dan 8d32e8042c Avoid exporting sqlite3_json_init() from amalgamation builds.
FossilOrigin-Name: 8463f7e7908d0a96ed036377dfa3805328c62925
2015-10-14 18:45:42 +00:00
mistachkin f2c26ed17b Fix a couple harmless compiler warnings.
FossilOrigin-Name: 7f896a971c5953d5370215ecd834d1fb711b4263
2015-10-12 22:20:29 +00:00
drh 9a4718ff73 Add some #ifdef-ery to json1.c to avoid a duplicate typedef when used in the
amalgamation, since some compilers become upset over duplicate typedefs.

FossilOrigin-Name: de28acd42f29693341feb884b7223cd3d2b96730
2015-10-10 14:00:37 +00:00
drh a0882fad7c The previous fix to JSON1 was not complete. A few more tweaks are needed
for correct handling of all oversized integers.

FossilOrigin-Name: 4a47f0177851721cdf6c981df962b6e8862372e7
2015-10-09 20:40:44 +00:00
drh 8deb4b8b17 Fix the JSON1 extension so that it renders integers outside the range
of -9223372036854775808 to +9223372036854775807 as floating-point numbers.

FossilOrigin-Name: ae736e35fb59c9aed33a8c805cf2ecdee528051f
2015-10-09 18:21:43 +00:00
drh 50065656f7 First attempt to add json1 and fts5 to the amalgamation. This check-in does
not compile.

FossilOrigin-Name: d820a1bd1b8dd702d1b3a099af393530cc5a5d51
2015-10-08 19:29:18 +00:00
drh 2f20e13b83 Enable adding JSON1 by appending the json1.c source file to the amalgamation
and compiling with -DSQLITE_ENABLE_JSON1

FossilOrigin-Name: 33404b2029120d4aabe1e25d484871810777e934
2015-09-26 17:44:59 +00:00
drh 8cb15cc5ae Another (smaller) performance optimization for the JSON parser.
FossilOrigin-Name: c43daa8c78df99f62dd4d3c83708a3a8eff92496
2015-09-24 01:40:45 +00:00
drh 9567794fd9 Performance optimizations on the JSON parser.
FossilOrigin-Name: 7dd4b07a42eb84589d34430b9d7bfa88fbd743eb
2015-09-24 01:06:37 +00:00
drh f27cd1f3aa Do not allow a comma at the end of a JSON array or object.
FossilOrigin-Name: 7c7a3f3e9bc2f7a7334d8d6eae183d83f22097be
2015-09-23 01:10:29 +00:00
drh 3d1d2a97a5 Futher simplifications to json1.c. Also an obscure bug-fix in the initial
output of json_tree() when using a path to an object contained within an array.

FossilOrigin-Name: fcb1e327a64134e5ac539ec3d52733422d3061fd
2015-09-22 01:15:49 +00:00
drh 8cb0c83cce Fix json_set() so that it can overwrite a value that was previously overwritten
during the same call.

FossilOrigin-Name: 0f16041647993975c316203c7e11f06e27640136
2015-09-22 00:21:03 +00:00
drh a8f39a9b5d Simplifications to the json1.c logic.
FossilOrigin-Name: 1646a2bd85f87d03a14fcaec288107f5f6411c6f
2015-09-21 22:53:16 +00:00
drh dc38495715 Fix a memory leak in json1.c that could occur after misuse of json_object().
FossilOrigin-Name: 394b81b11f261a9b179a034bc2a2d2dff0765e3b
2015-09-19 18:54:39 +00:00
drh 4977ccf143 Fix an off-by-one error (really off-by-2 in this case) in the buffer
resize logic of json1.

FossilOrigin-Name: d2a027372a5a6efc0f9b6f605093d865ae1c6788
2015-09-19 11:57:26 +00:00
dan 2e8f5517f7 Avoid passing (signed char) values directly to isspace(), isalnum() or isdigit() in json1.c. Cast the value to (unsigned char) first.
FossilOrigin-Name: 6713e35b8a8c997aa2717e86ce6dcd63bb993477
2015-09-17 17:21:09 +00:00
mistachkin 16a93128f8 Fix harmless compiler warnings.
FossilOrigin-Name: bfc7b84b766860d2e410702ba7c1166d7328309a
2015-09-11 18:05:01 +00:00
drh f5ddb9c214 Take out the goofy '$$' path syntax. Instead, use subtypes to communicate when
a string is JSON.  Add the json() function that validates and minifies the
JSON and sets the appropriate subtype.

FossilOrigin-Name: 8a80d6459e246ec1b38325e1cbd1e862157138b3
2015-09-11 00:06:41 +00:00
drh 383de6918c Create separate "path" and "root" columns in the json_each() and json_tree()
virtual tables.  "Root" is the 2nd parameter and is fixed.  
"Path" varies as json_tree() walks the hierarchy.

FossilOrigin-Name: 127cce3eb96b819005832997e0a082df9fb96f0b
2015-09-10 17:20:57 +00:00
drh 852944eb9b Fix the json_tree() scan for the case when a path is supplied. Add new
json1 test cases.

FossilOrigin-Name: 6adc7de76acee6cfb5ff761739e7a8de7b5bf4b2
2015-09-10 03:29:11 +00:00
drh 3ad93bba84 Enhance the json_extract() function so that if given multiple PATH arguments
it will return a JSON array with all of the answers.  Also update comments
within the json1 extension to reflect stricter interpretation of JSON and PATH
arguments.

FossilOrigin-Name: 1da60c3dda4254620052a83c853c2d2b6dd5009f
2015-08-29 19:41:45 +00:00
drh d29759288e Fix the build with -DSQLITE_OMIT_VIRTUALTABLE.
FossilOrigin-Name: 752918def7231f7846b3e985c9953a1cc825ab6b
2015-08-29 17:22:33 +00:00