Commit Graph

27053 Commits

Author SHA1 Message Date
drh
6e2b63893c Add the "tool-zip" makefile target with the intention of using it to build
the "sqlite-tool-*.zip" deliverables.
deliverables.

FossilOrigin-Name: 06e4af492d669bb45c00b1b876cd82ec8813ac9ed580eb1dddd18147f7fbe7f6
2023-09-07 13:43:46 +00:00
drh
dd69129f2a Fix a problem with the new xIntegrity method for virtual tables, and also fix
a bad assert() in FTS3 that was found by the new xIntegrity method.

FossilOrigin-Name: 52bbf44f2d9addc2b5f68b0fe33542470852310ce3a283e2c7ff4c52831d0ed1
2023-09-07 02:13:01 +00:00
drh
93b461ff00 Add documentation to sqlite3_get/set_clientdata() to make it clear that these
are security-sensitive interfaces that should not be exposed to potential
attackers.

FossilOrigin-Name: 2837061d66672a0a73c3fd2ff35ce0e1a66ee6d5365be25d4cc0ccba170c3665
2023-09-06 17:07:53 +00:00
drh
d4bb0896d4 Add the xIntegrity method to the sqlite3_module object, thus enabling
PRAGMA integrity_check to operate on virtual tables.  Make use of this
new method in the FTS3/4, FTS5, and RTREE virtual tables.

FossilOrigin-Name: 2f08e7d233b6ddc28b61f0d17ae9b815a91c3c6e080862ce009dc0ad73c64cf5
2023-09-06 16:51:13 +00:00
drh
9e5d21092d Fix unreachable branches.
FossilOrigin-Name: f00fc16394427f25249dd58c25a9115fef1ae389e232d574b4e91db2e7f8c04d
2023-09-06 16:22:48 +00:00
drh
d5ab4dd9e4 Change the xIntegrity virtual table method signature so that it returns
an integer error code and writes the error message into a parameter.

FossilOrigin-Name: f1d4024a8ca06cf954aaf1f612684d1a5d28492bde757695db3f22c50c649709
2023-09-06 14:00:01 +00:00
drh
961c2a9f36 Add the xIntegrity method to the sqlite3_module object. Implement this
method in RTREE, FTS3/4, and FTS5 so that "PRAGMA integrity_check" also
verifies the correctness of shadow tables associated with those virtual
tables.

FossilOrigin-Name: 17bede8cdefd968210dd8a5a2617acbe12ba2c99fdd5e88c5def8665e7bec2d7
2023-09-06 12:52:00 +00:00
stephan
7c1588b3ad Move Java-side FTS5 bits into the fts5 subpackage to (A) make it easy to optionally bundle it (or not) and (B) set a precedent for puting extension APIs in their own package.
FossilOrigin-Name: 4c773e1f331cd5854d4c6e8825197933c0bb6827b7437e56ac0ad650d1ddf55e
2023-09-06 07:39:25 +00:00
stephan
f31b9fcf86 Java FTS5 API renaming, for consistency.
FossilOrigin-Name: 5e4cc9f386364858c6457c40f13f01e1826a59086aa7f0fa10244ea846f5acfd
2023-09-06 06:54:25 +00:00
drh
5a05a68315 Fix a few SQLITE_MISUSE returns so that they call sqlite3MisuseError().
FossilOrigin-Name: 93f74490faf8cc07e107afdab6737c6e5141ae1f01a05142bfcede2dd1b2ba4e
2023-09-05 15:03:23 +00:00
dan
dd24b1c8a1 Add tests for, and source code comments to, fts5. No changes to code.
FossilOrigin-Name: b12afff4efe4de84388d102060e8c312abd2f9eca8270b3c0f01ac6d1f2e329a
2023-09-04 16:48:31 +00:00
drh
25a6e6ec8b Do not make assumptions about the byteorder of PowerPC processors.
FossilOrigin-Name: 4a2498fed4c5436fbcd4179db85e2741fdab37d42b0eebf12f41ec4573ce2c61
2023-09-04 12:50:17 +00:00
stephan
0c072b698b In JNI routines which set an OutputPointer.value, always do so, even on error, for consistency.
FossilOrigin-Name: d0df62f0af19a69f7ceb3ad1dceda0d8cc2ca5016a6e2a3a1e36356424c3ca49
2023-09-04 06:15:37 +00:00
stephan
3aeb58c90c Remove several unnececessary functions.
FossilOrigin-Name: 84433c72b0b08e7906ef87758caffe98f95df812945a7aea675bbc20791e33c0
2023-09-04 05:58:13 +00:00
stephan
4eaf5883b3 Move an internal utility class out of the public Java API.
FossilOrigin-Name: 8e1ae3197a62796565b7260b230057bdb3f136edd00a83f8a63532d44d386243
2023-09-04 05:34:30 +00:00
stephan
411d9e7b2e Expose sqlite3_bind_parameter_name() to JNI. Extend the definition of null for the @NotNull annotation, to consider closed/finalized Java-side handles wrapping C-side resources as null for its purposes.
FossilOrigin-Name: fc34e2bfa4a2255f019a2514367e58596837289de49f7fab87279c8b40c7f119
2023-09-04 04:23:31 +00:00
stephan
14412e9526 Add the missing sqlite3_blob_read() to [9a9945c405cf]. Elaborate on the definition of the @NotNull annotation.
FossilOrigin-Name: 85952b4a52a09e9da35754c1a1ec70b1bf277296011a2d37ac536b33437223d7
2023-09-03 14:41:13 +00:00
stephan
805e8c96b9 Expose the sqlite3_blob_...() APIs to JNI.
FossilOrigin-Name: 9a9945c405cfe9b6bf399655f498457da66b06c8b92014510ab9fb83fbb1c7d4
2023-09-03 14:13:29 +00:00
stephan
7dfacc9f96 Expose sqlite3_system_errno() to JNI.
FossilOrigin-Name: bac54da29c19ef5e0a76599b5d10b377ecd7b391a651af99526529df16a83c7d
2023-09-03 12:46:09 +00:00
stephan
286f30f85c Expose sqlite3_stmt_status() to JNI.
FossilOrigin-Name: d266acc23ecb7e76c8c68c6e89a76e6f3054f33f0262e60e06b258db5a5e2ccd
2023-09-03 12:32:09 +00:00
stephan
1943356268 Expose sqlite3_randomness() to JNI.
FossilOrigin-Name: de9692242132b8f2c92ef4acb08dd3063327b18666cbb17c4f1153dee9146eaf
2023-09-03 12:17:34 +00:00
stephan
83a8b6dd82 Expose sqlite3_get/set_auxdata() to JNI.
FossilOrigin-Name: 0de3271717e0298070097d7ea0ecb996d2e95cf65384e494515a554d0a1dffed
2023-09-03 11:58:33 +00:00
stephan
e30436b605 Expose sqlite3_get_autocommit() to JNI.
FossilOrigin-Name: 67391c6588c71af411767d1e4b63c5041a8a9e669102da318e3482ccfc9d9bb9
2023-09-03 11:16:48 +00:00
stephan
ce9902f8c2 Remove some unnecessary code.
FossilOrigin-Name: c7f9bbbbf0252c9749450e3ec994bf5ac945bd62428657ddff469291a0fd4b0d
2023-09-03 11:08:31 +00:00
stephan
54021c3bd0 Add a couple more sqlite3_backup tests.
FossilOrigin-Name: 5c2cf89d2c3ae5fc31b5e311bc2f2c1fef0037bdb0dff48c0a2a6bb6610e0215
2023-09-03 10:36:21 +00:00
stephan
24a689cf01 Export the sqlite3_backup_...() APIs to JNI.
FossilOrigin-Name: 865a3df5d550f6f4edbf95854750706e4e747d8f1825ae73d300b8e31934959b
2023-09-03 10:23:03 +00:00
stephan
2966b85df3 Export the sqlite3_keyword_...() family of functions to JNI.
FossilOrigin-Name: bd554db39159d8a538ce913d55285e3c417db8823c717a3e34bfa0678de42be7
2023-09-03 09:28:45 +00:00
drh
d3c5471a9a Performance optimization to the OP_MakeRecord opcode.
FossilOrigin-Name: 2aef9af3dd493a82ba090ccb8ab1b8974349392ec3f1c35db7a3dbbec41b5c51
2023-09-02 19:35:15 +00:00
stephan
de4d1c357f Add sqlite3_config(SQLITE_CONFIG_LOG) support to Java and correct clearing of SQLITE_CONFIG_SQLLOG. Correct missing names in propagated UDF exception messages.
FossilOrigin-Name: 652e2e82100ac3d8238d15ef6d43de4162fd02d695db4936ad5706fe4f2d7dc3
2023-09-02 14:36:41 +00:00
stephan
7d31de600b Expose sqlite3_complete() to JNI. Slightly widen the definition of "canonical" for the purposes of the @Canonical annotation. Add a few new tests.
FossilOrigin-Name: a59fe0cd9552128ca4186f4e66f0d188f2a57c7647f43828e42cb95801f350ce
2023-09-02 12:53:25 +00:00
stephan
216433636d Duplicate code consolidation.
FossilOrigin-Name: a1872ae959cca11d5d8bc224aaeb0b53e772d999df9924b2e9ea84ceedb99148
2023-09-02 11:26:36 +00:00
stephan
70b58fc119 Remove a superfluous level of indirection in the JNI internals.
FossilOrigin-Name: 8dca6f7660c15eacbda20da1c66c9ef1de36864f78750658226b1a7baf22b726
2023-09-02 10:18:10 +00:00
stephan
63f4a9c4db Further JNI cleanups.
FossilOrigin-Name: 30e38173c3ece0c9f8e7a9710f46cb5e8e8ef101c04531318a7adb070242f5dd
2023-09-02 08:51:14 +00:00
stephan
21d4f0cc7b Optimize sqlite3_get/set_clientdata() for the presumably common case of a static string pointer.
FossilOrigin-Name: 84e38341aeab4fd51690e8536d0101d00e3fb11cc50ebcff05ed219c98328872
2023-09-02 08:04:56 +00:00
stephan
49a40ef6d2 Add a timer to the JS SQLTester app to warn if it appears that loading the module has failed, which is commonly caused by the test scripts not being compiled.
FossilOrigin-Name: f9c1f9cad1ad22f689a4afa13d59bf9969ddaed6624cbc16cb1bf5d1fd0c8a5b
2023-09-01 17:51:09 +00:00
stephan
a5f425cc6e Correct a Tester1.java test which inadvertently created a spurious db file in the current dir. Unrelated minor cleanups.
FossilOrigin-Name: 016bbdadbf9f95cef185d2606c23e3b3c724586fcca470e11e6fbdbaefd75c79
2023-09-01 16:28:46 +00:00
stephan
4ea63e5609 Make the JNI-internal metrics opt-in rather than opt-out so client builds won't have them by default. Unrelated doc tweaks.
FossilOrigin-Name: aa72d25a22c80a7a376127266b8923f0661147c8bc483baa327230364851a255
2023-09-01 14:20:39 +00:00
stephan
d086065644 Make JNI interfaces of sqlite3_column/value_text() match the C ones better. Internal JNI cleanups and simplifications.
FossilOrigin-Name: eb24f97253d9c8e7c728c2ac67a0824b10ca67362ac4f8abb94d5d3c54c58c5b
2023-09-01 13:27:59 +00:00
stephan
dba0ceea60 Second half of [1c532e80].
FossilOrigin-Name: 8ca1d815a57be1fade59fb8ea5705c27b10294e4959c8a9c624f1623df6a5f63
2023-09-01 11:10:09 +00:00
stephan
f551aa4e80 In the OPFS VFS' importDb() methods, overwrite the header bytes 18 and 19 with 1 instead of 0. Both seem to work, but 1 is correct.
FossilOrigin-Name: 1c532e807bf8466b67d9600ab9630a6736de77259e9a71ac435641715ee0e04b
2023-09-01 11:05:22 +00:00
stephan
7862e19468 Remove some newly-dead code.
FossilOrigin-Name: dc0fa76b395c5e352116dc33cc1b455e5e9c9f01c285af52ccba4d37e4453b87
2023-09-01 10:37:15 +00:00
stephan
03ca59afb9 Expose sqlite3_limit() to JNI and remove the all SQLITE_ macros from the Java interface which are not directly exposed to client-level C code (SQLITE_MAX_... and SQLITE_THREADSAFE_...).
FossilOrigin-Name: 5fe5b0a585dbfa06cfca1fea40aea5ea3ccfe8295f41306ad2d5b851ace27203
2023-09-01 10:32:31 +00:00
stephan
55171a75ef JNI build improvements. Rename a Java class. Get the jar target working again.
FossilOrigin-Name: d086b7844cace5c997261c97565aeef62aaeeef727ccc7e83f17c54d6217b779
2023-09-01 09:43:56 +00:00
stephan
a4b47b034c Expose sqlite3_stmt_explain(), sqlite3_stmt_isexplain(), and sqlite3_stmt_readonly() to JNI.
FossilOrigin-Name: 208b786afe16eafaf0ce791f319a5e05f733a7b71ce1c542e1b83481b013ec38
2023-09-01 06:50:17 +00:00
stephan
0d3f0a9c11 Export sqlite3_txn_state() to JNI.
FossilOrigin-Name: d732f71d0a292dbb493f79f7c6ecd8a4effbfbc91453b1c54bdd9becf2d75bdb
2023-08-31 19:35:59 +00:00
stephan
63e7ed3b44 Minor JNI cleanups.
FossilOrigin-Name: 2e2bb841ef8b53266ec48d8c3408d6396f29f17922e858eac1b4f12f4adeb05e
2023-08-31 18:34:43 +00:00
dan
8628c10e27 Do not disable unused columns in a UNION ALL sub-query if any component of the sub-query is DISTINCT.
FossilOrigin-Name: c84d5602ac9bfb4f12c3cf62033af616e51913c26877d1a0761363a625295f53
2023-08-31 18:00:10 +00:00
stephan
062bafb851 Add convenience overloads of JNI sqlite3_table_column_metadata() to simplify usage.
FossilOrigin-Name: faf4e6d398f444d970be8b1364c984c67ccbc5f8a27f3aa93f05b8a8de7bec9b
2023-08-31 15:24:46 +00:00
stephan
0c2ba994d2 Export sqlite3_(db_)free_memory() and sqlite3_table_column_metadata() to JNI. Further internals renaming for consistency and legibility.
FossilOrigin-Name: 7c86aa3400ed591d38c1828f366f4b5de97954c2b301919d3f06d9c2d3d7d1f2
2023-08-31 14:57:01 +00:00
drh
3823208d5b Use mutexes to make sqlite3_set_clientdata() and sqlite3_get_clientdata()
threadsafe.

FossilOrigin-Name: 443ea20ddb0f3bf5d77ef59cd4678f0e32d7da328002bb44d6fc080a53a37e29
2023-08-30 18:51:26 +00:00