Commit Graph

28594 Commits

Author SHA1 Message Date
stephan
caa7a62591 Remove unused static var cBadGroup from ext/consio/console_io.c to resolve a compiler warning reported in the fossil forum. This is a build fix, not a functional change.
FossilOrigin-Name: fa047c3ea7a03d76afd6a11f58ef7b84c653f583ed795e0de5be2a6b986e558e
2024-08-09 12:19:11 +00:00
dan
0c8c9a64b3 Ensure sqlite3expert.c unregisters any SQL user-functions it registers with the database handle before returning.
FossilOrigin-Name: 123b154ce3b6fee1bbf483704812bd6f8538966f9687520b4470d700f0270719
2024-08-08 15:26:11 +00:00
dan
679f5d458e Add assert() statements and reorganize code slightly in fts3 and fts5 to make it easier to follow.
FossilOrigin-Name: 797b0a13fd7a42b0a48ecbf0cd1961aa932da3e9c9ccffd903a3a4d963d0cc54
2024-08-08 15:07:27 +00:00
drh
1193e4679d Do not let the number of terms on a VALUES clause be limited by
SQLITE_LIMIT_COMPOUND_SELECT, even if the VALUES clause contains elements
that appear to be variables due to the use of double-quoted string literals.
[https://issues.chromium.org/issues/358174302|Chromium issue 358174302].

FossilOrigin-Name: 670beb133eb203065a75022f0c6db7c605a4e0e22c8ef6d6b4724be2663ff3dc
2024-08-08 14:45:50 +00:00
drh
35c6f58dce Back out the --memory option to ".parameter init" in the CLI, as the
capability is no longer needed for testing due to the new "$int_N" and
"$text_T" automatic bindings, and the "init --memory" is hence just
added complication.

FossilOrigin-Name: 3b1b0c141993eb0f8749f54ea40d6014f9bdccbe0fdb3ccccad971a0baea8d3c
2024-08-08 12:14:07 +00:00
drh
6e7a0c2d86 In the CLI, recognize magic parameter names "$int_NNN" and "$text_TTT" and
bind them with integer value NNN and text value TTT respectively.  Intended
for testing and debugging use only.

FossilOrigin-Name: a929cdb00ff74d77cdf55087d32abf53578f7127b36276f89b64ccbef1d4a9a4
2024-08-08 12:08:36 +00:00
stephan
5529ec74da Move a misplaced va_end, as reported in [forum:702c79e9da|forum post 702c79e9da].
FossilOrigin-Name: daa25fb35fd7bdd482d51214439f38b0b9a7df93f689a2b3d30a113daa9f2a1a
2024-08-08 10:51:56 +00:00
drh
6d02d2647b Add the --memory option to the ".parameter init" CLI command. When present,
the --memory option causes the sqlite_parameters table to be created in a
completely independent :memory: database.  This can be done to avoid
parameter binding queries from being affected by debug settings such as
".wheretrace", ".treetrace", "PRAGMA vdbe_addoptrace=on", and similar.

FossilOrigin-Name: 4e69dce2093b75b7db4fbdca4953b664b907be15d991ed352ea1d87c64fbf9d2
2024-08-08 10:10:38 +00:00
dan
5cd01c30b4 Fix a broken assert in fts5_expr.c.
FossilOrigin-Name: 08cc5488404d068e59378b82988460793710df43ec21b4a83a794b497abd035f
2024-08-07 21:20:08 +00:00
drh
c76520c5b9 Add a new assert() to help static analyzers understand that a pointer is
never NULL.

FossilOrigin-Name: 433f2b942ee6f79d50ebe9b08fa3ea8162db6a10ce9d80e2bc193124baa1b083
2024-08-07 15:17:37 +00:00
drh
92d317f787 Fix a harmless compiler warning in an assert().
FossilOrigin-Name: 5e4c9a74b2efa74ace67f644fb6bb37e07f5982f8faaca9463e3daa50b0469d7
2024-08-07 14:54:54 +00:00
drh
eaa560f3fc Remove unused test cases from FTS5, as they interfere with "grep".
FossilOrigin-Name: 048a71bae48aacdfc91e59330db4d4b3d663f00665f51a7110ea82e0508758ec
2024-08-06 23:09:37 +00:00
drh
e9b919d550 Improved robustness of parsing of tokenize= arguments in FTS5.
[forum:/forumpost/171bcc2bcd|Forum post 171bcc2bcd].

FossilOrigin-Name: d9f726ade6b258f8723f90d0b04a4682e885e30939eb29773913e4dfc8e85503
2024-08-06 22:49:01 +00:00
drh
210f6f89be Improvements to ./configure that will hopefully break fewer builds.
FossilOrigin-Name: 769e32a69b7b7c04225afa0371f139b2ed29aaee5a7a4159a30d600ed9f25c57
2024-08-06 20:00:10 +00:00
drh
575a7b85f5 Change the AggInfoColumnReg() and AggInfoFuncReg() macros for
compilers that cannot parse empty elements of a comma expression.
[forum:/forumpost/8fd21998dc|Forum post 8fd21998dc].

FossilOrigin-Name: 533a6251f188805363f0e39613ea03b1bfd758eaea00e0855803238585bdfec7
2024-08-06 10:29:41 +00:00
drh
f2b21a5f57 Restore legacy "tcl_install" makefile target, as an interim measure until
I can figure out what is going on.

FossilOrigin-Name: 931ad7d9e3aedb6d466fffc0af1f8d6b20d57a35dec644f28585f3e84f22d1ce
2024-08-04 10:13:01 +00:00
drh
3a799b3e4e Fix to the previous checkin: The colUsed parameter should have high-order bit
set if any of the 64-th or greater columns of the virtual table is used.  The
lower 63 bits of colUsed always show the usage of the first 63 columns of the
virtual table.

FossilOrigin-Name: 90ac8457750ace1d76d7bc957af7877e86e6301bb07361e19beaf5c7b3b6085a
2024-08-03 23:00:17 +00:00
drh
133f930e61 Ensure that the sqlite3_index_info.colUsed mask always includes the PK fields of WITHOUT ROWID virtual tables.
FossilOrigin-Name: ff4ac279b02190cc2107b0b110806dd7abcea47a6589d827b5ee39d4b80fb719
2024-08-03 21:45:46 +00:00
dan
5c85ddc3d7 Fix a typo in [c327c0c0] preventing the shell tool from running ".dump" scripts that feature virtual tables.
FossilOrigin-Name: 10e97abb878debb67410902ea1af4df75a9ced1e38fec710b1796c5143aff48e
2024-08-03 18:58:25 +00:00
dan
0a83dac31c Ensure the sqlite3_index_info.colUsed mask always includes the PK fields of WITHOUT ROWID vtabs in cases where they may be used.
FossilOrigin-Name: c327c0c02cfefdba373cfb15933a9cdfddb578b6582f2ce7c08929203743ffe9
2024-08-03 18:45:48 +00:00
drh
4a36d30493 Add the --status option to the test runs using testrunner.tcl. Only works
on Unix platforms.  The "exec" command appears to interfere with VT100
escape codes on windows.

FossilOrigin-Name: 94015cda4ceb4292ceceadb951fe5d9cb3e4e20403719b7254ad094a5b749ab3
2024-08-03 15:55:25 +00:00
dan
e317e7f4b4 Change things so that locale=1 is required to write fts5_locale() values to an fts5 table, and so that blobs may not be stored in indexed (i.e. not UNINDEXED) columns of these tables.
FossilOrigin-Name: c98ccc12169419b8b27ead89ef0665de40320277c5daa748b80869337419e43e
2024-08-02 21:06:13 +00:00
drh
8517b7d2b6 Make sure the input buffer is big enough for an memcpy() when doing the
restore autodetection in the shell.

FossilOrigin-Name: 1637d29d518b3b4534a1b4c0dc0eddcb770f6f71763e4177812a3e79b97d2365
2024-08-02 18:20:10 +00:00
drh
b2d590c5f9 Add the "-d SECS" option to the "status" command of testrunner.tcl
FossilOrigin-Name: 2151ea31632f7aa363c7d4b7205e1174a45d710783a8efad8176049d356cfc70
2024-08-02 17:36:34 +00:00
drh
dcea6335c7 New MSVC makefile targets: tclextension, tclextension-install,
tclextension-uninstall, and tclextension-list.

FossilOrigin-Name: c38734f57509c50dd28029738dd602600950703b773d9b7b60fdb1dcb06e8fd8
2024-08-02 15:28:40 +00:00
drh
9e88d4bb8a Fix typo in a progress message in the builttclext.tcl script.
FossilOrigin-Name: 5e7c94645632b736e805428ff4c135666ab525fac99c29c12d5127b06f39fc6e
2024-08-02 13:56:55 +00:00
drh
eb48fddac7 Fix problems in the configure/Makefile system caused by recent enhancements
and report by [forum:/forumpost/242ebd0c81|forum post 242ebd0c81].

FossilOrigin-Name: a59319fe4adc094381c46e490289b3e0cda8f804edaea6984571c47a68a23eef
2024-08-02 11:32:28 +00:00
drh
698386ca2c New configuration option: --with-tclsh=FILE. New makefile targets:
tclextension, tclextension-install, tclextension-uninstall,
tclextension-list.

FossilOrigin-Name: 888284d1d47269e66e23627e2519cd2cf83ef65a777a679af20c288453f092e2
2024-08-02 00:59:32 +00:00
drh
ea9a25e500 Previous Makefile.in change broke the tclextension-install target.
FossilOrigin-Name: 7748367c78a1f480ec9e892ba77652e3c31a4b387b89221ae584891818804851
2024-08-02 00:56:31 +00:00
drh
0c059b598d Continuing refinements of the tclextension-install makefile target.
FossilOrigin-Name: 871c20a848e0e9b7f3d5661bd076fde16e9ec1e445a7ee657ef267978988ad56
2024-08-02 00:51:52 +00:00
drh
490661fd96 Extra robustness for the SQLite Tcl Extension builder, so that it works
on Debian Linux.

FossilOrigin-Name: 2f0738daaff48c51a60f063af6e453443bd7eedf6936daab325b2a36927c7a2b
2024-08-02 00:19:59 +00:00
drh
bb99e73ef5 Simplification the ./configure script. Carry Makefile CFLAGS and OPTS through
into builttclext.tcl.  Fix a bug in tclsqlite.c introduced by the previous
check-in.

FossilOrigin-Name: 72a80aa0abb121a23f8cc1eb1af04ba06c733a7a40c06f1fe9e62f2a0a26ca6e
2024-08-01 23:30:29 +00:00
drh
58c5a95c07 Add the tclextension-list makefile target. The the makefile running on Mac.
FossilOrigin-Name: 2f667cc8e54167342e17e63e1a017388365ebf4cd379f9c16c12e4603b34a326
2024-08-01 23:00:37 +00:00
drh
1bed50d424 New makefile targets: tclextension-install and tclextension-uninstall. Seem
to work on Linux.

FossilOrigin-Name: 534f8344abbda78e841edafe84c27ea8b1dfdecb9ab51271772a7f7264ef5b8c
2024-08-01 20:26:22 +00:00
drh
24b1d7a0c8 Work on a TCL script that will compile and install the TCL extension.
Works on Linux only, so far.  This is an incremental check-in.

FossilOrigin-Name: 58babd2aa4b5c9c70e1169cdf09f05eb95d7b13f50bb2ec0e487182288172678
2024-08-01 20:18:10 +00:00
drh
91db27aff5 Clean up and restructure the TCL configuration sections in autoconf.
The new --with-tclsh=FILE option lets you select the specific tclsh
that you want to run.

FossilOrigin-Name: 8fafc679d91e857602fbbe203144ca98242246660ede5a49c5fec8aaff571151
2024-08-01 18:10:00 +00:00
dan
f971c15b1f Clarify the role of Fts5Storage.pSavedRow in the new feature on this branch.
FossilOrigin-Name: e8a61d5c48073fdd4d99d0b6fc70469b37af009f281336a44e3789e7eeed820d
2024-08-01 17:15:17 +00:00
drh
a51de65758 Include a test case summary in the output of "errors" in testrunner.tcl.
FossilOrigin-Name: 173df1478e89996126e172656e35da8026d4ef145b2341ef56213f00ade14f48
2024-08-01 14:43:27 +00:00
drh
5cc7f4b580 Add the "errors" command to testrunner.tcl.
FossilOrigin-Name: 03b7f99229cfcffde024915e6812d75ae11318db9dc93a00838e4588a79b1243
2024-08-01 14:16:36 +00:00
drh
a1291e79d3 Fix the tclsqlite.c TCL interface module so that it works with both Tcl8 and
Tcl9.  Make changes across the TCL-based test harness to enable SQLite to
be tested with either Tcl8 or Tcl9.  Get the --with-tcl= argument on the
configure script working. Testing changes only - no changes to the SQLite core.
I believe the previous merge attempt didn't work because of errors in the
merge itself, not because of faults in the code.  Trying again...

FossilOrigin-Name: ea9d88f9ca3399bca83bf03893689a927b73e481604b94527e42de43f103eb46
2024-07-31 22:36:14 +00:00
drh
b030bc6980 testrunner.db should be in WAL mode for improved concurrency while running
"watch sqlite3 test/testrunner.tcl status".

FossilOrigin-Name: f23ad0979865f3c11a3dbd0598ee7c4e2eabeaf1863d000fc0242e18890a4a11
2024-07-31 22:26:04 +00:00
drh
5addf9f111 Make the #include section of tclsqlite.c the same as tclsqlite.h.
FossilOrigin-Name: 2afadbeb124d6d7bb81d473379269014ebd8601f98f231e2218f54350a2e5fd3
2024-07-31 22:25:25 +00:00
drh
d888e79bb8 Fix typo in testrunner.tcl for the "status" command that was causing it
to fail if any errors were seen.

FossilOrigin-Name: 8327c5ed535c57c4082211a50bfb1c32ea5d5fe1cf71f37798d8b58e88948ac2
2024-07-31 22:17:26 +00:00
drh
3f91c05e5d Use <tcl.h> instead of "tcl.h" to include the TCL interface.
FossilOrigin-Name: 4e32d4aed7c487ee9ed39a7e4486c2989a01781a3edbe9cdce52c6ed357f6366
2024-07-31 21:59:29 +00:00
drh
47ce12d239 Fix the tclsqlite.c TCL interface module so that it works with both Tcl8 and
Tcl9.  Make changes across the TCL-based test harness to enable SQLite to
be tested with either Tcl8 or Tcl9.  Get the --with-tcl= argument on the
configure script working.  Testing changes only - no changes to the SQLite core.

FossilOrigin-Name: 2a04b1bea12b0b4c3387d675f487337533ac0813248f70085398485e4cacd691
2024-07-31 21:46:46 +00:00
dan
5bd8cc7dd5 Fix various problems with the code on this branch.
FossilOrigin-Name: 8bd4ae7e95c7b6ce34db5ea705dc136e742a22f333d0e7370b485ebd736b5ec2
2024-07-31 20:49:00 +00:00
drh
ed1b616f4a More tweaks to testfixture-implemented TCL commands to make them safe for Tcl9.
FossilOrigin-Name: 67897ca97d8c98e119a498a3adb39548a579e12ee477e9dd74e9564a6f5e4c2b
2024-07-31 19:57:22 +00:00
drh
a7382d3523 Under Tcl9, the %x format letter truncates to 32-bits. Must use %llx in order
to get a 64-bit rendering.

FossilOrigin-Name: a3044e0ae65c099d76bf04536e223e70d89971688627c342252951f6c65f49d1
2024-07-31 19:56:14 +00:00
drh
15fef79a29 Fixes to testfixture routines needed to test snapshots.
FossilOrigin-Name: 66f61c3b35383b2575774d309043a722cc87a53d03518d339d6dbdcf342adc93
2024-07-31 17:15:24 +00:00
drh
ff79000f28 Fix a typo in testrunner_data.tcl that prevented --with-tcl specifications
from being carried through into sub-builds.  Adjust test cases to account
for new floating-point differences discovered when --with-tcl was fixed.

FossilOrigin-Name: b8f81351914deac99b14be6bb5e4096c1efed9bdb057750825760f09dae04656
2024-07-31 16:37:02 +00:00
dan
8e3042b565 Add missing documentation for new features to fts5.h.
FossilOrigin-Name: fa0da3b28e411affd45a918d6b7faba49f744ca8b4adf3cd5ce6609bb630499e
2024-07-31 15:46:41 +00:00
drh
ad2bcef112 Remove obsolete testfixture TCL commands formerly required by Windows
but now handled by Tcl itself.  Update tests case accordingly.

FossilOrigin-Name: 4f065fb638b24b33283518af8ad55f28a49cfac4086fa5e4568e2f3a6814962d
2024-07-31 15:04:37 +00:00
drh
3f80dbd51e Fix problems uncovered while testing Tcl9 on Windows.
FossilOrigin-Name: d5523c77fd0bcdc8344971a116d6ce9657f2b6daddeb7d936cd7607163a36744
2024-07-31 13:00:18 +00:00
drh
096c22ad5e Minor adjustments to get Tcl9-based testing working on Macs.
FossilOrigin-Name: 066c8672ee85a6ce972de38fcd3793fc2c1ef4f21c3de2379746d0ff18df8dc0
2024-07-31 12:19:16 +00:00
drh
d3b58968a9 Adjust the configure script so that the --with-tcl option is used to
find the appropriate tclsh.

FossilOrigin-Name: 6fb9e37c751cd1a411c77f792794e1abafa5c40ad4dda8d433600d44d525a97c
2024-07-31 11:42:47 +00:00
drh
f15c80d80f Patch to testrunner.tcl so that it works with Tcl9's pedantic UTF-8 checking.
FossilOrigin-Name: 8d4a23d32dc16b115153e6e100ba3ba15273c3e37310e8a1b4bace885c5383a8
2024-07-31 11:12:13 +00:00
drh
e388fc7367 Fixes to tclsqlite.c to facilitate TEA installs.
FossilOrigin-Name: 7157c3c910565c9385a028793a0c0106c5064ab6a8a6efbe29dd1f1cdb2bd48d
2024-07-31 10:59:19 +00:00
dan
c97cdbe523 Merge latest changes from trunk into this branch.
FossilOrigin-Name: ff64939ec8399949393f1029fa6d514892fbf2bf1498545300cc5e120b9622a5
2024-07-31 10:52:38 +00:00
drh
4400b0ac45 Fix a problem with strictly conforming UTF8 in shell1.test.
FossilOrigin-Name: 8ee187f98d310e1e7cf6c3fdf000c19e98a9f11e01436c3c407df04da79aa7c0
2024-07-31 02:01:19 +00:00
drh
3bad3d6964 Adjust a few tests that don't work even with the new floating point
comparison routine.

FossilOrigin-Name: 895125a4895099df7c3841ca7c34697ba17fd667bddbc2fd7148f7aa9d6d2b9d
2024-07-31 01:53:48 +00:00
drh
f504cc761b Implement a new comparison routine to compare text renderings of
floating point values.  This gets the number of failures down to just 5.
But the routine needs work, and probably refactoring.

FossilOrigin-Name: 71f2ee5db01150707401804b136641170e7ed44760fccec20de19184e4d0a840
2024-07-31 01:45:14 +00:00
dan
9015b8822d Fix cases surrounding blob values being stored in locale=1 fts5 tables.
FossilOrigin-Name: ae435aff1785d5832821c19dc88ccf6c496a7ff55be80276b31e5c9abee723db
2024-07-30 20:39:58 +00:00
drh
262addd9ab All tests in "make test" now pass with Tcl9, except for about 198 cases where
the error involves small differences in the rendering to floating point
values.

FossilOrigin-Name: 8e27f5326c69aa4fb6f3f1f42668ab1b08140ab0a614ac4a9d94679c8fb9734e
2024-07-30 20:39:05 +00:00
drh
a28a784ef4 More adjustments to the incrblob channel: Apparently you need to wait
until the close2Proc is called with a flag of 0 before actually shutting
down the channel.

FossilOrigin-Name: fa549a5507b5f805b469b4360c11155aa9d22043f01f6d9428bf44d0f2351eb0
2024-07-30 18:49:20 +00:00
drh
15669d302d Adjustments to test cases for session so that they work with Tcl9.
FossilOrigin-Name: d417415b967e62d41667e14ebf5455932ebf38d218a941f13878f0aba6d19bc8
2024-07-30 18:42:31 +00:00
drh
1c2ad465c6 Tcl_ChannelType implementations for Tcl9 apparently require that
wideSeekProc be implemented.  Also adjust minor test script issues for
fts5 tests so that they can be run sequentially and so that they do not
depend on the specific floating point output formats generated by Tcl.

FossilOrigin-Name: 19fda979c5dc1a385ed3f8ab8df34388c1acfc7ff951fe1b183a79186bd20cdb
2024-07-30 18:15:59 +00:00
drh
780187f090 Get rid of "-encoding binary" across all test cases, as that is no longer
supported in Tcl9.  Use "-translation binary" instead.

FossilOrigin-Name: e0d9670dd98a22d2e22aac8ba8720787a05e280e18ec9b2d4323f947c83718f5
2024-07-30 17:09:51 +00:00
drh
3302bf4dbd Use the SQLite format() function to format floating point values for test
results, to avoid inconsistences in TCL versions.

FossilOrigin-Name: 6a63c472190dafb36582c116c925bbcbe48c3a2f3217fc1ffcb64a733b0151e1
2024-07-30 16:59:33 +00:00
drh
1631c64f78 Fix the incrblob channel so that partial close works with Tcl9.
FossilOrigin-Name: d54ec2de78c2aed12be643e59a30b6827fe4728a0ab6504dd64ee9116e5f885a
2024-07-30 16:51:51 +00:00
dan
8174305e17 Update the highlight() and snippet() functions to use locales when available.
FossilOrigin-Name: 569ae56a673a2e101fac7003a1cb41c7a02a515adf55bd1e1f2a03c19eb2b085
2024-07-30 15:55:51 +00:00
drh
064b681e9b First attempt at getting the build to work with Tcl 9.0.
FossilOrigin-Name: 6e5bb48a74d63fb8c30528f0005d1763cd2dbb882abf86baf1565721e6bfcf84
2024-07-30 15:49:02 +00:00
dan
8f14c45197 Fix xColumnText() and xColumnSize() APIs. Add xColumnLocale() and xTokenizeSetLocale().
FossilOrigin-Name: 14006711d83d098e665c540b978b0e29aa8f458da1c2c8e9c2baf2ad5ebd502c
2024-07-29 20:31:17 +00:00
dan
b4afecc626 Fix a couple of asan problems on this branch.
FossilOrigin-Name: 4e3e529313c86b42d5f1ba113d0714d1545bc6641e09e4537d622057f0352989
2024-07-29 15:00:11 +00:00
drh
07f215ad9e Fix documentation typo.
[forum:/forumpost/993cb82402|Forum post 993cb82402]

FossilOrigin-Name: 86de4e755e37dc1cbcbd59018927aa87ff49fc15f706a36187631d8f14075c12
2024-07-27 20:28:13 +00:00
dan
53bef48fbe Ensure that an fts5 UPDATE does not strip the locale from columns that it does not write to.
FossilOrigin-Name: 69205264debd829573b1c777a5a493cfeb6083c4cdec106b1f819989f859ac75
2024-07-27 19:46:10 +00:00
dan
2ec78c0e4b Add the fts5_locale() function, and begin adding the related functionality to fts5.
FossilOrigin-Name: 8839ef7cfb49239e7f1c4812a53a93a672827c88d6921408b1d5062b352c87cc
2024-07-26 20:50:33 +00:00
stephan
b16c2980b3 wasm minimal build: strip authorizers and JSON support (saves approx 35kb). Strip vtab support from the JS bits but cannot yet strip it from the C bits because that requires a custom-configured sqlite3.c.
FossilOrigin-Name: eb64d106551718467e0f6c6b53695410bf4c566901008e4cda8580d0f7efa7b0
2024-07-24 23:58:28 +00:00
stephan
fe225745fc Restructuring of the wasm build to support an experimental 'minimal' build mode which elides all non-core APIs.
FossilOrigin-Name: ee2191f7302210100fa0b29ace8156531ad995bf61aa2642e526e0901d0c6862
2024-07-24 22:07:18 +00:00
drh
4f2144dac0 Add the percentile extension to the CLI by default.
FossilOrigin-Name: bcc31846964102385d5a21eb5e85d7db153b155e76b4e2847c9453d3d0e1af04
2024-07-24 13:53:51 +00:00
drh
b18d851119 Add the percentile_cont(Y,P) variant of percentile() to the percentile
extension.

FossilOrigin-Name: 095c22e62248f8ef50cd8531171827f50a7bdd4fc1128bf0e616a3eb2dce980e
2024-07-24 13:41:09 +00:00
stephan
4eabec5b18 JNI SQLTester: fix --new command to force-replace db if it already exists. Add no-op impls for --stmt-cache and --jsonglob commands.
FossilOrigin-Name: f1185dc349d076a6b8ea22f9b5cd527bfd60e9afd55eaec754c0e2b4d7edd5d4
2024-07-24 12:12:11 +00:00
drh
171c944345 Enhance the percentile() extension function to include the median()
variant.  Update the implementation to implement its own sorting
algorithm, so that the extension no longer depends on qsort().

FossilOrigin-Name: 6e31b1bab1f014933c671a12a5930c1e88d611cfe68d389e9ce888bd8842addd
2024-07-23 16:23:46 +00:00
stephan
8bd5ff4f32 Doc typo fix. No code changes.
FossilOrigin-Name: 8d558ad25bfbdea04de87616d4e3f664b5749a7d23643d1a0238e991b4bb337e
2024-07-22 21:46:55 +00:00
stephan
faf10c521f Move a block of JS code which was inadvertently (and harmlessly) moved in the previous checkin. Clarify the semantics of an internal-use-only API. Add another WAL-related JS test.
FossilOrigin-Name: 6cd9f55a975b5237efee8776efce7e7836b41905ca750f82be3b90aa04c1dff2
2024-07-22 21:21:25 +00:00
stephan
71e2bdb2b4 OPFS VFSes: remove the on-open() pragma calls, as those (A) already reflected the build-time default settings and (B) they made it illegal to run locking_mode=exclusive, which is a requirement for WAL mode without shared memory. Modify part of the test suite to demonstrate that the SAHPool VFS can run in WAL mode so long as locking_mode=exclusive is used.
FossilOrigin-Name: 19cd8e2b056d7842ee39afb7160c901c9dc55a5bac8049cb0b5246210f6b920d
2024-07-22 20:58:51 +00:00
stephan
04416ddc51 wasm build: resolve a circular dep and do some minor tidying up.
FossilOrigin-Name: 9df3f1f24c6346dc94695bf533501c54379bb6e3cf492b67dda8a64a6a1eb495
2024-07-22 19:52:02 +00:00
drh
6326e30f86 Fixes to TreeView debugging output for VALUES clauses.
FossilOrigin-Name: b6aed8bcb06edc7f0221fd707d5adc227856fe62dbcaae5ffe1fb4faa5c542e1
2024-07-21 23:34:52 +00:00
drh
c855df67a4 Improved debugging output when using PRAGMA vdbe_addoptrace:
Show the range of opcodes being checked for Column-to-Copy conversion.

FossilOrigin-Name: 2c122026db979a099a3d1a14ae1e01a0a64a559905ea414b2d80ed7dc3e04846
2024-07-21 23:10:55 +00:00
dan
aecfb0a3b3 Fix an oversized allocation in sqlite3ExprCodeIN().
FossilOrigin-Name: d7be326a80e7b3aa8fd6e5e059c04e6ad3feaffcb20b1e3c251d7195ddc1be8b
2024-07-20 16:11:12 +00:00
stephan
f73912694b Minor typo fixes in test-script-interpreter.md.
FossilOrigin-Name: bf54b26092ded2e6acc779acfb960364f05c665c7626c38ffae61caae5636184
2024-07-18 19:17:29 +00:00
drh
d109de8f84 Fix a problem in FTS5 where it reports the wrong error code following an OOM.
FossilOrigin-Name: 0c1cc4071edcd3e465779bbb17ea3ee6ddaa7c93c4fde55e5f3e07aa4b45783b
2024-07-18 18:44:44 +00:00
dan
9d82438dcb Fixes for platforms with 32-bit pointers that require 64-bit values to be aligned.
FossilOrigin-Name: 539e4f661767ef90aef8d995f1f75fd5f550703bba1517cd3caff84a4afe2b37
2024-07-17 18:38:34 +00:00
dan
a592883d87 Add extra assert() statements to the fixes on this branch.
FossilOrigin-Name: 81b6360050eea95e4367de1b41b5864a640b4d1c5c8fc3bea3b96ed770cb0325
2024-07-17 16:27:36 +00:00
stephan
1ffd7ed54f Slight doc touchup for [af41a1e6fc8b36e9bf65] based on feedback. No code changes.
FossilOrigin-Name: be7b1fc0c5d8cda971b471dfcb4637212bfff4f42b1e074077a381cc493d877a
2024-07-15 10:11:21 +00:00
stephan
a0a1fb876f Improve one of the JS test cases.
FossilOrigin-Name: 3767d8bef2dfa661b56c1bfaa4695e32ce26874154e4a322f0d599c257c6fc70
2024-07-13 18:16:40 +00:00
dan
7acf972c59 Fixes for platforms with 32-bit pointers that require 64-bit values to be aligned.
FossilOrigin-Name: 2212d7488ed4ec2839ffa45cb9567056b36519434834634e4ecc441c330694d7
2024-07-13 16:53:56 +00:00
stephan
441993200e Add JS binding for sqlite3_column_decltype().
FossilOrigin-Name: 5252d292b14f6ed99b09f6330b19effd488c2b23ff6ea33311321a065d3f6ce2
2024-07-13 15:42:30 +00:00
stephan
7052c67c36 JS doc touchups. No code changes.
FossilOrigin-Name: a8e240495ff7e0cd38301ef2de215a7cc10fea832311bd19ca2592858ee4e6ff
2024-07-13 15:21:35 +00:00
stephan
55a4bea72a Add JS bindings for sqlite3_stmt_busy() and sqlite3_stmt_explain().
FossilOrigin-Name: b772edfb44143107d4993bde600d0f4c45184f29a4deee403105c64748c36523
2024-07-13 14:07:47 +00:00
stephan
0b9efaffd7 Add missing sqlite3_bind_parameter_name() binding to JS.
FossilOrigin-Name: 6dcfcc7e1c0772b11aec750bb75899a5c8e452735ecf5028c001fbaa7aa6fda0
2024-07-13 13:22:32 +00:00
stephan
6f9b37b35b Add JS bindings and tests for sqlite3_interrupted(), is_interrupted(), and db_readonly().
FossilOrigin-Name: 5589ba5651d80479ae555429340fc74390ff07d3e05ba770bb7d82490211e00d
2024-07-13 12:50:42 +00:00
stephan
c636e124df Remove a stray/harmless duplicate wasm function export entry.
FossilOrigin-Name: 5402e4fb1cbd7a2c3dee6ebfb492a076d05daa66f747d18602338874405829df
2024-07-13 11:47:44 +00:00
stephan
db8939f481 Add several convenience links to the OPFS VFS concurrency tester app for launching it with various combinations of options.
FossilOrigin-Name: 397d6a18f173a46b60a867fc45611045c76316d6602a3df8b4dc4ba45e1348ce
2024-07-13 01:40:36 +00:00
stephan
bdc4ffacec Add an option to the opfs-sahpool VFS which tells it to ignore a previous init failure and retry, as an opt-in workaround for a browser quirk which occasionally denies OPFS access on the first attempt and permits it on subsequent attempts. This resolves [https://github.com/sqlite/sqlite-wasm/issues/79|issue #79 of the npm distribution].
FossilOrigin-Name: fbf3948a4ba27c6ebf55b24e7463b20026439f04d1974bafe78df5c5bc958f59
2024-07-13 01:02:57 +00:00
stephan
f7623a0871 Rename the new opfs-sahpool init-retry flag to the suitably descriptive, and suitably onerous, forceReinitIfPreviouslyFailed, based on feedback.
FossilOrigin-Name: c9f0a6090258534a3d81066df5610229183a8457fc60d5034b4b94d9a29796e4
2024-07-13 00:55:55 +00:00
stephan
2e32cbc4a5 sqldiff: fail if the 2nd db argument cannot be opened read-only.
FossilOrigin-Name: e8b33525fc2b4d609a7be9acc43fbc66638effaa7b092b48568ded6c53c4f4db
2024-07-12 14:41:16 +00:00
stephan
be3778dee2 Work around a difficult-to-trigger Atomics API message-passing quirk in the OPFS VFS which appears in rare instances in some browsers when running high I/O loads. This resolves [https://github.com/sqlite/sqlite-wasm/issues/12 | issue #12 of the npm distribution].
FossilOrigin-Name: af41a1e6fc8b36e9bf65a5bb0154e1ce7eb99903cb5a3e4779322527c29d8780
2024-07-12 13:49:54 +00:00
stephan
74d5faec93 sqldiff: if the first db argument does not exist, fail instead of creating an empty db. Resolving that for the second argument is trickier, as discussed in [forum:ec2d429e32 | forum post ec2d429e32].
FossilOrigin-Name: 0547ccf776c6054732437bffb8b2fe2ed5194ef817c2593f8cec4a3e2b749720
2024-07-12 13:45:15 +00:00
stephan
8ee747dda5 Reformulate the forceReinitIfFailed handling based on feedback, to correct the type-checking and resolve a potential race condition.
FossilOrigin-Name: c4f468309158f9b951137461213fb269d96d15c331256cf392a56c9bed231460
2024-07-11 19:50:17 +00:00
stephan
20ff50ad10 Remove the timing and counter metrics from the OPFS VFS, as they're long-since unused so are just wasted CPU cycles.
FossilOrigin-Name: 67c035c34fb916e66bfe115a132660771e8fa2921e6d46756975c5df3ebcd73c
2024-07-11 14:07:46 +00:00
stephan
9b183a234c Add some docs explaining [64f4f3cd878b1a72].
FossilOrigin-Name: 4fdf9a322fccf7d68b03d07a42a526f18f951e2e19228b7d41e01121b667cc86
2024-07-11 12:57:58 +00:00
stephan
d3bb31b931 Proposed workaround for the "errant op" case in the OPFS VFS, as discussed in [https://github.com/sqlite/sqlite-wasm/issues/12 | issue #12 of the npm distribution].
FossilOrigin-Name: 64f4f3cd878b1a723caa0cd54b21f10fdb27d4e2ecb19fc233cbc8dd9d06f259
2024-07-11 12:36:28 +00:00
stephan
9958c51a5d Add an option to force the opfs-sahpool VFS init to re-run after it fails on a first attempt, as a workaround for flaky environments where initial access to OPFS sync access handles is rejected but then permitted on a second attempt. Reported and discussed in [https://github.com/sqlite/sqlite-wasm/issues/79|issue #79 of the npm distribution].
FossilOrigin-Name: 5286e0f654d91a4ebee51fcabaab696e17ff07bb18990b401a31bd3d1213e695
2024-07-11 11:04:17 +00:00
stephan
64ef4582c2 Rename some JS files for consistency. This affects only the build process, not the deliverables.
FossilOrigin-Name: bcef3f71a2f68768819d9f716f2c29e752fb173df1506469c8669d95ecc2ff50
2024-07-10 08:33:52 +00:00
dan
68d700cac6 Fix a use-after-free that could occur following an OOM introduced by [d8cedbe0].
FossilOrigin-Name: 4fabfacfcf38e129949d3e4e2c3ffde3da3cd40d9d12c97ca29bc7c3604db6ed
2024-07-08 17:39:52 +00:00
dan
bee10b987c Improve the error message returned when fts5 finds a row is missing from its content table.
FossilOrigin-Name: 9b1afd4acb8cf9738154e921dcb074d895bbcc4742bf1016ef9f045a0da78bc8
2024-07-08 16:01:49 +00:00
drh
42123a294d Use a mini Bloom filter to help reduce the number of pointless searches for
prior SubrtnSig objects when generating code for IN operators with subqueries
as their right operand.

FossilOrigin-Name: d8cedbe055b40a0ea4e5d47845b535162e9fcb0d0f88c03211797ab64d2d56fb
2024-07-05 13:55:59 +00:00
drh
635c6b8086 Improved reuse of subqueries associated with IN operators, especially when
the IN operator is duplicated due to predicate push-down.

FossilOrigin-Name: c9a3498113074bbcd9a8c8d30286fef6c6a49ad2c84b90ec0f5a148389d6245c
2024-07-05 09:56:11 +00:00
drh
615fc1f083 Small performance optimizations.
FossilOrigin-Name: 99fd34b58a9b09af20f1f1a3c37137ae55159310c8af97806550eeee6adc4fc5
2024-07-05 01:05:34 +00:00
dan
a61f11f307 Add test cases to in7.test.
FossilOrigin-Name: 07817efc10a6ab59dcb18ad218a3bb5a5d49a724c51296d5c8d7e386b0e0c789
2024-07-04 18:56:26 +00:00
drh
42305fc126 Disable the reuse of IN-clause subqueries if the subquery is an explicit
"SELECT ALL".  The ALL keyword is almost never used in actual practice (most
developers don't even know it can be used) so this should not interfere with
the optimization, but it does give us a convenient way to turn it off for
testing purposes.

FossilOrigin-Name: a81299be2ce203dcc28e7d0ba24791cbfba80e1ee3e1564469a226cac8adb17d
2024-07-04 18:26:41 +00:00
dan
6c23f1941b Update EXPLAIN output to include P4_SUBRTNSIG.
FossilOrigin-Name: 61e56923c80d72d6467ec703b4946b251abf591649fa9e8e579667d7cbd25682
2024-07-04 17:49:34 +00:00
drh
0cf237c5b0 Be more aggressive about reusing subqueries that appear on the RHS of IN
operators that have been replicated due to the predicate push-down optimization.

FossilOrigin-Name: 2accf32b6e45a396503c29eecc14a103bcc7b4c313cde921b26b489704060177
2024-07-04 16:57:11 +00:00
drh
6357d35da9 Add comment using the name "predicate push-down optimization" to what we have
also called "WHERE-clause push down".  No changes to code.

FossilOrigin-Name: be77fe701c7b7d3407800e1ed6a4c8be14035831790419cc99362bff41c65b60
2024-07-04 11:15:32 +00:00
stephan
9e278d7ec0 For shell completion, use pragma_table_xinfo instead of pragma_table_info, so that generated columns are handled, as reported in [forum:f0735e05d8d7e857|forum post f0735e05d8d7e857].
FossilOrigin-Name: a204ffc06b468c2edf8f11ccf3de639edd4f8282e69a44ceeb68a4d3a43e77ea
2024-07-04 09:45:23 +00:00
drh
ba384470c4 When constructing an ephermeral table to use as the right-hand side of
an IN operator, also construct a Bloom filter to speed membership testing.

FossilOrigin-Name: baa83b460c677c210c7fa3f20314d7e05f305aed8a69026bc5fa106a3de4ea38
2024-07-03 20:19:33 +00:00
drh
5b070cfa0f Show the creation of IN-operator Bloom filters in the EXPLAIN QUERY PLAN output.
FossilOrigin-Name: c10a1b99d47a4c93bdb16e646f6a21add570d6dbb34fd91a32f8abacdb28712b
2024-07-03 20:10:42 +00:00
drh
c4c2589ff0 Add a new sqlite3FaultSim() call to OP_NotFound to use for testing purposes.
FossilOrigin-Name: 84fd275bfd8afada50d3a5ac491d2b866671f8f0d2496bd240cf4bfdd74e7399
2024-07-03 18:56:56 +00:00
drh
6172e4355f Use a Bloom filter to improve performance of IN operators when the RHS of
the IN operator is a subquery.

FossilOrigin-Name: 1933496539c19cbf429a39d6b0b1c6b1b2af50733a3c4aea4920990ced652f6a
2024-07-03 17:51:48 +00:00
drh
3d24637325 Add assert() statements to FTS5 to hush-up warnings from scan-build.
FossilOrigin-Name: 77a76654e64c05f2c67be120f579fc60924ff51a9d0fa2cf9eb158f40171b5f5
2024-07-02 13:54:46 +00:00
drh
8960c02b91 Reword the deliberate_fall_through macro along the lines suggested by
[forum:/forumpost/7ec11023dd|forum post 7ec11023dd] so that it works better
with LLVM, while preserving compatibility with MSVC and older GCCs.

FossilOrigin-Name: fc248a4a0a232a95a79e24e57faedb5d824c3bf0aa62054b72339257dc9c18b3
2024-07-02 12:16:29 +00:00
drh
2143714d9f In the CLI, if the XDG_CONFIG_HOME environment variable is not set, then also
search in ~/.config/sqlite3/sqliterc for the initialization file.
See [forum:/forumpost/5cc6d059e9e092ed|forum thread 5cc6d059e9e092ed].

FossilOrigin-Name: 33841c9c3cb57beeb3884d4b0715d26199926b7d3e4d3dd1ab6f5603b5a62591
2024-07-02 11:30:10 +00:00
drh
f1bf103e4e Fix a typo in a comment in a test case. No changes to code.
FossilOrigin-Name: f501166de4f967b7e2e895f180308630e3c88b12bc51823a0a124ee5089eae4f
2024-06-29 15:57:55 +00:00
drh
6adbdac676 Add a NEVER() around a branch in sqlite3ExprAffinity() that is designed to
prevent an infinite loop, but which can now never be reached due to recent
changes.

FossilOrigin-Name: da0b794852f8ccba5bd30395892044ec71b148075608406867785395e1f50b31
2024-06-29 12:22:32 +00:00
dan
75bdf00e89 Update fts5 comment/docs to include the order matches are visited in by the xPhraseFirst/xPhraseNext API.
FossilOrigin-Name: e41930ef5b883c0f2a6b7eb9606021d14a3df145bc94cb0d508af22b4db7f168
2024-06-28 18:21:30 +00:00
drh
f13e2d22fe Additional steps to make sure calls to sqlite3ExprToRegister() are sane.
FossilOrigin-Name: 1c42d7176b228791f99bc9971d92a9ab67b1e2956ca4f8d934bd1a3e596d6c80
2024-06-28 18:07:10 +00:00
drh
076bd5758b Do not convert an expression node that is already TK_REGISTER into a
new TK_REGISTER.  This is a follow-up to [663f5dd32d9db832] that fixes a
bug discovered by dbsqlfuzz.

FossilOrigin-Name: fcb669cfaa8a59ca710504d5aaa1936f65a6da8ff13473ad84458f97a6fd1f49
2024-06-28 17:14:00 +00:00
dan
105c20648e Fix an incorrect tcl comment that appeared in many fts5 test files.
FossilOrigin-Name: d07085e2035b52a7edd27980523225e59c5bf851fb4a6de975f03e653b937c9c
2024-06-24 18:06:15 +00:00
dan
fdda1cbe0c Fix some problems with calling fts5 api functions from within non-full-text queries.
FossilOrigin-Name: 56d265f956fe6433b625c6d732e55f387af3f643e705316f5a6f709d63731669
2024-06-24 16:08:01 +00:00
dan
1d8cde9d56 Enhance the output of ".scanstats vm" to include the absolute number of ticks for each VM instruction, instead of just the percentage of the total.
FossilOrigin-Name: 1535828335d2b0eccebae952ed2bc70cc0cd893bd4b079d26b80deff9b5f752b
2024-06-24 14:53:14 +00:00
drh
51b3b402c4 Revert Lemon so that it only shows -D options that are actually used. Though
the change to display the options in sorted order is retained.

FossilOrigin-Name: e54eb217c9508c19aee085b111a1323c9009f014ba4db6019918e27002c4ca8c
2024-06-19 18:54:04 +00:00
drh
8cf7bd5448 In lemon, show all the -D options in the generated header, even if none of them
are used.

FossilOrigin-Name: 2aa009c38bb207ac59b9bbd6f8e0d7315697b3fd6a01f9431f29a3c7ccad53e7
2024-06-19 18:46:44 +00:00
drh
199f091a95 Enhance lemon.c so that when it shows the compile-time options in the header
comment of the generated output file, it shows all options, even those not
used, and it shows them in sorted order.

FossilOrigin-Name: eed76e6698eabe47c6bf9696599ce1c2f7aa428cf60f39d0566fbd0d1f6c4c62
2024-06-19 16:38:17 +00:00
stephan
d8295c8674 Remove some extraneous flags from the fiddle-debug build. Internal doc tweaks in the main wasm makefile.
FossilOrigin-Name: afae2c9e6fba0820c9be8d06a2e301a74167e4457bada45fe57b5fd9287d2e8b
2024-06-19 11:08:58 +00:00
stephan
68ba3980d5 Minor cleanups in the new fiddle build code.
FossilOrigin-Name: d356aebdd450bedc1ecbbdd266effe53c7badbd74ed7e6db8d0c31318d99a35f
2024-06-18 22:03:28 +00:00
stephan
e042988dc0 Rework the fiddle build to build separate debug and non-debug bundles, with the latter in ./fiddle-debug.
FossilOrigin-Name: a9f1758f1cbe7b7d0c87dfb060f52d03c6ea0e066c079891a8ff354073997f9e
2024-06-18 21:50:30 +00:00
stephan
98526f906e Remove an extraneous CSS file and import its CSS into the one HTML file which uses it.
FossilOrigin-Name: 66085ca42388e8de741712150541a3e0afb06b3e23e738aa9ff687e9fc494c50
2024-06-18 20:47:05 +00:00
stephan
bb6d32ae71 Add fiddle-debug make target to ext/wasm. It builds the same target files as a non-debug build, as opposed to a new copy, but adds various debug-related flags.
FossilOrigin-Name: 993143c5c39fb6ee15b0661cec8fed436ff04543b528a3796534f5e3a44799f5
2024-06-18 20:40:11 +00:00
drh
c98d42e802 Add instructions for how to do debugging builds of the CLI on Windows.
FossilOrigin-Name: abe81c18614b41c78cf3edeaaf8d85d5d2dbdcf331b580f1c98f80d3726d8189
2024-06-18 19:36:04 +00:00
drh
99623a83aa Update sqlite3_analyzer to report on the number of WITHOUT ROWID tables and
to provide separate aggregate statistics for WITHOUT and WITH ROWID tables.

FossilOrigin-Name: 4152894433c3a292d983b1c196664a0c46e406eccd7e644a64fa443fdb204825
2024-06-18 12:19:13 +00:00
stephan
e9540e2881 Internal doc typo fixes, as reported in the forum. No code changes.
FossilOrigin-Name: ea16b286b4344c1833ca3d17b6d315fb4ddcb99bcc232ff6444debeb634881f2
2024-06-18 09:58:39 +00:00
stephan
c7cbcfbbbd Remove some dead JS code.
FossilOrigin-Name: 754e6e059b740435475c1869feeaca39585b262d5c27210e0fbddbbcc202c4d5
2024-06-16 17:06:50 +00:00
drh
9175b18226 Do not omit the ORDER BY clause from a recursive CTE just because the
query that contains the CTE also contains an ORDER BY clause.  Plus
other changes imported from the recursive-cte-orderby-fix branch.

FossilOrigin-Name: 13242289c5d412b706f50fc7e1553032ea3a52d41a3e34e155432adaf0551481
2024-06-14 23:13:54 +00:00
stephan
709cb313cf Remove some dead JS code. Improve the exception-to-C-result-code conversion to account for the case of a file disappearing while the OPFS VFS is waiting to acquire a lock on it.
FossilOrigin-Name: 5bd9fd5f61e7cd1ed3b44c5cabc759c154c98eb40ad10d29e61f142aaa062ddf
2024-06-12 22:15:25 +00:00
stephan
063a2b338c Remove some JS docs which no longer apply. No code changes.
FossilOrigin-Name: f253cab3359270045a3ae9f5e9eadc1cfc8844181db127165bfdf49d5f99efb1
2024-06-12 21:01:44 +00:00
dan
718c5ff551 Fix a problem with rolling back hot journals using the unix-dotfile VFS.
FossilOrigin-Name: a44703135e8dd3cc67e548e1aa3c42e71df127fb7b593ccfc06025ec42a501fd
2024-06-12 15:50:35 +00:00
dan
9e72ea5ddc Omit tests that depend on sqlite3_release_memory() in lock5.test when running the memsubsys1 or memsubsys2 permutations.
FossilOrigin-Name: 9d63033bf46ddf0f4d9d4ef06d56357fe6165f2370cd19cf81c2f7f61ce224fc
2024-06-12 15:29:37 +00:00
stephan
fd70ca40cc OPFS VFS: change the xCheckReservedLock() impl to always return false, as discussed in [forum:a2f573b00cda1372|forum thread a2f573b00cda1372]. This does not impact any current tests, and may have no direct impact at all because of how that VFS handles locking, but is hypothetically a more correct solution than the previous one.
FossilOrigin-Name: c298b8ba2dcd01fa28b79a78bb4986fa0282755a0a36b7f38b93096ac31f521e
2024-06-12 12:36:02 +00:00
stephan
01f07a61e4 Doc updates in JS code. No functional changes.
FossilOrigin-Name: 587ed3a5d283898ad0e67ccee86a0a4ccc432fa292c0a3534e9e6ec70a7b7780
2024-06-12 12:17:03 +00:00
dan
f8ed7db472 Do not attempt to run hot journal rollback tests in lock5.test with the "inmemory_journal" permutation, which cannot generate hot journals.
FossilOrigin-Name: 1e6fa95b88cace9e6cac476863d57cfd8de483f83c922ff964b77cbaee6e9ae4
2024-06-12 11:41:18 +00:00
stephan
6975fc56f7 Slight API doc tweak for xCheckReservedLock(), based on forum feedback. No code changes.
FossilOrigin-Name: 2af7a96f6868a4529d689702926b350a4c00082f14da0ded5a8eaea295682d17
2024-06-12 11:39:29 +00:00
dan
41caf1cdfa Handle the case where unix-dotfile is used with URI parameter nolock=1.
FossilOrigin-Name: 3925a5b904e159d54455cfc73fe837a9c6ea3a6d60da63afde3242b4d6f67c90
2024-06-11 20:28:56 +00:00
dan
f6ec2b5946 Fix a problem with rolling back hot journals using the unix-dotfile VFS.
FossilOrigin-Name: 4ae3300b79e03381fd7f1033bb7978bb6367369790f17c3bdacac51e205edaf9
2024-06-11 20:03:32 +00:00
stephan
e15d5de0a6 Remove some dead JS code and update some JS docs.
FossilOrigin-Name: 6935ac71bad3d36cc519f0325ae4447a674f257309d020cdc0741160fcce0580
2024-06-11 17:04:43 +00:00
stephan
cf2710e0b6 When compiling shell.c in SQLITE_SHELL_FIDDLE mode, ensure that the shell_main_exit goto label is reachable.
FossilOrigin-Name: 06e6f64533563ab9c059b773e5f0d78085df716f2624e547b7259f6789c3ffe0
2024-06-11 17:04:02 +00:00
drh
941602ae4f Change constant expressions to pre-computed constants, because apparently
MSVC on ARM requires that.
[forum:/forumpost/4feb1685cced0a8e|Forum thread 4feb1685cced0a8e].

FossilOrigin-Name: 6c103aee6f146869a3e0c48694592f2e4c6b57ecdb4450f46e762c38b4e686f1
2024-06-11 14:36:56 +00:00
drh
34e4c6f732 Improved header comment on the sqlite3FpDecode() implementation.
For the fpdecode() SQL function (available in debug builds only) limit
the value of the third parameter (mxRound) to be positive.

FossilOrigin-Name: 56af06fa12104a1fe119d7087746011183af053834eac72d0fb69f60d98054c6
2024-06-10 12:43:03 +00:00
drh
2fbb3fb532 Disable the omit-noop-join optimization when there are 64 or more terms in
the ORDER BY clause.

FossilOrigin-Name: 40de3939792e17df25598b3e60d1cebcecde2b00832acd55604f14b21398a9a7
2024-06-09 17:34:03 +00:00
drh
df9471b1b5 Allow the query planner access to the argument of LIMIT even if that
argument is a bound parameter.

FossilOrigin-Name: c4a9dda2809c6e0e3d928e11e5553ead82cd9df551bcd35b11a7d869ef80ab8e
2024-06-06 23:56:36 +00:00
drh
bd1402487b Omit bogus tests accidentally added by the privious commit.
FossilOrigin-Name: e94dfe9928750dd98145d4d9920b298f7b0868703b487f86e0db77a41d53ccf9
2024-06-06 23:22:32 +00:00
drh
4703b7d092 Better optimize queries that use parameters in the LIMIT clause.
FossilOrigin-Name: e58cb304d1e0ec6e30260a165aaccc2cf096ce6c999efb06683c4ef600ee12ef
2024-06-06 15:03:16 +00:00
stephan
404ddadbd4 Re-enable [dcc2bb2c562e97e090174], as [296eeb26c816bc73] corrects the wasi-sdk build problem the former check-in triggered. Reported in [forum:143e40d7f4e79c66|forum post 143e40d7f4e79c66].
FossilOrigin-Name: f66608bd356efe492d1003663c2e1ccd7cfbf2d40393d256f8720149904ad2d5
2024-06-06 12:22:19 +00:00
drh
fd6beda14b Adjust the parser so that the value of TK_ISNOT is similar to the value of
TK_IS.  This helps the compiler generate faster switch() statements on the
Expr.op fields when there are cases for TK_ISNOT and other common operators.

FossilOrigin-Name: 34f05c3d89b2dd15e4b0d1ba292df7de3dfc54b505c0ba145cc3db52cf020845
2024-06-06 01:21:57 +00:00
drh
48f5e52728 Small performance optimization in the operatorMask routine of the WHERE
clause analysis logic.

FossilOrigin-Name: 9d69fc1c87ae673356869ecd89eb19734fd126702c0f9fe595336ecd7be89e08
2024-06-06 01:00:50 +00:00
drh
b458cbb601 Small performance optimization in the allowedOp() routine of the WHERE
clause analysis code.

FossilOrigin-Name: 4ba8be544711e07748e8dd3ca6b81f9897906061c0a1a1bb4fb3808dc27f734b
2024-06-06 00:49:36 +00:00
mistachkin
6593b340ff Fix harmless compilation issues seen with MSVC.
FossilOrigin-Name: 816d4749384c7f398912c905a16c83b88f4c55632050b4c6117c61301d1a53e1
2024-06-05 20:50:39 +00:00
drh
0de7da1998 Small performance optimization in the codeEqualityTerm() routine of the
code generator.

FossilOrigin-Name: 8080c6eafd1280ea870a6ab1ba715ac5af67387e69771be6cbd46dda77c3eaa8
2024-06-05 20:41:36 +00:00
dan
6d98c55b56 Fix an fts5 problem with secure-delete mode causing integrity-check to erroneously report a corrupt index.
FossilOrigin-Name: 80bef4d60ba9e3679ea66655ca36fcfaa888775a3d1598d50e9649ad84a95b63
2024-06-05 14:47:54 +00:00
dan
e3eefe00dd Fix a very obscure issue where the name resolver could get confused if aliases like "sqlite_schema" or "sqlite_master" were used in a query involving the sqlite_temp_schema table.
FossilOrigin-Name: a096eb7554952f8137c6e9330c328164719fb27e958787fbd503bcd1364e6ae4
2024-06-05 11:36:58 +00:00
mistachkin
ecaa021759 Fix harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 93ac8573eead9b785a24715239e71cd3ef730bf16332cf3b5e264a6491374cac
2024-06-04 19:21:16 +00:00
dan
7d24afa0de Better handle WHERE terms that are common to two or more OR branches when planning virtual table queries.
FossilOrigin-Name: 1976c3f7e1fe77cf3367710e8ada230a3672ed374e316425164e42b2622526c7
2024-06-04 17:26:15 +00:00
dan
077f9b14f1 Fix a couple of memory leaks in the shell tool code that could occur when processing errors.
FossilOrigin-Name: e84f09d469ee76a5b5e44baf6a69b90c69d4160fa4c32de04a96f868643acd96
2024-06-04 15:07:38 +00:00
dan
c5a0ed7b43 Allow shell command "testctrl pending_byte" to be used in unsafe-testing mode only.
FossilOrigin-Name: afa45c4f5afc9248ca4a1e775404a460280bb9a58a92eae508ae00fb2f675dc6
2024-06-04 14:32:31 +00:00
drh
8741ca0819 Address a corner-case associated with the call-function-once optimization
of check-in [663f5dd32d9db832] that was causing a (harmless) use of an
uninitialized bytecode register.
dbsqlfuzz 8a44f675401a8b1f68a43bf813c4f4f72ad8f0ea

FossilOrigin-Name: b37ac2d020873b78efa164036db4056406a67330679f850775da520cd8027cb9
2024-06-03 18:04:10 +00:00
drh
586b2b2a54 Omit an unused #define.
FossilOrigin-Name: 9c2de28a146e4cdfa4c05bf8dbd4ebb1156c71104001edf68e6dd5db21deb91f
2024-06-03 12:36:43 +00:00
stephan
e1b55a5af9 Modify three #if checks in os_unix.c to improve handling of SQLITE_OMIT_WAL on WASI builds. Based on the discussion in/around [forum:57e918431735128a|forum post 57e918431735128a].
FossilOrigin-Name: 296eeb26c816bc734530cf446922f25be970b901c884df1a98083502f0d1e9f5
2024-06-03 07:22:28 +00:00
drh
0507e6e388 Be more aggressive about freeing memory associated with the
sqlite3_index_info.idxStr field.

FossilOrigin-Name: 85dcd0a8479a658203833cfd75f22813faa26d4793ebfbb8843035d683bee105
2024-06-02 10:52:35 +00:00
dan
9c3eef8c0d Have fts5.xBestIndex return SQLITE_CONSTRAINT, instead of a large cost, when no usable plan can be found.
FossilOrigin-Name: 7c470945372dc98610f7c9840ce8cab18c19b655352f0187e4f31040cea77363
2024-06-01 17:56:58 +00:00
dan
af35432400 Further tests for OR constraints on virtual tables.
FossilOrigin-Name: ff4a30056f8dbcbd045afdbee485f6671c3580b95187144aa9a77c97dfda2647
2024-05-31 20:32:10 +00:00
dan
cadfdd4e09 Better handle WHERE terms that are common to two or more OR branches when planning virtual table queries.
FossilOrigin-Name: 4edd9b29f58621335b8a562280c991c34804bbba090f90c951261d043cff1965
2024-05-31 19:26:22 +00:00
drh
5ef9c89977 Do not even try star-schema detection if the join has fewer than 5 tables,
since 5 is the minimum for a positive detection.

FossilOrigin-Name: a07ec16bbc056fbc23a7bd58e5e32ef691c13e9babeb542918cf9a01cac40c20
2024-05-31 15:39:00 +00:00
drh
d72ca8f810 Document the OP_Explain opcode. Add the WhereLoop.rRun value as P3 in
OP_Explain opcodes associated with WhereLoops, for testing purposes.

FossilOrigin-Name: 996c46e61d9a53a54018672dd407b8ba8c480dd6795393428f9d5fcb81b47ab5
2024-05-31 14:39:42 +00:00
stephan
2f755cdc3a Back out [dcc2bb2c562e97e090174], as it breaks the --with-wasi-sdk builds.
FossilOrigin-Name: 62199562c26f77d059aa0bbda42a421a7aece828aa94d14a40c701a6384d1cf6
2024-05-30 21:54:16 +00:00
stephan
4c86b2db0f Remove the unconditional SQLITE_OMIT_WAL when building in wasi-sdk mode, per [forum:80003e91a7a6cb4d|requests in the forum].
FossilOrigin-Name: dcc2bb2c562e97e090174d4d0970bfa1551e5eb4db022e6d232c4dd786818e45
2024-05-30 17:56:26 +00:00
drh
1344b540d9 Ensure that the second pass call to wherePathSolver() always reports a positive
value for the estimated number of output rows.  This fixes a long-standing
(though exceedingly minor) problem that was only revealed by a new assert()
added yesterday.  dbsqlfuzz 545d6debc2da496ab2b915e33ea34d9a35a935df

FossilOrigin-Name: a47c644fef71f3ab3dc584ea917eaab9a8e5b4c9dcb57bdd29747ba32108e85f
2024-05-30 13:27:29 +00:00
stephan
5b7048d5af Update shell.c to use the msteve fork of linenoise, per /chat discussion.
FossilOrigin-Name: ee92fa8366b743266b17c692499087c0d11b9302d096c3dfb4e6356b467e939e
2024-05-30 11:14:16 +00:00
drh
7da33383c7 Remove an unused parameter from fts5ConfigParseSpecial(). Compiler-warning
fix only - no functional changes.

FossilOrigin-Name: c08dd245f7706f2fd2269d700be480477619a722e27e6b439462ae543302c49f
2024-05-29 15:16:17 +00:00
drh
c327bd0354 Use a heuristic of artifically lowering the cost of fact tables in a
star-schema query in order to prevent plans where the fact tables are
in outer loops from being trimmed by the path limiter.  This helps to
generate better (faster) query plans in those particular cases.

FossilOrigin-Name: 38db9b5c83dfb3021333365b2f6b11e3b54afd7033e9f4dadf0c0df1d4b082d8
2024-05-29 15:08:20 +00:00
drh
1085eee098 Change an assert() (incorrectly) added by the previous check-in into a
testcase().

FossilOrigin-Name: 5e64b541d175c10a5df67ef3419ecd74fcb51392af5f5458973cea85ee6a3246
2024-05-29 14:32:22 +00:00
drh
eccb42eb0e Small performance enhancement in wherePathSolver()
FossilOrigin-Name: bdab69641df4704f7b080cf7841bbf39da9160222f7b664a79ed662b70ca7b0a
2024-05-29 14:04:52 +00:00
drh
bb24c75b41 Improvements to comments and debugging output.
FossilOrigin-Name: 85164ee155e42809fe34e6c6b6fbe0a2baa9d616326a811173a0b0c8a885fcce
2024-05-29 13:29:39 +00:00
drh
54bfc9435f Remember the amount of the heuristic cost adjustment associated with
star schemas and compensate when computing whether or not to use Bloom
filters.

FossilOrigin-Name: 21daf2463ef70e6b5dc73ba5bf62b3d2fb504e9189f645ac74b513d3d8b979c2
2024-05-29 10:40:53 +00:00
drh
d79ce8a459 Fix typos in the star-schema test cases.
FossilOrigin-Name: 4080937353985eb391f70a3a7fae890823cf01d19c52939e343fb2504f3f8659
2024-05-29 09:53:19 +00:00
larrybr
7c6256234c [forum:/forumpost/c9b8d923d5|Fix sqldiff out-of-bounds char classification error mentioned in the forum.]
FossilOrigin-Name: b31933d87301bd93763f0923e0ce06a183700875e6107c9f185faffbd99797d9
2024-05-29 03:35:40 +00:00
drh
c34ff12c59 Use a heuristic in the query planner to help it better cope with large
star schema queries.

FossilOrigin-Name: a98be0f548f277fab8f38a2dec6ddcbe7a7fff27856ba19e76ad8c5641894b7b
2024-05-29 00:38:12 +00:00
drh
d60a503b4c Fix a couple of assert() statements so that they cannot fire
when the SQLITE_TESTCTRL_INTERNAL_FUNCTIONS debugging capability
is activated.  dbsqlfuzz f5b347cf167a62fbe08062b2feee65cb9306e363.

FossilOrigin-Name: 273504b74cb9c3cfa2497a1339e706a1f2d2c3ce81b23a16beb47da9292535e0
2024-05-28 19:08:18 +00:00
drh
05665e9de9 Tweaks to the query planner so that it is better able to deal with star
queries with many dimensions and bad indexes.

FossilOrigin-Name: 1e49081001f93b75ee499536f8a61a0f49225a1745117bb9267249c38c4bf803
2024-05-28 18:53:36 +00:00
drh
efe474af97 Increase the number of parallel paths in the query solver from 12 to 20.
In the .wheretrace output, sort the parallel paths in order of increasing
cost.

FossilOrigin-Name: 8ba2c2f5cb31f7bcc426bec78457316ef11d0b5debf24e8da8c6fc2f95878b1e
2024-05-28 12:41:11 +00:00
drh
6fa46d0e06 Documentation typo fix. [forum:/forumpost/772d6688f5|Forum post 772d6688f5].
FossilOrigin-Name: 1f2f9c709eaee3c45664afa062f0fb2b912de446581066c87ea144b8ba55b55c
2024-05-28 11:24:18 +00:00
dan
2386943f19 Fix a problem with the error message reported by fts5 in some OOM cases.
FossilOrigin-Name: c7aaa28f786567e29ebee3848283b5c740dd3b8144dc14372e56260ae1b76922
2024-05-28 10:57:24 +00:00
drh
18970dac18 Improve the automatic-index decision such that no attempt is made to create
an automatic index on a column that is known to be non-selective because if
its use in other indexes that have been analyzed.  See
[src:/tktview/8ff324e120|ticket 8ff324e120] and
[forum:/forumpost/b21c2101a559be0a|forum post b21c2101a559be0a].

FossilOrigin-Name: 2a7603c327d11d5e6bc4d40c29151fea544d650f51200ff76efb921adb0c38df
2024-05-28 00:16:52 +00:00
drh
38af125238 Query planner tuning: Increase the maximum number of simultaneous solutions
to track int eh solver from 10 to 12.

FossilOrigin-Name: fe2e1dadbacbe6392ceed44fd287a2ed82189cb8055f35631d37967d9a7a5d1d
2024-05-28 00:01:07 +00:00
drh
b23f92b286 Avoid creating an automatic index on a column that is known to be not very
selective.

FossilOrigin-Name: 70409763f70faa2a0f4f072fd318a687b109a0905cc57906ad7f80d2885fe6d9
2024-05-27 21:55:01 +00:00
drh
eeb8506c18 The previous check-in was a little two aggressive about skipping the
initialization of entries in the CellArray.ixNx array.  Fixed here.

FossilOrigin-Name: 1b6d1fbcdecf14bc79dc7b5df50e585d2fcc1484a9987b863c190e8f7ba2c39f
2024-05-27 19:52:24 +00:00
drh
d081df0a5d Fix typo in comment used to generate parts of the documentation.
[forum:/forumpost/da5a2ca4db|Forum post da5a2ca4db].

FossilOrigin-Name: 428aadf0c71473ccb0681b2b7146281c62949ee99556873e49895d44eec7aee5
2024-05-27 18:15:08 +00:00
drh
09d8e696dc Very small performance increase and size reduction by removing unnecessary
ALWAYS() macros from the btree balance logic and replacing them with
special initialization of CellArray and some assert()s.

FossilOrigin-Name: 32b79041d9b6858e4ffade5841898619c7d25d20c4638bf85447a2ca9cc4a3d3
2024-05-27 15:13:49 +00:00
stephan
20c118faec Doc typo fix. No code changes.
FossilOrigin-Name: eaf07fe69f383938dd394f58cedad3f16f146d9b48e66bc1ba17446cf75ffb3f
2024-05-27 13:41:46 +00:00
drh
fefe24ddf8 For compatibility with PostgreSQL, when right-hand side of the ->> operator
is negative, it should index from the right side of the JSON array on the
left-hand side.

FossilOrigin-Name: 82365a45b96536c1146a384e5d3efce80a6ec469a54713c7f40bf15eb834b5fd
2024-05-27 13:24:39 +00:00
dan
09f87094bd Fix a possible buffer overwrite in the ".import" command. [forum:/forumpost/0c447f0548|forum post 0c447f0548].
FossilOrigin-Name: 0fd958fa9b56a8ef254127e29800ca2a267590e86edf739bd339239b25a5da6e
2024-05-27 11:35:05 +00:00
drh
ee8f926027 Add new assert() statements to help out a static analyzer. Response to
[forum:/forumpost/17fe8ac32e0de4f5|forum post 17fe8ac32e0de4f5].

FossilOrigin-Name: 857f6d530949221d154b5120ecc2aa906418bec6f69d1c13197a432ba3cad8eb
2024-05-27 11:31:02 +00:00
drh
4ed784d1e8 Ensure that sqlite3ViewGetColumnNames() returns non-zero on any error.
dbsqlfuzz d9de2a508f693e5a228d7a01d5341e3c64326fbb.

FossilOrigin-Name: 57aeb3a287fc190bf8d438a7b03d6715c05fd3fd71559c6a14d7bd910d37b38d
2024-05-25 23:13:15 +00:00
drh
a7f3b0f85b Ensure that queries like "SELECT func(a) FROM tab GROUP BY 1" only call the
func() function once per row.  Fix for the issue described in
[forum:/forumpost/bf8f43aa522c2299|forum thread bf8f43aa522c2299].

FossilOrigin-Name: 663f5dd32d9db83249fcf85602a756464ece74e1899dc881ac9519d872638441
2024-05-24 23:44:48 +00:00
dan
c598fdd10c Fix another fts5 problem related to unknown tokenizer modules.
FossilOrigin-Name: e78b7783040ef1ad34d4287af8a7a5998d360d50076e0de42a116d9a96fe74b4
2024-05-24 21:38:37 +00:00
dan
0e7a7e57cc Fix a crash in fts5 that could occur within "PRAGMA integrity_check" if the specified tokenizer was unknown.
FossilOrigin-Name: 061d7b69e6a43474cd7123a69f4ee65b5649a0b5e51474343defef5ae5262657
2024-05-24 21:23:36 +00:00
drh
4aaf45e246 When omitting result columns for the vector-IN optimization, make sure that
any result-set column references in both the ORDER BY clause and the
GROUP BY clause are updated appropriately.

FossilOrigin-Name: f890812df0a57fcd201647640d8b9ee26047cd93cd7171bc6fd050f574649345
2024-05-24 20:18:16 +00:00
dan
89b04f3786 Ensure that queries like "SELECT indeterministic(a) FROM tbl GROUP BY 1" invoke the indeterministic function only once for each row of tbl.
FossilOrigin-Name: 4555d66547e28cb110e1012b145bcf3aafb5d4bde05e9d27bcb4ca33837b28f5
2024-05-24 18:31:39 +00:00
drh
31079226f7 Add the stmtrand() extension function for use in testing.
FossilOrigin-Name: 5c97a5b9d163b1c427e002f3734687ca0384bc0da6a90fc4bfd358c654d3a7b3
2024-05-24 14:16:06 +00:00
dan
7c492a250b Fix an "ifcapable" expression in values.test.
FossilOrigin-Name: b8442d2a6012b1f2e15381613267db0982e36bb4c748b15b56e668e0d0a3d0d2
2024-05-24 13:33:39 +00:00
drh
e6d3c57204 Fix the window-function group_concat() so that it returns an empty string
if it has one or more empty string inputs.  This fixes
a bug introduced by [c6da39115d3e2b0f] on 2019-03-26 (version 3.28.0) and
reported by [forum/forumpost/bf8f43aa522c2299|forum post bf8f43aa522c2299].

FossilOrigin-Name: cec6bb3fc9932ea78ec8e63d9c2d4e56a4d94b8973b9ea46033cc4baa87c0476
2024-05-23 23:26:04 +00:00
drh
294cd87afc Merge various enhancements that were being held on a branch until after the
3.46.0 release.  (1) Allow arbitrary expressions in the second argument to
the RAISE() function. (2) Performance optimization to the OP_OpenRead and
OP_OpenWrite bytecode operators. (3) Allow FTS5 tables to be dropped even if
the associated tokenizer is not available.  (4) Performance optimizations in
FTS5.  (5) Generate better bytecode to improve performance of ONEROW scans.

FossilOrigin-Name: 1e5385ffc30743412ade1536583504eec36790cac5355042aa1e12d8d2271d1f
2024-05-23 15:05:57 +00:00
drh
18ec0d4a34 Increase the version number to 3.47.0 to begin the next development cycle.
FossilOrigin-Name: 20e228a22e4c5a8d62fae003ac176de62126d8e121871c5ca14a5480c4d4b6a2
2024-05-23 14:58:31 +00:00
drh
bebe2d8be8 Version 3.46.0
FossilOrigin-Name: 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e
2024-05-23 13:25:27 +00:00
dan
3731703dbb Ensure an sqlite_dbdata cursor is properly reset before being used again, even if it has already encountered database corruption.
FossilOrigin-Name: 3210e1ca4d0efedf9710c97abd050ba10d3af98cb1f029c26daa84daf42fbc7e
2024-05-21 17:37:50 +00:00
dan
2526668556 Do not attempt to run mmapcorrupt.test with builds that do not support mmap().
FossilOrigin-Name: 54a49f1847f95c377f0f611eb10f635b879bba8c2eb25e65e2f66a56f4f9a505
2024-05-21 14:54:46 +00:00
drh
33087dbf30 Fix harmless compiler warnings.
FossilOrigin-Name: aab59f9f7c1c4cfac4d29d7c7a381583295312baf3b9a75e30a617b1541e12e1
2024-05-21 13:34:26 +00:00
drh
b8337932b3 Fix the -> and ->> operators so that when the RHS is a string that looks like
a number, it is still treated as a string, because that is what PG does.
[forum:/forumpost/9e52cdfe15c3926e|Forum post 9e52cdfe15c3926e].

FossilOrigin-Name: de8182cf1773ac0d04268d896a613841cf6bf61f9f030342170657d5e06f2acb
2024-05-21 11:11:29 +00:00
drh
00208479fd Omit a capi3 test from 2007 that depends upon undefined behavior (UAF).
FossilOrigin-Name: a60a0b75137c015e97b8dcd0070444fcb608f502ce88b2ee744dd6230dbdc120
2024-05-20 19:59:32 +00:00
dan
f765aec406 Do not run the tests in recovercorrupt4.test with the inmemory_journal permutation.
FossilOrigin-Name: c13205d66b8406cccfc937c88ac515fa758fe2ade8b3d30f0c1e79fe974e9600
2024-05-20 19:51:06 +00:00
drh
e212493358 Improvements to the documentation of sqlite3_vtab_distinct(). Do not allow
sqlite3_vtab_distinct() to return 2 or 3 if the rowid column of the virtual
table is used, as doing so might lead to an incorrect answer.

FossilOrigin-Name: 08058d66d1bde4fcf8324482ee4c6c030c681383470d5076b6f75b74aac2ae29
2024-05-20 17:52:35 +00:00
drh
df903fe056 Improvements to the sqlite3_vtab_distinct() documentation.
FossilOrigin-Name: 6ee041d34f292b94701919f51bbb9e12bcb9e0c4f45e4c0b83f30ff328070637
2024-05-20 16:00:27 +00:00
drh
0462499051 Fix the definition of sqlite3_vtab_distinct() such that return codes 2 and
3 mean that all rows must be distinct over "colUsed" which is a superset of
"aOrderBy".  Also, disallow return codes 2 and 3 if the rowid of the virtual
table is accessed.

FossilOrigin-Name: 922731ce98c0ce7837784ff7966049e59fa73da2aa04abf3506503b6fc4aa048
2024-05-18 20:00:08 +00:00
stephan
79dac84b31 JS error message and doc typos reported in the forum. No code changes.
FossilOrigin-Name: 1a073f9acfb691eebf4a8cc78a72ff47ebbb6aba4acede6755fa3faefae48f2b
2024-05-18 15:21:45 +00:00
drh
b834f629cc Improvements to a VDBE comment. No changes to anything that affects queries.
FossilOrigin-Name: c2188da860a1debd7c5d28b223deeef15035c33c2c5aefae9d9b620b6a2b4677
2024-05-17 22:51:03 +00:00
dan
c83386cbe5 Merge branches "fix-onerow-opt", "faster-openread", "fts5-delay-tokenizer" and "enhanced-raise", each containing minor enhancements prepared for 3.47, into this branch.
FossilOrigin-Name: 6dc6472175bccbed15ebf6811c209d1a0b5fad60158fb32040210f2cdae916a6
2024-05-17 14:26:32 +00:00
dan
0445cd1020 Fix a problem in where.c preventing SQLite from identifying some ONEROW scans, leading to (slightly) sub-optimal byte-code.
FossilOrigin-Name: b41e71208abcdf988f57c3fd7e6a372bbaf442c32a8e2c051beb8d45c8001e0f
2024-05-17 13:56:38 +00:00
dan
fa0763eb34 Add extra tests for the error messages generated by sqlite3_declare_vtab() when passed something other than a well-formed CREATE TABLE statement.
FossilOrigin-Name: 5fa0c2a026f0467af3a76ea80cee8168b7a49553c350f642d1dff02ff9e7aeed
2024-05-16 16:22:51 +00:00
drh
c72953a4bc The sqlite3_declare_vtab() interface should return SQLITE_ERROR, not
SQLITE_MISUSE when a nonsense SQL input is provided, for legacy compatibility.
[forum:/forumpost/4b875d7b2a|Forum post 4b875d7b2a].

FossilOrigin-Name: 1ec2961a0341619ae88832942b52606b3246fc0de07ca6da0300e4bfc656ecf0
2024-05-16 15:57:42 +00:00
drh
c4439fb134 Fix a case where an error in the ORDER BY clause of an aggregate function that is part of a trigger body might cause an assert() to fail in an ALTER TABLE command. dbsqlfuzz 899d9255555a07f1fe11a0bb51a2fe197b3150cd
FossilOrigin-Name: 953271f29e7bd6ba9b85f73250b1c22b08eef317f9ac3c7c3d92cbaa57d7efd5
2024-05-16 00:20:43 +00:00
drh
61f2ee6ab8 Back out the assert() fixes from [a9443dbfbe25e588] and
[3afaeac56dff58db] (but keep the corresponding test cases) because they
are both made obsolete by the previous fix on this branch.

FossilOrigin-Name: 3120c7c8a3565b8a3ca321129c09db96839c2f9af1777fc7a1668fef81973603
2024-05-15 23:36:24 +00:00
dan
1550771a6a Fix a case where an error in the ORDER BY clause of an aggregate function that is part of a trigger body might cause an assert() to fail in an ALTER TABLE command.
FossilOrigin-Name: b79a8be37b44c1eff7d00f7af7cd9d0e13614ce5961bb88ddb9ec63f6a846c78
2024-05-15 21:38:04 +00:00