Commit Graph

25957 Commits

Author SHA1 Message Date
drh
016f46666b Fix indentation and omit trailing whitespace in the random JSON generator
script.

FossilOrigin-Name: 629db09fceb7bf37561b52ccee06ebf4df261291e9a8ffcca82b243f6db5ff07
2023-04-28 13:25:35 +00:00
drh
1170fb52e1 Fix json_tree() so that it is able to deal with the JNODE_RAW labels of
a JSON5 object.

FossilOrigin-Name: f56528d413d8e622f7c4f18b2f9f2e620bfb441c020461299b35a90072ee6c13
2023-04-28 11:02:01 +00:00
drh
ea2529528e Merge all the latest trunk fixes and enhancements into the json5 branch.
FossilOrigin-Name: b5ca15cfc19380cf870b70be6a86e70f2026cc3d6d89005b45891d58c4f11c2d
2023-04-28 10:23:01 +00:00
drh
90f549a0cf Do not assert() a bad string representation in an sqlite3_value after
an OOM.  dbsqlfuzz c822a17a23c524a0ac7cfb203c7198209da15de8.

FossilOrigin-Name: 91fee79a01971259b21478e60a069a711a00efc79ddfececa6224a152cd8d09a
2023-04-28 10:10:52 +00:00
larrybr
fb016bf257 Make CLI .load slightly harder to abuse.
FossilOrigin-Name: 2779f9270cc431786d0e16ef05ec05b0f22dda2307f3bf17467ad0b25304e160
2023-04-28 00:28:06 +00:00
drh
fe03773305 In the CLI, early out from the output_quoted_string() routine if the
input string is NULL.  [forum:/forumpost/8a22c0bfa7|forum post 8a22c0bfa7].

FossilOrigin-Name: 2881978d7b7014738a21c590b0430c4fa40e6b00b9547d0284b7656124523ae9
2023-04-28 00:19:55 +00:00
drh
93b4c3beb8 Use a new technique to detect fresh OOM faults in columnName() that does not
rely on there being no OOMs prior to entry into columnName(), as
[forum/forumpost/fb6811c2f9|forum post fb6811c2f9] demonstrates a technique
which could cause an OOM prior to entry into columnName().

FossilOrigin-Name: a63346d6a0c0ca7ba4c87499de2e461be9c77e9b5d98f2bebf308cdb6599f33c
2023-04-27 23:59:51 +00:00
drh
bfd28f9e01 Remove a faulty assert() from the CLI.
[forum:/forumpost/726c4f7db0|Forum post 726c4f7db0].

FossilOrigin-Name: 4bbebb6bfb9910265d91b777c1711b3b8e0732bcf299f7459b20c4ea110422bd
2023-04-27 23:44:38 +00:00
drh
d5de1f39b5 Remove an ALWAYS() macro that can in fact sometimes be false.
[forum:/forumpost/f0e872fcee|Forum post f0e872fcee].

FossilOrigin-Name: d85880e4ed89e2198beea642818051f7a91a71fea9929be0a7ed0603b493ce47
2023-04-27 23:40:03 +00:00
drh
52da6d2607 Test cases added, and some bugs fixed.
FossilOrigin-Name: bc84a82e4ddc1b71025c56c49e62a44f0b12fa87a6417ad61967d9d3121a0d4e
2023-04-27 23:29:09 +00:00
mistachkin
263b86c54c Fix compilation issues seen with older versions of MSVC.
FossilOrigin-Name: 4ba2a651120391d779a3db9881c0fb17e1322cc9d8738f915a46e31a2f313578
2023-04-27 22:17:12 +00:00
mistachkin
cf5dce045f Adjust OSTRACE usage so that it works with the changes in the previous check-in.
FossilOrigin-Name: 1eb4573e9092d350d00d05ba716cb0272e2dbb1ecbaadc2a7cc22de0b8cc2bda
2023-04-27 21:31:21 +00:00
drh
ae31f48826 Further optimizations to the JSON parser.
FossilOrigin-Name: bb8f1c16f244f893170f3d03bc445bd15fc337804c7c3e76c548397f5b95b39a
2023-04-27 19:30:53 +00:00
drh
1371df2117 Faster implementation of numberic literal parsing in JSON.
FossilOrigin-Name: 58398292e8473b0b9e4b77dd5ed27334bc24a85d0c399e8d0b86de6fb59dadce
2023-04-27 19:13:20 +00:00
drh
49d8e0ef97 Add support for hexadecimal integer literals in JSON.
FossilOrigin-Name: 85e00c9e68d0695592e8f72555ee133c096bfca5a860a8e21d1e0ef756705aaf
2023-04-27 18:28:10 +00:00
drh
47dd0e735d All floating point literals "NaN" and "Infinity". Additional variants
of these literals are available if compiled with SQLITE_EXTENDED_NAN_INF.

FossilOrigin-Name: c13346afbecb92275e741252897d00478dab4be2d158889bc735e80efd9444f5
2023-04-27 17:32:29 +00:00
drh
8ded164200 Fix handling of reverse solidus in string literals. Allow decimal points
in floating point literals to occurs and the beginning or end of the mantissa.

FossilOrigin-Name: d92a6ab2871095ac66c60cfa15dbafa7b762f83d287d452f61792eb30cf5b26b
2023-04-27 16:57:14 +00:00
drh
dbcea23976 Fix the handling of escape solidus in the JSON routines.
FossilOrigin-Name: 676877aca235e620ee12d10235dd6ad009d4968455ec170daeb1998b94a7e0a2
2023-04-27 16:24:12 +00:00
drh
13f8a80d94 JSON string literals may span multiple lines by escaping new line characters.
FossilOrigin-Name: 66da4bd4a30c390fa1a7960ce2edaef82e63971ecf33ffb6b906db9f278041c5
2023-04-27 15:48:58 +00:00
drh
ef3a162be6 Allow the labels on JSON objects to be unquoted identifier names.
FossilOrigin-Name: fb428db3f64f148ab9a3478fdcc8b3733e58102b3c8895a482e2551d974d5661
2023-04-27 15:11:26 +00:00
drh
0d8579120a Performance optimization in the JSON parser.
FossilOrigin-Name: 5a88ba743f55d45b1c0ce0090bb3b396bcf7fcf7b3bcb989aaf30b8bb772599e
2023-04-27 14:38:51 +00:00
dan
2e225a35b4 Fix a problem on windows sometimes causing SQLITE_NOMEM to be returned if an error occurred while opening a temp file.
FossilOrigin-Name: c22a39a6b28e3039fe453c0c0db98744b8a63ef9063cc3f6e0ed67d2506d34be
2023-04-27 13:55:29 +00:00
drh
a549e7a527 Permit JSON5 whitespace in all contexts of objects and arrays.
FossilOrigin-Name: 93f3ab26b57c0469862a56e97d4b3c796b27f9f582046fcff1f2aa8d8910c550
2023-04-27 13:44:26 +00:00
drh
f59c01e24c Translate JSON5-only string literal escape sequences into the JSON equivalents.
FossilOrigin-Name: 14e82f36eed31af1237898728bf353b968523c62b1f8d1d90dbbabd92d0c2834
2023-04-27 12:24:00 +00:00
drh
c5ee2d8e80 Implement some of the JSON5 enhancements to string and numeric literals.
This is an incremental check-in of work in progress.

FossilOrigin-Name: 9508efa9d61c0ff0eb73100dd52889dadc5fa2a2091b944a9b8a74e8a5c50e82
2023-04-26 20:26:14 +00:00
dan
6a9ba9a8c2 Fix a typo in a printf() format string the sessions module.
FossilOrigin-Name: 14d1c4a828660bc137dcea1bb4cc439e1ed3872867a0dab486f6a639ef3bcc45
2023-04-26 18:50:49 +00:00
drh
d924af2325 When changing a large integer into a floating point value, cancel the
string representation.  Fix for
[forum:/forumpost/5c74a3bc4a|forum post 5c74a3bc4a].

FossilOrigin-Name: 3e2da8a7e35c839128d26aac575605e1e34889e8ab3484440bdd65c4d752c6bb
2023-04-26 18:23:47 +00:00
drh
f14b2e35fa Partial implementation of JSON5 numeric literal extensions. Use a switch()
statement in the parser for better performance.

FossilOrigin-Name: 78404dc37024cad5fe7eacf78ea85b56f08b129a1b9a046c3e1b11275068a485
2023-04-26 17:30:28 +00:00
drh
5255102e04 Improvement to the way the JSON performance measure scripts work → keep the
test database in the directory of the test, not in the source tree.

FossilOrigin-Name: ac411dbdcbf0b9040fb5b7de173271f383a6aa303d57f22ebd200809a5b4a6d3
2023-04-26 15:58:08 +00:00
drh
f62518f65d Work toward implementing JSON5 whitespace. Untested and incomplete.
FossilOrigin-Name: d262c059455ebe0650a45a6c1c04d1baf9609c635df352732dd192426e1bdc39
2023-04-26 15:19:19 +00:00
drh
ddc8b9ee0e Fix to the json-speed-check.sh script.
FossilOrigin-Name: d839c9544d7f28c1abc779eb2d40f95c1a9386984656fbd29d19b1e7830171bc
2023-04-26 13:52:20 +00:00
drh
02efa7be96 Add scripts for JSON performance testing.
FossilOrigin-Name: 3051d6a7c12cbf86634d8fab64f3f3bc9a1eb184260e56a82eb543cb634ba7ef
2023-04-26 13:25:30 +00:00
drh
058f3dbb27 The json_valid() function only returns true for pure JSON. JSON5 (or
at least that subset of JSON5 that has been so far implemented) is accepted
by all routines, but json_valid() still returns false for JSON5 inputs.
The new json_valid5(X) routine returns true or false if X is or is not valid
JSON5.  All of this is experimental and subject to change.

FossilOrigin-Name: 5d33ab77800765c8b3a13ffcc02ba8a348d71b2b425924560418b517d723494d
2023-04-25 21:24:20 +00:00
dan
69d98d9f93 Allow the sessions module to be configured to capture changes from tables with no explicit PRIMARY KEY.
FossilOrigin-Name: 5d4431bc44e206f48f3bcc1f51399b38bd4cb418e7e50a37495475fb8da04646
2023-04-25 20:41:19 +00:00
dan
77a159212b Remove unused variable ltoj accidentally added by [1783655e].
FossilOrigin-Name: faa1575ce0a39a2335a77057e8769a4e67aedd6326b4627988d03f0cb21fc39a
2023-04-25 14:54:18 +00:00
dan
0941ea8a62 Avoid assuming that an expression in an ON() clause that evaluates to zero implies that the query will return zero rows when the query contains a RIGHT JOIN. [forum:95849acbe1|Forum Post 95849acbe1].
FossilOrigin-Name: 1783655ea422185e75593b89e4ef452a6f5496aefd389f88ce7fe4b7d41d6a98
2023-04-25 14:37:12 +00:00
larrybr
38c2052767 Handle newline-trimmed input TEXT correctly in base64, base85 UDFs.
FossilOrigin-Name: 8f637aae23e6638c064a34262dcf16a3cdfd000fb1fa1b2a834b292fe6659408
2023-04-25 04:28:39 +00:00
larrybr
21461407f6 Check for OOM sqlite_value_x() returns in base64, base85 extensions.
FossilOrigin-Name: e6f9c0b1f963033a8e17d13935c5c6b12d263fe10c585035a3d1f1154c6ba5d6
2023-04-25 02:44:53 +00:00
drh
be5bada4d0 Allow trailing commas in objects and arrays of JSON.
FossilOrigin-Name: 4031b231c223db598b45dbd192b027a99a9b82a981d43c75f723a3fb06720b82
2023-04-24 23:14:34 +00:00
drh
7eff609d8a Update the compile-time detection of architecture byte-order in the RTREE
extension so that it is aligned with the latest enhancements in the core.

FossilOrigin-Name: 122431d3a7267ec83768316ab146c0557fb6c0577a4a47ac6ed3d7aa6811ca9a
2023-04-24 19:23:42 +00:00
dan
655a1b7b58 Allow the sessions module to be configured to capture changes from tables with no explicit PRIMARY KEY.
FossilOrigin-Name: 8a612f0860126c0c8473b1e65fcabb9a8821d8bf09fdf3f6018acfc99df9af71
2023-04-24 19:22:21 +00:00
stephan
92df71a360 Add a note about the journaling mode in the OPFS VFS. No code changes.
FossilOrigin-Name: e79c95fc130fc302719690eb6391d96070aff825b2b51ef6c4ad459d9a8918d7
2023-04-24 04:25:42 +00:00
larrybr
022a042897 CLI to have "undocumented" dot-commands, not usually shown by .help
FossilOrigin-Name: 17f5dd2d2ae02a95180b9208b7de805922ba20271d3263e3193f0d46f4ec324c
2023-04-23 00:12:23 +00:00
drh
223c6b48a9 The sqlite_stat4.idx field is case insensitive. It should work even if
some entries use a different case than others.  Fix for
[forum:/info/6c118daad0f1f5ef|forum post 6c118daad0f1f5ef].

FossilOrigin-Name: f097ca70b5b967d1aadebd74ac5020813e00b7c30cc543814dbf5f359d1328f1
2023-04-22 22:32:19 +00:00
dan
4d24eff8dc Avoid a crash in fts5 when combining an empty expression with another.
FossilOrigin-Name: 33681ff3d29c9f096dbd8c5d885993f780e93974a7653adc00fa41a158356d7c
2023-04-22 20:47:08 +00:00
drh
2f251f4929 Enhance the ".tables" command in the CLI so that it is able to deal
gracefully with an OOM situation.

FossilOrigin-Name: 5157fd1cf753b1c01c6c00e9ac2712da2631a673837ed15ec3420ec869ee66aa
2023-04-22 20:22:17 +00:00
drh
f661db3050 The assertion-fault fix in [53a61f7423a7f057] was not quite complete. This
additional change enhances it to deal with WITHOUT ROWID tables.  No changes
to deliverable code.

FossilOrigin-Name: 4d5af42c651bc1655a4f09b743f2a1424f19c1e4248e041b3fd4a042fd1f9799
2023-04-22 20:07:48 +00:00
drh
57114c256f Add the --unsafe-testing command-line option to the CLI. Without this option,
features of the CLI that are intended for testing and that might result in
incorrect answers, assertion faults, and/or corrupt database files if misused
are disabled.

FossilOrigin-Name: f28256a96af4263c0caded79b7481b88e9c7e7f1af7dbb3fd5e22ff07fbedaf3
2023-04-22 17:41:53 +00:00
larrybr
e945b29359 Add --unsafe-testing invocation option to CLI. Needs some tests added and changed.
FossilOrigin-Name: b3d9ac052d5c2dd1afeeeb5c9cfac9dd91a1b8d6a74a2ef10aa2037ca505abce
2023-04-22 16:46:38 +00:00
drh
a9c4c82ef1 Fix an incorrect assert() statement in btree.c as found by
[forum:/info/d03345d572713fe6|forum post d03345d572713fe6].

FossilOrigin-Name: cd485b302c54aef066d751a153df34eea0cd23e54a414e291f636ad9929fe78a
2023-04-22 12:47:16 +00:00