Commit Graph

28005 Commits

Author SHA1 Message Date
stephan
55051d661c Flag sqlite3_trace() and sqlite3_profile() as deprecated so that the doc generator for funclist.html sees them as such, and add 'Deprecated' to their page's title for consistency with other deprecated APIs. Comment changes only. Addresses [forum:0901025836|forum post 0901025836].
FossilOrigin-Name: 87c54f93f5711739741ed0ff3c1a6fe24ffc8a025b43523bf78c1f6be8c1b4cd
2024-03-25 10:28:10 +00:00
drh
d2b3b72a2b Improvements to the vtablog.c extension, for better logging of virtual
table interactions.

FossilOrigin-Name: e253bb36a5f4f601c9b08858b55a9ce198239ace8efa8dab7c0ec019028967c1
2024-03-25 00:38:55 +00:00
drh
cf84ae0189 Fix the xBestIndex method of the pragma virtual table so that it correctly
gives a higher cost to plans where the schema hidden parameter is
unconstrained.  Fix for the problem reported by
[forum:/forumpost/85b6a8b6705fb77a|forum post 85b6a8b6705fb77a].

FossilOrigin-Name: bc516ff5202ee6e9834266bf755fe26e30ac557dcc7975ca7a06dfe33874fcd2
2024-03-24 21:10:45 +00:00
drh
4a402b80c5 Improved "wheretrace" debugging output for calls to xBestIndex. No changes
to release code.

FossilOrigin-Name: 33966bb06ce9a8e90734de59a8d43c523f60870d20be64789638da4c84a8b81b
2024-03-24 20:26:59 +00:00
drh
a631eb378d Do not automatically assume that ROWID is NOT NULL when compiled with
SQLITE_ALLOW_ROWID_IN_VIEW.
dbsqlfuzz 31b38eeb63a4e1562de665078f52b7b47a7543cf

FossilOrigin-Name: 80c4223098c1827ff3a564f1f9a4203164a943e9a83eef99df68378fa3c4764b
2024-03-24 16:33:31 +00:00
drh
d9eee787bd Fix an adverse interaction between CREATE TABLE AS and the new
[/info/a120c9235f125e05|VALUES-as-coroutine] optimization.
dbsqlfuzz c2c5e7e08b7e489d270a26d895077a03f678c33b

FossilOrigin-Name: 84b6fdea0bf07c73df0ca8ef110db066164a5f34606e6c069a060476e04ef44e
2024-03-23 15:17:38 +00:00
drh
378bf82e2b Fix incorrect boundary assert()s on the new OP_IfSizeBetween opcode.
FossilOrigin-Name: 8eda4797c573382cbb989a4ab4b1f19d8fd538dbc9818d86a9aa6189cfa90f37
2024-03-22 10:32:14 +00:00
drh
2faaf3830e Test case for the assert() problem fixed by [9ba3cff9d48fe8fc].
FossilOrigin-Name: 865f0de7a17ce6059b8f0708002cff5f13b9dba3ebc41896ee0fdc21ae4f3740
2024-03-21 22:18:24 +00:00
stephan
006a9b51aa Add comments (only, no code) to the JS sqlite3_config() bindings reminding us why SQLITE_CONFIG_ROWID_IN_VIEW is specifically not included. JNI does not need this treatment because it explicitly supports only a very small subset of config options.
FossilOrigin-Name: 4fea396221e84f9532f9327226691621a23bd966a860329fc579141c69cf7f64
2024-03-21 15:52:52 +00:00
drh
529ed1a3a3 Enhancements to testrunner.tcl:
(1) Add the "--config CONFIGS" option, to that only configuration named
on the comma-separated list CONFIGS are run.
(2) Add the "--omit CONFIGS" to omit configuration on the CONFIGS list
(3) Add the Android configuration to "release"

FossilOrigin-Name: 4ccb372967fab779b29be8f01c879a99ef247981466f81f55e18e3961fbd7d5a
2024-03-21 11:46:52 +00:00
dan
af64a22762 Have os_unix.c reuse cached file-descriptors in the case when a read-write fd is requested on a read-only file and a read-only fd returned.
FossilOrigin-Name: a678e85402af08c1e387bf30ff2205f84dd7da749755da565d70f831c007a3d9
2024-03-21 11:37:36 +00:00
drh
296ae1e467 Fix all test cases so that they work with SQLITE_ALLOW_ROWID_IN_VIEW.
FossilOrigin-Name: 66c69e2f20f7692e0f34743ae97b09c4d8d11b874cdc5381795f2d1e0410f724
2024-03-21 10:35:33 +00:00
dan
219b4f2061 Change EXPLAIN QUERY PLAN output to say "USE TEMP B-TREE FOR LAST TERM OF ORDER BY", or "LAST N TERMS OF ORDER BY", instead of "RIGHT PART OF ORDER BY".
FossilOrigin-Name: 7e13a2c7583dbcb660adde6b0465da037365971c56726b8f18a541d8803ffeed
2024-03-20 16:56:12 +00:00
dan
e555bd4f02 Change EXPLAIN QUERY PLAN output to say "USE TEMP B-TREE FOR LAST TERM OF ORDER BY", or "LAST N TERMS OF ORDER BY", instead of "RIGHT PART OF ORDER BY".
FossilOrigin-Name: cd547c500442f3f58c05d6da8a67c3238560c5204ea62ec14afa844cc8fb94f0
2024-03-20 16:27:08 +00:00
drh
daee74c3ac Fix the SQLITE_ALLOW_ROWID_IN_VIEW bug-compatibility option so that it works
again.  Add the SQLITE_CONFIG_ROWID_IN_VIEW sqlite3_config() value
to optionally disable the bug-compatibility mode at start-time.  Enable
testing of SQLITE_ALLOW_ROWID_IN_VIEW.

FossilOrigin-Name: b6802565df0f63286a7ef26c92d3ed817895f244920a24909cd855090fdfa08c
2024-03-20 10:45:13 +00:00
drh
7128c789bd Fix a typo in a comment.
FossilOrigin-Name: 54680d0fbec1f0575ac4be6dca866971795dab2c42b02a492d5cd485f46d153f
2024-03-20 10:40:25 +00:00
drh
697e122a11 Fix typos in the SQLITE_CONFIG_ROWID_IN_VIEW documentation.
FossilOrigin-Name: 1ad1ca498296493c8e89cda911cc153baa51c90ae6c19961841e6b4e37302a23
2024-03-20 09:45:44 +00:00
drh
254729edb7 Change the SQLITE_CONFIG_NO_ROWID_IN_VIEW configuration option to be
just SQLITE_CONFIG_ROWID_IN_VIEW (without the "_NO_" in the middle) and give
it the ability to turn the option on and off.  Otherwise, it is difficult
to test.

FossilOrigin-Name: 5d412edc2e378999ad798d1d7d73c7f7a17ee4e3c751a0dd00b9d5ce32759550
2024-03-19 23:01:56 +00:00
drh
36f01f2ee3 Return the error "ambiguous column name: rowid", instead of "no such column: rowid", when a "rowid" reference is ambiguous.
FossilOrigin-Name: 0615bdae2dfc70c7e0416a28e89ffde31fa44ed4b3dac46e5ef20eed0d89e58c
2024-03-19 19:56:39 +00:00
drh
4aa21492d1 Add the --no-rowid-in-view option to the --help output of the CLI.
FossilOrigin-Name: 134da9c348a5e3b5cef97b79f37d48257afd4fa958a84f6930ac9874284a14cd
2024-03-19 19:48:50 +00:00
drh
27ea83f66e Make sure the new u1.nRow value is copied when making a copy of a SrcItem
object.  This fixes a problem in [ac6f095e13e43d66] from yesterady.

FossilOrigin-Name: 262f8f9d80d37160e4126634b99aa48fce2073e61f6365e8bdbe1cc4fa560a96
2024-03-19 19:42:56 +00:00
dan
ffbe492553 Update test scripts to account for [8fcea4cd].
FossilOrigin-Name: 0c543c51a8c5c8916f649a5e7fd3fedc9c05f2df36064b1699ea6f5e08eaa9e0
2024-03-19 16:51:18 +00:00
drh
e9feb0acfc In the name resolver when SQLITE_ALLOW_ROWID_IN_INDEX is enabled, if there
are multiple views that might resolve to the "rowid" but only one real table,
then use that one real table and ignore the views.

FossilOrigin-Name: 8fcea4cdfc89dd78eca5e7f62aa31aff0e296f41e79349d3af1cc3a2bc4d77c6
2024-03-19 16:34:32 +00:00
dan
f891ef8d61 Update tests to work with SQLITE_ALLOW_ROWID_IN_VIEW.
FossilOrigin-Name: 495b8c7b08b998ddfe2ad055703f058c768e7e94014952e5cd8a81c7c1515cb1
2024-03-19 15:27:15 +00:00
dan
a10c2a9055 Return the error "ambiguous column name: rowid", instead of "no such column: rowid", when a "rowid" reference is ambiguous.
FossilOrigin-Name: 021f34fcfed41b607be8169bbda59aef93f130108d944f4741b46e8e345b2bbb
2024-03-19 14:55:49 +00:00
drh
967c303212 Fix the fuzzinvariants.c test module so that it does not generate
invariants that depend on rowid when SQLITE_ALLOW_ROWID_IN_VIEW is used,
since rowid values can be unreliable in that context.

FossilOrigin-Name: 0d711aaaa14472a82f8893e1b07d845073f3d018bd5b8093ec0b00ffbbc8cd5a
2024-03-19 14:38:39 +00:00
drh
d75bdf51c7 Improvements to the first check-in on this branch, causing less collateral
damage.

FossilOrigin-Name: 7bc882897b6910f93695ad372445df7791b096412089ccbcd4fde365c62fa074
2024-03-19 14:21:26 +00:00
drh
261c6dfe7b On second thought, change SQLITE_TESTCTRL_ROWID_IN_VIEW into a start-time
option SQLITE_CONFIG_NO_ROWID_IN_VIEW.

FossilOrigin-Name: b8e045c9e1d098d116f8745704b10ed76569d4b063c0b81cce16bc136930755d
2024-03-19 13:55:10 +00:00
drh
4b42b5259f When compiled with SQLITE_ALLOW_ROWID_IN_VIEW, rowid-in-view is on by default
but can now be turned off using SQLITE_TESTCTRL_ROWID_IN_VIEW.  Without the
compile-time option, rowid-in-view is always off.

FossilOrigin-Name: 8a6196ab29052071be753c5c77ac945c2d62ecc8019c6160f954eafe34ab05a8
2024-03-19 13:31:54 +00:00
drh
1fe31dcfab Adjustments to the test cases for the previous check-in to make them
cross-platform Linux/Mac/Windows.  Test chance only.  No change to core code.

FossilOrigin-Name: 0dddadbd5b217a48bb5c1b0568a03fbafb89dba98c577727bf4f79ff7e0ca849
2024-03-19 10:41:18 +00:00
drh
5ed044e893 Fix another problem from [c63e26e705f5e967] involving infinities and the
Kahan-Babushka-Neumaier summation algorithm.  Problem reported by
[forum:/forumpost/23b8688ef4|forum post 23b8688ef4].

FossilOrigin-Name: 45d272ef38d5ee6189f81369aefb8e3ac35868a67687012d93c84f2bbc42520a
2024-03-19 10:16:17 +00:00
drh
108dd6a52d First steps toward getting -DSQLITE_ALLOW_ROWID_IN_VIEW to work again. That
compile-time option is untested, undocumented, and unsupported.  But it was
mentioned in the release notes for version 3.36.0, so I think that means we
need to support it forever.

FossilOrigin-Name: 7c46ff640247584f1ea260c062de29a0e49f649d1894a526574c1a479006a1fc
2024-03-19 02:30:24 +00:00
dan
28cd72ac52 Fix asan problems in sqlite3rbu.c. Enable RBU for sanitizer release tests.
FossilOrigin-Name: ad2ae7717e7a10cf42aeabd3c544e7884fa082295c2babf0fdb19a684d2aba1e
2024-03-18 21:08:33 +00:00
dan
365b6e9769 Avoid spurious SQLITE_IOERR_DATA errors when reading partial pages from a cksumvfs database using a SQLITE_DIRECT_OVERFLOW_READ build.
FossilOrigin-Name: 0f485dbece9146eabe5a5c0998a9e35c685a170c3fe6d4509e92aa8dae18a2c0
2024-03-18 20:52:45 +00:00
drh
fc2d862318 Remove unnecessary blank lines from build commands in the default Makefile.in.
FossilOrigin-Name: 76fb3a908f45230b956cb659c754e47603e80aa72a2aad50d479437a9c013f61
2024-03-18 18:03:17 +00:00
drh
43a511927d Add the "VALUES-as-coroutine" optimization. Large VALUES clauses on an
INSERT, for example, prepare and run in about half the time and with half
the memory.  This check-in also includes enhancements to the internal
sqlite3ExprIsConstant() routine to recognize pure SQL functions as constant
if they have constant arguments.

FossilOrigin-Name: a120c9235f125e05be494038c16a9dd326fd79837698bef17e7879cd0cd75831
2024-03-18 18:00:17 +00:00
drh
2ad2584581 Fix harmless compiler (scan-build) warnings.
FossilOrigin-Name: c86f9f2a15ffc726b7f0d9bba5a8c4dfdaeea6a297e0b591c554fff3d1fe6e1c
2024-03-18 17:13:52 +00:00
drh
c195e2374b Allow the VALUES-as-coroutine optimization to be applied to later rows of
a VALUES clause even if earlier rows do not qualify.

FossilOrigin-Name: 9a47ea7f0f675f7bf4710901487ce34c7689e618cd1d8b9f94f0ff7ebc3f2841
2024-03-18 16:30:00 +00:00
drh
b03805b70b Change a test case to use a window function rather than random() to disable
the VALUES clause optimization.

FossilOrigin-Name: c589149a138fa0a6be3153986fc0f315e052e13ebc0e7006b6529ca02bae413b
2024-03-18 15:10:00 +00:00
drh
ac7c6f5854 Add assert() statements to validate access to the SrcItem.u1.nRow union member.
FossilOrigin-Name: 21f616d9b948efca441f8d45d0a95f4c052ce8b6daec7fa582ad9a00b82ca570
2024-03-18 13:31:24 +00:00
drh
871786b792 Fix the patch at [10ee6fcba08ab128] so that it works on reduced-size Expr
nodes.

FossilOrigin-Name: 260bd764c3f2d6d067adb9cd0045b7c24d5e00b02ab2735b1cba455a6143ff4c
2024-03-18 13:10:54 +00:00
drh
27a5ee855d Improvements to EXPLAIN QUERY PLAN output for multi-row VALUES claues.
FossilOrigin-Name: ac6f095e13e43d66c06552c8b01f6bec3407c9d41a34c4cdb0be57b0b828ad0d
2024-03-18 12:49:30 +00:00
dan
75924d3ae2 Ensure the database schema has been loaded and the database encoding gleaned before beginning to code a multi-row VALUES clause.
FossilOrigin-Name: 2ff476eb3d1f4a2146f4a48b57895a00a3ff5beb29afa679ae53ea58cac07c76
2024-03-18 11:12:22 +00:00
dan
2f4a8cc2d8 Fix a problem caused by a non-aggregate function with an OVER clause in a multi-row VALUES clause.
FossilOrigin-Name: 10ee6fcba08ab1281235197602148fe062560e1d5034a477b8e7b574dd3e2907
2024-03-18 10:54:48 +00:00
drh
54bf109e80 Omit the "noop(X)" test SQL function. Accomplish the same thing using
the idiom:  "coalesce(X,random())".

FossilOrigin-Name: 0eb2fbb8910e7a372c50db3ae44238d7b161f0e45858b74061b5228aec5fcc7e
2024-03-17 16:01:23 +00:00
drh
e4a1b4da4f Add an ALWAYS on an unreachable branch.
FossilOrigin-Name: 0dce6211690210e802545cbca9b3375e07075e117fad3f8c921879da7671d981
2024-03-17 00:13:12 +00:00
drh
1c5257dafc Recognize when an SQL function is constant and can occur inside an
optimized VALUES clause.

FossilOrigin-Name: c0e5ceb87d3cf28f22d381f863b8f91043804fd7901f23f3afb02fe698e6a12a
2024-03-16 21:12:51 +00:00
drh
ec00a4d111 A formerly impossible case has now become possible because of the new
ExprIsConstant enhancements.  So deal with that.

FossilOrigin-Name: 9ba3cff9d48fe8fc8a0a51291169599209d464465e44bdfd60058fd1e314a2b1
2024-03-16 21:04:32 +00:00
drh
7dc3e923c4 Further expand the scope of usage for the enhacement to expr-is-constant.
FossilOrigin-Name: d7eadcf7dd089f0f4aa963c58f0df32edd951368c9906375fd62b0a61cd393b8
2024-03-16 20:15:34 +00:00
drh
4713b2d73c Assert that the eCode is always non-zero upon entry into exprNodeIsConstant().
FossilOrigin-Name: f71b28f6713126745bca53e098dfe3444d4235d6a2b87ced5b333a7f0ee79be8
2024-03-16 19:48:51 +00:00