Commit Graph

28 Commits

Author SHA1 Message Date
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
drh d1f0068d19 Do not consider an empty string to be valid JSON. Add some additional
JSON test cases.

FossilOrigin-Name: fd19ff029f128f478f69910352a6f8b84262ce1d
2015-08-29 16:02:37 +00:00
drh a771402e55 Change the json1.c module so that it throws an error if any of the
JSON selector paths are malformed.

FossilOrigin-Name: 3aa0855fd463076fc3277f1d9fe00d2f30e6b449
2015-08-29 00:54:49 +00:00
drh f2df7e71d6 Back out the json_check() routine. Instead, throw an error if the input to
a json function (other than json_valid()) is not valid JSON.

FossilOrigin-Name: dc9ce7b18cbe23d065317757234ef9fb8792da7a
2015-08-28 20:07:40 +00:00
drh f6ec8d4f4c Add the json_check() function, which returns its argument if the argument
is well-formed JSON or which throws an error otherwise.

FossilOrigin-Name: 64abb65d4df11e5b3bcc4afc8e7c18e907c6080a
2015-08-28 03:48:04 +00:00
drh ecb5fedb3f Enhance the json_insert(), json_replace(), and json_set() functions with the
ability to add JSON instead of text if the argument is text and if the PATH
begins with '$$' instead of just '$'.

FossilOrigin-Name: 44f103d8862abc2d5613bac04dc2ea8e625b1f40
2015-08-28 03:33:50 +00:00
drh 80d874083b Improvements to JSON string dequoting.
FossilOrigin-Name: 196d66d34d9783622e6f2f79eafea1488fc6f5cf
2015-08-24 12:42:41 +00:00
drh 442a7c6015 Fix corner-case problems in the type and atom columns of json_each() and
json_tree().

FossilOrigin-Name: f0aba0e120074430cd7ad93291fcc97b8a25a054
2015-08-24 02:32:04 +00:00
drh c3722b2103 Fix minor glitches in the json1.c extension, mostly having to do with OOM
behavior.

FossilOrigin-Name: cc5204149c4053b9e529a72102d8df0925ad1ea1
2015-08-23 20:44:59 +00:00
drh 8784eca17f Fixes to json_each() and json_tree(). Improved json_parse() debugging output.
FossilOrigin-Name: fc1b24f316af07a64672f6edc14ebcff487dffbb
2015-08-23 02:42:30 +00:00
drh bc8f092ca1 Add the json_valid() function to the json1.c extension. Fix various minor
problems in the json1.c extension.

FossilOrigin-Name: 380a97345b446214843a63ccc017d49a52d884da
2015-08-22 19:39:04 +00:00
drh be9474ee05 Fix a couple instances of OOM handling in the json extension.
FossilOrigin-Name: 213a6c5ccbcfe4495d45e3608e99a6398751aeed
2015-08-22 03:05:54 +00:00
drh 6fd5c1e0e8 Fixes for compiler warnings and errors in the makefiles. Rename the
one test script to json101.test.

FossilOrigin-Name: 9ff6ccde5f26f18073587c320290570854ffc833
2015-08-21 20:37:12 +00:00
drh f28ed795db Change the name of the json loadable extension to "json1.c", in anticipation
of having future major changes to the interface.

FossilOrigin-Name: d0d4bec9e3d8829a2d488f2742f1650214fa716a
2015-08-21 20:12:43 +00:00