]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
20 months agoFix a problem with the changes on this branch and tables that use an implicit primary... session-alter
dan [Sat, 7 Oct 2023 16:07:02 +0000 (16:07 +0000)] 
Fix a problem with the changes on this branch and tables that use an implicit primary key.

FossilOrigin-Name: 1f9d10235ff32e72074be695049567135b02e681068ce117b66adc14a6214449

20 months agoAdd missing source code comments and fix other issues with the new code on this branch.
dan [Fri, 6 Oct 2023 20:39:42 +0000 (20:39 +0000)] 
Add missing source code comments and fix other issues with the new code on this branch.

FossilOrigin-Name: df39fbe9ab87937beb77af353cd55602290b185e222e0a92a3ebf9a9a0b9e2e7

20 months agoUpdate this branch with latest changes from the trunk.
dan [Fri, 6 Oct 2023 19:46:19 +0000 (19:46 +0000)] 
Update this branch with latest changes from the trunk.

FossilOrigin-Name: 897e926a5eaa0eab7e09e5003e4c15c974897be298a18ae85345962dc3f410a1

20 months agoAdd tests for the sqlite3changegroup_schema() API.
dan [Fri, 6 Oct 2023 19:01:43 +0000 (19:01 +0000)] 
Add tests for the sqlite3changegroup_schema() API.

FossilOrigin-Name: 5dab481c101b1523b1cfde92678cbc654ea26d946bf29da372d71c1f89cbaf46

20 months agoRemove an unused parameter from the recomputeColumnsNotIndexed() routine in
drh [Fri, 6 Oct 2023 12:55:53 +0000 (12:55 +0000)] 
Remove an unused parameter from the recomputeColumnsNotIndexed() routine in
order to squash a harmless compiler warning.

FossilOrigin-Name: 9bf4bfd68080367b58594e0d44b110b3ee9766420f648537fd7bc638dacefb72

20 months agoEnsure that all fields of static sqlite3_module objects are explicitly
drh [Fri, 6 Oct 2023 12:51:05 +0000 (12:51 +0000)] 
Ensure that all fields of static sqlite3_module objects are explicitly
initialized, in order to hush-up nuisance compiler warnings.

FossilOrigin-Name: f3b3d712d6e58b1cb8fdebd2b6b3125080b6b3ac8c7c849a8cc1e5e778d62fe7

20 months agoRemove and unused static variable from shell.c.in in order to silence a
drh [Fri, 6 Oct 2023 12:22:14 +0000 (12:22 +0000)] 
Remove and unused static variable from shell.c.in in order to silence a
harmless compiler warning.

FossilOrigin-Name: 477577120b897bf15edc2a85e220d5c64a1d5a245354939269f6753d8140ac95

20 months agoIncrease the size of some variables associated with the PMA sorter in order
drh [Fri, 6 Oct 2023 12:15:01 +0000 (12:15 +0000)] 
Increase the size of some variables associated with the PMA sorter in order
to avoid any possibility of a signed integer overflow.
[https://bugs.chromium.org/p/chromium/issues/detail?id=1489025|Chromium fuzzer issue 1489025].

FossilOrigin-Name: dc3be3af471d90dd810c1e2cc59e83cf6a57f01971b1258ea0da402e4d577ef2

21 months agoAdd the sqlite3changegroup_schema() API. To allow changegroups to handle differences...
dan [Thu, 5 Oct 2023 19:09:23 +0000 (19:09 +0000)] 
Add the sqlite3changegroup_schema() API. To allow changegroups to handle differences in schema created by ALTER TABLE ADD COLUMN.

FossilOrigin-Name: 309deee2dd8dd07623fce79f6bb62d5279d140dd0be3b34bc42af20b0507726b

21 months agoImproved detection of corrupt databases in balance_nonroot().
drh [Thu, 5 Oct 2023 11:06:10 +0000 (11:06 +0000)] 
Improved detection of corrupt databases in balance_nonroot().
dbsqlfuzz d1cf013c50a620b68c2a5bd240d29afd65e5f58e.

FossilOrigin-Name: a2464bbb825b5976ef974a2e6c17ea150f5e6fcd0dd0f144b9f9c1c22a9c9c82

21 months agoDo not squelch exceptions from SAHPool VFS importDb() - rethrow them. Problem reporte...
stephan [Thu, 5 Oct 2023 11:04:49 +0000 (11:04 +0000)] 
Do not squelch exceptions from SAHPool VFS importDb() - rethrow them. Problem reported in [forum:c80fc578809b80a3|forum post c80fc578809b80a3].

FossilOrigin-Name: 325bcdea4a436e514d83095d3893caf07a714b718e1b643507179b101c108e3b

21 months agoRemove a stray blank line from the beginning of btree.c. No functional
drh [Thu, 5 Oct 2023 10:35:51 +0000 (10:35 +0000)] 
Remove a stray blank line from the beginning of btree.c.  No functional
code changes.

FossilOrigin-Name: c89983dcfc208faa86b31717144c069572598e9770228264d69a044a84bde277

21 months agoAllow a session object to generate a changeset, even if columns were added to one...
dan [Wed, 4 Oct 2023 21:15:24 +0000 (21:15 +0000)] 
Allow a session object to generate a changeset, even if columns were added to one of the tables using ALTER TABLE ADD COLUMN while the changeset was being collected.

FossilOrigin-Name: a3f435eccf3a2aa11cb7420e94af5efcdfa04e9c169c5aaf61fa5cdcb165ceef

21 months agoThe Makefile distinguishes between tcl8.4 and tcl8.5. Some makefile targets
drh [Wed, 4 Oct 2023 12:49:08 +0000 (12:49 +0000)] 
The Makefile distinguishes between tcl8.4 and tcl8.5.  Some makefile targets
require tcl8.5, but others (ex: "sqlite3.c", "shell.c", and "sqlite3") require
only tcl8.4.

FossilOrigin-Name: 770308db9776b8c0a70b8807463e89a9eddfe5552e25e67324cd303dc974f50e

21 months agoModify the main makefile so that it fails with an error if the tclsh found
drh [Wed, 4 Oct 2023 11:52:44 +0000 (11:52 +0000)] 
Modify the main makefile so that it fails with an error if the tclsh found
by ./configure is not tclsh 8.5 or later.
[forum:/forumpost/4380363682708ece|Forum post 4380363682708ece].

FossilOrigin-Name: 1765f3b5a00a8ca20a7b9e18ac7f9d7de0679470b234b83aea83aa5b4d4d34e6

21 months agoJNI: when fetching text-or-blob/length pairs, fetch the text-or-blob first, then...
stephan [Mon, 2 Oct 2023 17:12:16 +0000 (17:12 +0000)] 
JNI: when fetching text-or-blob/length pairs, fetch the text-or-blob first, then the length, as the API docs suggest.

FossilOrigin-Name: e4f9d3946fa570bccea2de17c5536901bdabd46cfe25678fdd37ba0e2bfd99b1

21 months agoFix the length of the string in the new concat() and concat_ws() functions.
drh [Mon, 2 Oct 2023 17:06:28 +0000 (17:06 +0000)] 
Fix the length of the string in the new concat() and concat_ws() functions.

FossilOrigin-Name: 325243226520376f4a142864ae3fb98866f25bff4dc50a6b648ef98428a7169f

21 months agoRemove an ALWAYS() from a branch that can in fact be false following an OOM
drh [Mon, 2 Oct 2023 15:56:37 +0000 (15:56 +0000)] 
Remove an ALWAYS() from a branch that can in fact be false following an OOM
fault.

FossilOrigin-Name: 3a1feb1c469d3dd50e2558581199b16bfd59b9d5bcb0de5f1a8f0ec30a17b4d1

21 months agoPointer-casting-related fixes for JNI on 32-bit ARM (pi4 armv7l).
stephan [Mon, 2 Oct 2023 14:44:28 +0000 (14:44 +0000)] 
Pointer-casting-related fixes for JNI on 32-bit ARM (pi4 armv7l).

FossilOrigin-Name: 54441039ae3ebe39e42f008f77ce1be117cbda6daeed8b01739ad42a3c1f0754

21 months agoAdd JNI binding for sqlite3_normalized_sql().
stephan [Sun, 1 Oct 2023 12:15:38 +0000 (12:15 +0000)] 
Add JNI binding for sqlite3_normalized_sql().

FossilOrigin-Name: 2532e5662a2bbb3e6b4c4be3fad035734b684bdf59b178cb64b444ca6d8b956b

21 months agoMake JNI binding of sqlite3_value_frombind() return boolean instead of int and add...
stephan [Sun, 1 Oct 2023 11:53:40 +0000 (11:53 +0000)] 
Make JNI binding of sqlite3_value_frombind() return boolean instead of int and add tests for it.

FossilOrigin-Name: 906e2ed3e9647f5c2355e9fea2beee141767cae7016da9fa1fe88283726b9369

21 months agoFix JNI binding to compile without SQLITE_ENABLE_PREUPDATE_HOOK. Add build option...
stephan [Sat, 30 Sep 2023 17:08:29 +0000 (17:08 +0000)] 
Fix JNI binding to compile without SQLITE_ENABLE_PREUPDATE_HOOK. Add build option to disable all optional ENABLE flags.

FossilOrigin-Name: c04022b7407f77eaf0175e831ebcd6bbdc0af1cef0d42c5c11102aa8484f24ca

21 months agoMake all SQLite3Jni methods which take a void-pointer-as-long-int argument explicitly...
stephan [Sat, 30 Sep 2023 16:19:57 +0000 (16:19 +0000)] 
Make all SQLite3Jni methods which take a void-pointer-as-long-int argument explicitly package-private, as they're always for internal use only even if SQLite3Jni is eventually made public.

FossilOrigin-Name: 5e387275f69ab2d3159b4b67b8cbfc6270410b61e5ac1f988616e8d051f6572e

21 months agoJNI: rename sqlite3_errmsg16() to sqlite3_errmsg(), as the 16 suffix is superfluous...
stephan [Sat, 30 Sep 2023 14:48:21 +0000 (14:48 +0000)] 
JNI: rename sqlite3_errmsg16() to sqlite3_errmsg(), as the 16 suffix is superfluous there.

FossilOrigin-Name: df25b21689de84b7b8c940df39461d3d88f592f0ba2dddcfcbb0bebcea6ee7da

21 months agoExpose sqlite3_stmt_busy() to JNI.
stephan [Sat, 30 Sep 2023 14:34:55 +0000 (14:34 +0000)] 
Expose sqlite3_stmt_busy() to JNI.

FossilOrigin-Name: 5733aa5fe341d50b84baebd8803a86e381bb95959a8bc733b8fff6fd4e732867

21 months agoCorrect an undefined-value deref in the JS bindings, triggered by passing invalid...
stephan [Sat, 30 Sep 2023 13:13:23 +0000 (13:13 +0000)] 
Correct an undefined-value deref in the JS bindings, triggered by passing invalid args and then tripping over an undefined value while trying to report that. Reported in [forum:dd42df144651d779|forum post dd42df144651d779].

FossilOrigin-Name: fd4632540717c4771ac9ae1fe4400091a2cd0553639bf809abaf4ecbc54de4f0

21 months agoMake (almost) all SQLite3Jni.sqlite3_... members public but make the SQLite3Jni class...
stephan [Sat, 30 Sep 2023 10:59:18 +0000 (10:59 +0000)] 
Make (almost) all SQLite3Jni.sqlite3_... members public but make the SQLite3Jni class package-private, which has the same foot-protection effect but makes it much simpler to patch SQLite3Jni to publicize the interface later. Remove some of the extraneous foot-shooting protection from indidivual functions, in lieu moving it to the still-pending higher-level interfaces.

FossilOrigin-Name: 082b86683e77b2d4a30e1515552f52511324ef97c43b622b4dab7975ae9fbd7d

21 months agoMerge in and close jni-ptr-passing branch. The remaining pointer-passing adaptation...
stephan [Sat, 30 Sep 2023 10:37:36 +0000 (10:37 +0000)] 
Merge in and close jni-ptr-passing branch. The remaining pointer-passing adaptation can be done incrementally without affecting the interface.

FossilOrigin-Name: 7927c42410ba0d5fc8e6e08caaa5cbaaeb359869f17d1afaa082f1aa47fdb2fc

21 months agoMake all native JNI sqlite3_...() bindings package-private as a foot-shooting protect... jni-ptr-passing
stephan [Sat, 30 Sep 2023 10:31:56 +0000 (10:31 +0000)] 
Make all native JNI sqlite3_...() bindings package-private as a foot-shooting protective measure (higher-level pre-native-call argument validation is largely pending). Move SQLTester.java and TesterFts5.java into the org.sqlite.jni package so that they can access the being-tested methods.

FossilOrigin-Name: ec82f7251acab7df40755ef5f456f36fe49b59e63a20be59bd610fc4280ba8cd

21 months agoMore work towards the new pointer-passing mechanism in JNI, and code-adjacent cleanups.
stephan [Sat, 30 Sep 2023 09:41:58 +0000 (09:41 +0000)] 
More work towards the new pointer-passing mechanism in JNI, and code-adjacent cleanups.

FossilOrigin-Name: 6c63987e893357dc8b10decaa96c30fb37b75481640a303e77a0d8224354491e

21 months agoAdd test case to ensure the assert() removed by [f090af77] no longer fails.
dan [Fri, 29 Sep 2023 15:56:40 +0000 (15:56 +0000)] 
Add test case to ensure the assert() removed by [f090af77] no longer fails.

FossilOrigin-Name: 615ab71761754b072439f92e73fdb98c916b820937bcca8904f4be34936d5f9c

21 months agoRemove an incorrect assert().
drh [Fri, 29 Sep 2023 15:53:55 +0000 (15:53 +0000)] 
Remove an incorrect assert().

FossilOrigin-Name: f090af775f6d2ce8b50850f5c9e33546bcb9cff5467d99ca210530cb7ca83d5b

21 months agoJNI: correct a NullPointerException triggered via SQLTester.
stephan [Thu, 28 Sep 2023 20:34:28 +0000 (20:34 +0000)] 
JNI: correct a NullPointerException triggered via SQLTester.

FossilOrigin-Name: 0a873de76c0cbcd8e2eda3f0508e427f1dcb32b01798687c0545acfe10102179

21 months agoClarify serialization API doc w.r.t. buffer validity and usage, instigated by [forum...
larrybr [Thu, 28 Sep 2023 15:00:25 +0000 (15:00 +0000)] 
Clarify serialization API doc w.r.t. buffer validity and usage, instigated by [forum:/forumpost/8922e2ad2ad41205|forum post 8922e2ad2ad41205]. No code changes.

FossilOrigin-Name: b488b9fb71652eca90d2bf73d32f3d748badf517859dc833c58e021b0e017194

21 months agoAdapted the JNI bindings for the sqlite3_value_...() and (pre)update hook APIs to...
stephan [Thu, 28 Sep 2023 11:19:37 +0000 (11:19 +0000)] 
Adapted the JNI bindings for the sqlite3_value_...() and (pre)update hook APIs to the new pointer-passing mechanism.

FossilOrigin-Name: 4182f0275d5d65e04a130eeef4d44642a5ffeeb4b84430d240ea2605345f1404

21 months agoConvert the remaining macro-generated JNI bindings to the new pointer-passing mechanism.
stephan [Thu, 28 Sep 2023 10:50:26 +0000 (10:50 +0000)] 
Convert the remaining macro-generated JNI bindings to the new pointer-passing mechanism.

FossilOrigin-Name: 250fd6ae806cf705c0f29ad30ad8fb885b12590848e7adae63bc21d874c6d3bd

21 months agoConvert the macro-generated JNI bindings which take a db pointer to the new pointer...
stephan [Thu, 28 Sep 2023 10:27:01 +0000 (10:27 +0000)] 
Convert the macro-generated JNI bindings which take a db pointer to the new pointer-passing mechanism.

FossilOrigin-Name: 5f47fb77db4ee77afc541e680559ad88e66ba7fd04b830e70f8be92cf8d0a60c

21 months agoAdapted JNI sqlite3_blob_...() and sqlite3_close...() to the new pointer-passing...
stephan [Wed, 27 Sep 2023 14:41:49 +0000 (14:41 +0000)] 
Adapted JNI sqlite3_blob_...() and sqlite3_close...() to the new pointer-passing mechanism.

FossilOrigin-Name: 0b22c8ef93e5ccd45316099fb8575e27620158b1992c0c70fe0348cfc10147f8

21 months agoAdapt JNI sqlite3_bind_...() bindings to the new pointer-passing method and correct...
stephan [Wed, 27 Sep 2023 11:01:32 +0000 (11:01 +0000)] 
Adapt JNI sqlite3_bind_...() bindings to the new pointer-passing method and correct the mapping of sqlite3_bind_zeroblob64() to use zeroblob64() instead of zeroblob(). Related internal API renaming.

FossilOrigin-Name: 980d559fff6e55d1e2ef39f242a8a09313a936cfb141807db475bcceff924869

21 months agoAdd missing license headers to JNI annotation classes and extend the definition of...
stephan [Wed, 27 Sep 2023 10:29:07 +0000 (10:29 +0000)] 
Add missing license headers to JNI annotation classes and extend the definition of @NotNull to include 0L as the equivalent of null to account for the current rework of how pointers are passed from Java to C.

FossilOrigin-Name: bccdfeb9efde20410bde545893fb98ce5c0c4d04a8e7797b868ba8994120e1db

21 months agoRework the JNI sqlite3_backup APIs to the new pointer-passing approach.
stephan [Wed, 27 Sep 2023 09:58:36 +0000 (09:58 +0000)] 
Rework the JNI sqlite3_backup APIs to the new pointer-passing approach.

FossilOrigin-Name: 48aeb1e2cdeb4aec85c4f63a1f809215cd4b473791169e72b5ddf6d6bdc2f7b7

21 months agoStart reworking JNI methods such that they pass void pointers from Java to C instead...
stephan [Tue, 26 Sep 2023 21:37:52 +0000 (21:37 +0000)] 
Start reworking JNI methods such that they pass void pointers from Java to C instead of passing their strongly-typed wrappers, as that is reportedly significantly faster than passing the wrapper objects to C and extracting the pointers there. There are still many, many functions left to rework for this.

FossilOrigin-Name: 66c814dd473731703ee00e1ff610acfdccf09d1b87dd2355795ed697d4ed5d3e

21 months agoFix harmless compiler warnings in the testfixture testing utility.
drh [Tue, 26 Sep 2023 21:22:46 +0000 (21:22 +0000)] 
Fix harmless compiler warnings in the testfixture testing utility.

FossilOrigin-Name: 5a39a02d2dfd9ed6171cd0bd434b2bc268d0ed8ead6e1a396d1603266d9493ef

21 months agoJNI: implement AutoCloseable for the sqlite3 and sqlite3_stmt classes, and adjust...
stephan [Tue, 26 Sep 2023 19:49:35 +0000 (19:49 +0000)] 
JNI: implement AutoCloseable for the sqlite3 and sqlite3_stmt classes, and adjust a few tests to use it. Override Object.finalize() for sqlite3 class but not sqlite3_stmt (where it triggers a JVM crash for as-yet-unknown reasons).

FossilOrigin-Name: b633d8bbdbd43464ee03058c273e5188117b9538ed5d5148a1a3851e4adf6410

21 months agoFix yet another assert() in the partial-index constant value optimization.
drh [Tue, 26 Sep 2023 19:38:24 +0000 (19:38 +0000)] 
Fix yet another assert() in the partial-index constant value optimization.

FossilOrigin-Name: f459d0806cf044fd07743e4c91d0a5a6ddf45b3b41004bde4278f190d99a4cf5

21 months agoRemove a NEVER() from a condition in the partial-index constant value optimization...
dan [Tue, 26 Sep 2023 19:26:47 +0000 (19:26 +0000)] 
Remove a NEVER() from a condition in the partial-index constant value optimization that can sometimes be true.

FossilOrigin-Name: 63aea8c3e0605edcf49ad1e5ce1a56d2690dcb8c4857043997545daab46ca035

21 months agoRemove unreachable code from the partial-index constant value optimization
drh [Tue, 26 Sep 2023 14:57:30 +0000 (14:57 +0000)] 
Remove unreachable code from the partial-index constant value optimization
([8d4160910d651246]).

FossilOrigin-Name: 7ad38254c37153efa72291d09800693ca60894359548eda877d59defa8c70d49

21 months agoRemove some outdated JNI docs.
stephan [Tue, 26 Sep 2023 09:46:04 +0000 (09:46 +0000)] 
Remove some outdated JNI docs.

FossilOrigin-Name: 2ca5cbbb2a8ee94fe9f4888dea695a4429aefa17611fd9ebe59bf4866290ab0c

21 months agoMinor JNI doc updates. No code changes.
stephan [Tue, 26 Sep 2023 07:43:51 +0000 (07:43 +0000)] 
Minor JNI doc updates. No code changes.

FossilOrigin-Name: 63687cc659f06a1f6aa9d4496ef01d9f0adbee6184b8e265fb8feec1ad30449b

21 months agoIn partial index scans, if the WHERE clause implies a constant value for a table...
dan [Mon, 25 Sep 2023 17:46:02 +0000 (17:46 +0000)] 
In partial index scans, if the WHERE clause implies a constant value for a table column, replace occurences of that table column with the constant. This increases the likelihood of the partial index being a covering index.

FossilOrigin-Name: 8d4160910d6512469cb0a060b89c2509dde1c8e33d9358034d7fb39cd494eabe

21 months agoAnother very minor tweak to code on this branch to save cycles. partial-index-terms
dan [Mon, 25 Sep 2023 17:21:53 +0000 (17:21 +0000)] 
Another very minor tweak to code on this branch to save cycles.

FossilOrigin-Name: 2c805dc68112db7f06aea56a731a33e046e876851bdda3e725ba96f6da1bf2ee

21 months agoChange the order of an if..else... in new code to make it slightly faster.
dan [Mon, 25 Sep 2023 15:25:49 +0000 (15:25 +0000)] 
Change the order of an if..else... in new code to make it slightly faster.

FossilOrigin-Name: f80dc64483a54a488e507da140836261ae1b864577cc95d8e869919d5a25e73c

21 months agoEnable -Wall for the compiler on --enable-debug builds.
drh [Mon, 25 Sep 2023 14:20:07 +0000 (14:20 +0000)] 
Enable -Wall for the compiler on --enable-debug builds.

FossilOrigin-Name: 63a7b521390001939909d43d908af78f7df7cb92272d2b74f038da918c2bef05

21 months agoFix a bad interaction between LEFT JOIN, bloom filters and partial indexes.
dan [Mon, 25 Sep 2023 11:12:39 +0000 (11:12 +0000)] 
Fix a bad interaction between LEFT JOIN, bloom filters and partial indexes.

FossilOrigin-Name: 5775f92b31f0539c66d37e50689bec17a82c0e857a781331c03e34bc18157087

21 months agoResolve the JNI FTS5 test5() failure and remove some nearby dead code.
stephan [Sun, 24 Sep 2023 19:13:31 +0000 (19:13 +0000)] 
Resolve the JNI FTS5 test5() failure and remove some nearby dead code.

FossilOrigin-Name: 5655c51f103c6dfade799ffb5ca2eb21b4360ada598741f373c952ae732535aa

21 months agoAdd extra tests for changes on this branch.
dan [Sat, 23 Sep 2023 21:31:40 +0000 (21:31 +0000)] 
Add extra tests for changes on this branch.

FossilOrigin-Name: cb45f5b070cfdbb4358e8e909b0b34d658b5925db06e282b38046298a159c545

21 months agoAvoid an error when parsing a schema that contains indexes with WHERE clauses contain...
dan [Sat, 23 Sep 2023 19:25:03 +0000 (19:25 +0000)] 
Avoid an error when parsing a schema that contains indexes with WHERE clauses containing unknown collation sequences.

FossilOrigin-Name: d5dd39e37ab994ce5d75688a40c6494c17807431529e85eb2b11d58f367fe232

21 months agoFix a failing assert() caused by changes on this branch.
dan [Sat, 23 Sep 2023 18:52:22 +0000 (18:52 +0000)] 
Fix a failing assert() caused by changes on this branch.

FossilOrigin-Name: d0e21f20bd8643d21c4b88fb75b83939d68e9b7118f7289a164656f11d2ee555

21 months agoFix a harmless compiler warning.
drh [Sat, 23 Sep 2023 18:49:30 +0000 (18:49 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: 7c4210253b660b385d14de3ae7ab30f038036308e1164ec17b40e2805b9b2235

21 months agoAdd extra tests for the fts5 xPhraseQuery API.
dan [Sat, 23 Sep 2023 15:34:02 +0000 (15:34 +0000)] 
Add extra tests for the fts5 xPhraseQuery API.

FossilOrigin-Name: b5edea16317ccc896394011f45442af44d5ea1041b6abfe152c90412c78bfc5b

21 months agoResolve the JNI FTS5 test5() crash, caused by two unrelated typos in JNI callback...
stephan [Sat, 23 Sep 2023 06:50:19 +0000 (06:50 +0000)] 
Resolve the JNI FTS5 test5() crash, caused by two unrelated typos in JNI callback signature strings. That test now fails with an expected-vs-got mismatch but no longer dies in the native code.

FossilOrigin-Name: 0233f310bf6bbb84f76b25205af160951e0bf6d8b2f1bca4537384af4fe47e58

21 months agoRemove an invalid optimization from JNI code and add a missing check check for Java...
stephan [Sat, 23 Sep 2023 06:37:18 +0000 (06:37 +0000)] 
Remove an invalid optimization from JNI code and add a missing check check for Java-side exception.

FossilOrigin-Name: b8151f879718f7e30520f7e5ae04bd6724ae98af067be097b1a00df2175a038a

21 months agoIn partial index scans, if the WHERE clause implies a constant value for a table...
dan [Fri, 22 Sep 2023 20:21:27 +0000 (20:21 +0000)] 
In partial index scans, if the WHERE clause implies a constant value for a table column, replace occurences of that table column with the constant. This increases the likelihood of the partial index being a covering index.

FossilOrigin-Name: 66ed7abdfa228abde2052e3988589371f0e49b11582b1b4a83255d2df3a0aefa

21 months agoAdd extra tests for java Fts5ExtensionApi API.
dan [Mon, 18 Sep 2023 20:42:06 +0000 (20:42 +0000)] 
Add extra tests for java Fts5ExtensionApi API.

FossilOrigin-Name: f9d62b853ce8bfbfdc9f137e984e7a1b51d70e88c38b136b4fad1e8ae6ee8913

21 months agoExtra tests for java Fts5ExtensionApi interface.
dan [Mon, 18 Sep 2023 18:12:03 +0000 (18:12 +0000)] 
Extra tests for java Fts5ExtensionApi interface.

FossilOrigin-Name: c923893f3604b278277de1bb919ef713bf7a4296b7ff71451cfe19bc2ff03190

21 months agoRemove a NEVER() in btree.c that could actually be reached, with the approriate
drh [Sun, 17 Sep 2023 16:36:22 +0000 (16:36 +0000)] 
Remove a NEVER() in btree.c that could actually be reached, with the approriate
database corruption.

FossilOrigin-Name: d1fd00e0875f881cacdc581a75215ec1872a81969ac07b8ebe3aaa707a9a3640

21 months agoFix resolution of "rowid" and similar identifiers in queries that use nested joins.
dan [Sat, 16 Sep 2023 18:18:57 +0000 (18:18 +0000)] 
Fix resolution of "rowid" and similar identifiers in queries that use nested joins.

FossilOrigin-Name: 37ec43d92bde13efc71fa57ff5e59c4a95b9054c298f844aefeb06d4a91ad0d4

21 months agoEnable "OR IGNORE" support via SQLITE_VTAB_CONSTRAINT_SUPPORT for internal-content...
dan [Sat, 16 Sep 2023 17:11:44 +0000 (17:11 +0000)] 
Enable "OR IGNORE" support via SQLITE_VTAB_CONSTRAINT_SUPPORT for internal-content (not contentless or external-content) fts5 tables.

FossilOrigin-Name: c362bde4f4b8489947f080154d7fddcfd6e8e21d742a483c496fb7fbe59969d2

21 months agoAdd a NEVER() to an unreachable branch. nested-from-rowid-expansion
drh [Sat, 16 Sep 2023 16:39:27 +0000 (16:39 +0000)] 
Add a NEVER() to an unreachable branch.

FossilOrigin-Name: 6b6eb38979d68c06e382620c8813d6b67a3de02c4a7a029c84f924b9a2e380c6

21 months agoFix minor code indentation inconsistencies. No function changes.
drh [Sat, 16 Sep 2023 16:23:20 +0000 (16:23 +0000)] 
Fix minor code indentation inconsistencies.  No function changes.

FossilOrigin-Name: 05107a0ae1456b746d3119af68d39532fad23a7eef88c09a9ef46ab7f8da4b9d

21 months agoFix a harmless compiler warning.
drh [Sat, 16 Sep 2023 16:12:10 +0000 (16:12 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: 9e9ff4ca3a205d0b599634782a5ad389fbe4823663550f48c54ca35dbc660dc7

21 months agoFurther tests and assert() statements for the change on this branch.
dan [Sat, 16 Sep 2023 14:42:18 +0000 (14:42 +0000)] 
Further tests and assert() statements for the change on this branch.

FossilOrigin-Name: 1c202d540ac362bfc747a9f8472e83c9d7614e38467f8b48787a669fb34664ba

21 months agoFix resolution of unqualified "rowid" identifiers in queries with nested joins.
dan [Fri, 15 Sep 2023 20:57:05 +0000 (20:57 +0000)] 
Fix resolution of unqualified "rowid" identifiers in queries with nested joins.

FossilOrigin-Name: bbcbd3d537d6790373d97f59386b8ce7fa2177db572af0f1babe058a76e25cc3

21 months agoSimplifications and performance optimizations for the RTree extension.
drh [Fri, 15 Sep 2023 20:28:27 +0000 (20:28 +0000)] 
Simplifications and performance optimizations for the RTree extension.

FossilOrigin-Name: 04a333f5faf6b90592f1f69889ac6c28949955e186f39037cd639480b06feae8

21 months agoDrop support for the view-scan optimization (check-in [609fbb94b8f01d67]) as
drh [Fri, 15 Sep 2023 19:51:18 +0000 (19:51 +0000)] 
Drop support for the view-scan optimization (check-in [609fbb94b8f01d67]) as
it was causing multiple performance regressions.  In its place, reduce the
estimated row count for DISTINCT subsqueries by a factor of 8.

FossilOrigin-Name: f911f1c4977fbcae041243955cf2b98d8cc8baa337885a69be0f2b9bd2efa6f3

21 months agoMinor simplification to the DISTINCT output row count change. rethink-viewscan
drh [Fri, 15 Sep 2023 19:27:36 +0000 (19:27 +0000)] 
Minor simplification to the DISTINCT output row count change.

FossilOrigin-Name: 0738386d7c505a98768ddaff7ff1fc76f115882d92d6f84bf136b4aa2caad8b8

21 months agoDo not reduce subquery output row count estimates due to DISTINCT until
drh [Fri, 15 Sep 2023 19:00:47 +0000 (19:00 +0000)] 
Do not reduce subquery output row count estimates due to DISTINCT until
after the decision of whether or not to use an index for ORDER BY has been
made.

FossilOrigin-Name: 27390051e86ad86fb35219329d359be9e83073f59782631af7fc519225e10565

21 months agoAllow expressions like "<tbl>.rowid" to refer to implicit rowid columns of tables...
dan [Fri, 15 Sep 2023 18:36:51 +0000 (18:36 +0000)] 
Allow expressions like "<tbl>.rowid" to refer to implicit rowid columns of tables in nested FROM clauses.

FossilOrigin-Name: 59a1bbc69f5dbb33418fa4b383393fb13a46bc1e531577da8ad54ae2fad5a10e

21 months agoExperimental: Assume that a DISTINCT clause on a subquery reduces the number
drh [Fri, 15 Sep 2023 16:15:33 +0000 (16:15 +0000)] 
Experimental:  Assume that a DISTINCT clause on a subquery reduces the number
of rows returned by that subquery by a factor of 8.

FossilOrigin-Name: 5a940e47d501f23347eaf084f4820e064e93665d19c8938c80715b71006ede8b

21 months agoThe view-scan optimization was added to enhance the performance of one specific
drh [Fri, 15 Sep 2023 14:06:44 +0000 (14:06 +0000)] 
The view-scan optimization was added to enhance the performance of one specific
query, but it causes performance regressions on a host of others.  Disable it
(at least temporarily) in order to try to find an alternative way of fixing the
one specific query that it was created to fix - an alternative way that does
not cause performance problems for other unrelated queries.

FossilOrigin-Name: d9625a9eafe88859c3255849ee750cc6322d5a13ddad45107f9b2085c20eff50

21 months agoDo not try to convert a double into an unsigned 64-bit integer, as that does
drh [Fri, 15 Sep 2023 10:24:29 +0000 (10:24 +0000)] 
Do not try to convert a double into an unsigned 64-bit integer, as that does
not work on all platforms.  A double can only be converted into a signed
64-bit integer.

FossilOrigin-Name: ce339046416e9ddeffe77f71a8bfb8c5b302160c3207f919aebd62902618ed59

21 months agoTests for java versions of Fts5ExtensionApi.xSetAuxdata() and xGetAuxdata().
dan [Thu, 14 Sep 2023 20:56:42 +0000 (20:56 +0000)] 
Tests for java versions of Fts5ExtensionApi.xSetAuxdata() and xGetAuxdata().

FossilOrigin-Name: 858fa236f8b673eb03cf2242e8202cd33ae1f13a43b59bdbb2eecdb21d42ef55

21 months agoJNI: move XTokenizeCallback interface out of the Fts5 object - that level of indirect...
stephan [Thu, 14 Sep 2023 20:02:49 +0000 (20:02 +0000)] 
JNI: move XTokenizeCallback interface out of the Fts5 object - that level of indirection is a holdover from when those classes were in the core package.

FossilOrigin-Name: 385ec08570451c0be212677d1b681c13d225dc690965effa2293e64cb3d56023

21 months agoAdd a few more tests for Fts5ExtensionApi methods.
dan [Thu, 14 Sep 2023 20:01:18 +0000 (20:01 +0000)] 
Add a few more tests for Fts5ExtensionApi methods.

FossilOrigin-Name: 4ce2a7e8ed0f2859efc1038fd0812bc2b667be1479f45c081deccc2cf188c807

21 months agoAdd a test for the java version of Fts5ExtensionApi.xRowid().
dan [Thu, 14 Sep 2023 17:42:34 +0000 (17:42 +0000)] 
Add a test for the java version of Fts5ExtensionApi.xRowid().

FossilOrigin-Name: 227facf879d2ade348cdb51f5b50ba2f95b8621acc0cf7a5fed4a310b4c76baa

21 months agoAccording to [forum:/forumpost/9f6db917e1|forum post 9f6db917e1], older legacy-msvc-workaround
drh [Thu, 14 Sep 2023 16:45:46 +0000 (16:45 +0000)] 
According to [forum:/forumpost/9f6db917e1|forum post 9f6db917e1], older
MSVC compilers are unable to convert a double directly into an unsigned
long long int, but must first go through a signed long long int.  Work
around this by restricting the range of doubles that are converted into
long long integers so that only the lower 63 bits are used.

FossilOrigin-Name: 0ab05871ba36e2a0eddfbc700c1d39891c54c453727a4effcdac3327efec163b

21 months agoDocument the use of OPFLAG_ISNOOP as the P2 argument on OP_Delete. No
drh [Thu, 14 Sep 2023 16:02:56 +0000 (16:02 +0000)] 
Document the use of OPFLAG_ISNOOP as the P2 argument on OP_Delete.  No
functional code changes.

FossilOrigin-Name: d88f41b2cf2b721170d2428a50b717976091389d9a07d0ffa15c3323b0eaad37

21 months agoAvoid a segfault in test program showdb.c that could occur when analyzing a corrupt db.
dan [Thu, 14 Sep 2023 14:05:51 +0000 (14:05 +0000)] 
Avoid a segfault in test program showdb.c that could occur when analyzing a corrupt db.

FossilOrigin-Name: 6bf3e90687d48243544cc07baa01cb1b25ee0b77c59437f96c8da8e5d8b8095e

21 months agoImprove the sqlite3IntFloatCompare() routine so that it is testable.
drh [Thu, 14 Sep 2023 13:10:17 +0000 (13:10 +0000)] 
Improve the sqlite3IntFloatCompare() routine so that it is testable.

FossilOrigin-Name: bb221381fa38db5be1222d89c567a9bca0e6c441e26a8c797bd326b263556afb

21 months agoDo not set the global bUseLongDouble flag based purely on sizeof(long double)
drh [Thu, 14 Sep 2023 10:46:50 +0000 (10:46 +0000)] 
Do not set the global bUseLongDouble flag based purely on sizeof(long double)
being more than 8.  That is a necessary but not sufficient condition to use
the long double routines.  Instead, do a run-time test to verify that long
double really does provide extra precision.

FossilOrigin-Name: aa999d490b743f455f2fb6c41009098330380f0bc2e9b1c28fbc82141a9138ce

21 months agoReduce the number of calls to sqlite3_mprintf() made by RTree. rtree-performance
drh [Thu, 14 Sep 2023 01:46:57 +0000 (01:46 +0000)] 
Reduce the number of calls to sqlite3_mprintf() made by RTree.

FossilOrigin-Name: f158b7d4917e0951fbb86a6f438abcb618d8602566fa54bf04c05a37f3a73513

21 months agoJNI: enable the fts5-customization bits by default but elide them from the docs until...
stephan [Wed, 13 Sep 2023 21:32:20 +0000 (21:32 +0000)] 
JNI: enable the fts5-customization bits by default but elide them from the docs until it's clearer where they're headed. Unrelated minor doc tweaks.

FossilOrigin-Name: 21adb1aef24398fba918a5e1479ce2b6fd7e86d87eb9f2bea86a0eb43e8809c2

21 months agoImproved comments on the hasHighPrecisionDouble() routine. No changes to runtime-longdouble-test
drh [Wed, 13 Sep 2023 20:35:04 +0000 (20:35 +0000)] 
Improved comments on the hasHighPrecisionDouble() routine.  No changes to
the underlying code.

FossilOrigin-Name: 810c635ce063d873e969bf83339c654f6008e84ce8a61f0ffc61806e98d13dde

21 months agoDetermine at start time whether or not the underlying hardware supports
drh [Wed, 13 Sep 2023 20:06:46 +0000 (20:06 +0000)] 
Determine at start time whether or not the underlying hardware supports
high-precision long double computations.

FossilOrigin-Name: 9a854b919667e0e679a259542b2ee444ee416dbd73ecd9458f6ced35d9d3f264

21 months agoOmit the Reinsert algorithm from RTree. This causes most benchmarks to run
drh [Wed, 13 Sep 2023 17:30:12 +0000 (17:30 +0000)] 
Omit the Reinsert algorithm from RTree.  This causes most benchmarks to run
faster, at the expense of having a slightly less dense and hence larger index
(example: 33 entries/node versus 34 entries/node).

FossilOrigin-Name: b3049a1d3dbdd63c471499c2f6b417655defe9ad90228e7cc722f5be877aae01

21 months agoDoc corrections for the previous checkin.
stephan [Wed, 13 Sep 2023 17:16:25 +0000 (17:16 +0000)] 
Doc corrections for the previous checkin.

FossilOrigin-Name: 9ea0a9f39d03707d251af5af08d1ba94958704ba74019d7e8823ccd21936023c

21 months agoAdd JNI sqlite3_prepare_multi(), based on feedback.
stephan [Wed, 13 Sep 2023 17:11:32 +0000 (17:11 +0000)] 
Add JNI sqlite3_prepare_multi(), based on feedback.

FossilOrigin-Name: fa1c1534724b03debc83ae35c2fadab83faf4b4e62b91981fed103888de41396

21 months agoPerformance optimization to cellContains() in RTREE.
drh [Wed, 13 Sep 2023 14:07:07 +0000 (14:07 +0000)] 
Performance optimization to cellContains() in RTREE.

FossilOrigin-Name: 43cde22bf3f36687df231eddf642581d1d4f4102ad8568d31f5b2ff0302ca800

21 months agoIn the ChooseLeaf algorithm of RTREE, do an initial pass through the cells
drh [Wed, 13 Sep 2023 13:12:08 +0000 (13:12 +0000)] 
In the ChooseLeaf algorithm of RTREE, do an initial pass through the cells
of a node looking for solutions that involve no cell enlargement.  Only look
for the minimum cell enlargement if the enlargement is non-zero for all cells.
This results in a performance improvement by reducing the number of calls
to cellUnion().

FossilOrigin-Name: 59f0e239d19393190911ea3bd89b5a24be0d85d64ccf51906efc9537ad5d7298

21 months agoReduce the number of calls to cellArea() in the ChooseLeaf() algorithm of
drh [Wed, 13 Sep 2023 12:06:02 +0000 (12:06 +0000)] 
Reduce the number of calls to cellArea() in the ChooseLeaf() algorithm of
rtree.

FossilOrigin-Name: c633fe6be0edc07a0aa1ac819d58b6c629b7c95b47b63516ae1b0a937f6a2b89