Commit Graph

24210 Commits

Author SHA1 Message Date
stephan
f8cd3d2b5c Initial version of an sqlfiddle-style application using a WASM build of the sqlite3 shell.
FossilOrigin-Name: af9c21c9e0caf05adac7a9fcde39a9164c89f1c78b767b6fdd74a1405a3d373f
2022-05-18 17:14:24 +00:00
drh
b8b2d9c5e1 Fix harmless compiler warnings in the new unixFullPathname implementation.
FossilOrigin-Name: f7e1ceb5b59a876cfd04a8aac0ee2b322c970555b9c361b4953d711ef6596e37
2022-05-17 15:11:57 +00:00
dan
5348fbe332 Avoid treating constant expressions like "? IN ()" or "? NOT IN ()" as integers if they appear in a GROUP BY or ORDER BY clause.
FossilOrigin-Name: d8b249e8cdf0babe1427d0587dbdc27a52ec06a5ef3a20dfb05a0ea4adb85858
2022-05-17 15:01:01 +00:00
drh
ff16267d7d Add the sqlite3_db_name() interface.
FossilOrigin-Name: 2ad152236c408cbb1f942b221de4bf3cbaa9c35313d7eb07a63f46b6040fc981
2022-05-17 14:59:05 +00:00
dan
c7d7ebd755 Add memory barriers to multi-threaded code in test4.c.
FossilOrigin-Name: 9260f4e0fdc8066b4772999bacb5f4130ef714d4ac1967029ceacff618bc48ff
2022-05-16 16:55:22 +00:00
dan
07576c3fe8 Fix a problem in test file swarmvtab3.test causing occasional failures.
FossilOrigin-Name: f935c155ef205802c16b4ebea4a3fb01bf5689662b7b4f2af56f0f9021d6d4b1
2022-05-16 16:10:04 +00:00
drh
96d5549778 Do not allow an index scan on an index-on-expression for a RIGHT JOIN because
the index might not be positioned on the correct row when running the
the right-join no-match loop.
dbsqlfuzz 39ee60004ff027a9e2846cf76e02cd5ac0953739

FossilOrigin-Name: 2277f9ba7087dd993ac0f4007c523aa9cf74dba187f53af03d8c164886726fee
2022-05-14 19:05:13 +00:00
drh
d83997ba7f Improved debugging comment generation for the OP_Column opcode.
FossilOrigin-Name: 3e073bfddfcd652dfae8656d8978a4de427d21847fdaccfce53b6b895ad33f01
2022-05-14 17:40:47 +00:00
drh
c93bf1d462 Improvements to the decision of when to check ON constraints for an inner
join that is an operand to a RIGHT JOIN.  Fix for issue identify by
[forum:/forumpost/c06b10ad7e|forum post c06b10ad7e].

FossilOrigin-Name: 9d17233c7d98bf25c1a518d067e778708b3db6d6302edd8d7e376ba0ba4f1c30
2022-05-14 15:59:42 +00:00
drh
086b800fcd Change an unreachable branch into an assert().
FossilOrigin-Name: 778e57a558dc3f819ca57623bcb85f58c8fbeb28bc12a1e2edbdd1244e9107c5
2022-05-13 23:01:28 +00:00
drh
556527a154 Transitive equality constriants do not work on a RIGHT JOIN, since the
right-hand side might be a non-matched row.

FossilOrigin-Name: 0f96810b840dd6f209562635b21f55a7ed6210c01336fcfeb3b79e08a615a28d
2022-05-13 20:11:32 +00:00
drh
f69dad8c53 Walk back the optimization from check-in [cc458317bd77046c] that tries to
reuse the same ephemeral cursor of a list subquery when that subquery is
reused, as it does not work in cases where the list subquery is used both
for lookups and for scans.

FossilOrigin-Name: 12ee29d632ae4b585ef6bc07d3289d00c121268945dffd5673b251d95874e3f8
2022-05-13 19:50:29 +00:00
drh
767bc8de8e Defer generating WHERE clause constraints for a RIGHT JOIN until after the
ON-clause processing for the RIGHT JOIN has done its own row elimination.
This fixes and incorrect output from some RIGHT JOINs that was identified
by [forum:/forumpost/41cc3851d864c5e6|forum post 41cc3851d864c5e6].

FossilOrigin-Name: 238d9c247cf69cc77fdb1af9d42ebe258610a533ac4204e2ddf8af17f24d18c4
2022-05-13 17:45:52 +00:00
drh
a6e8ee12e2 Redefine the acccess rules for the Expr.w union so that the Expr.w.iJoin
member is accessible on either EP_OuterON or EP_InnerON.

FossilOrigin-Name: 6f741d6cfb8831a3ac966257ac4519bcc8156293447bf50323c2d9b170125974
2022-05-13 16:38:40 +00:00
drh
f8d2745f99 Corrections to the header comment to the new joinE.test script. Add the
generator TCL as a comment at the bottom of the script.

FossilOrigin-Name: 2f4456f67f64f131fc852ad9a7420eb43b57b879a9bec7e4b295f1dc0d7bfa56
2022-05-13 15:36:47 +00:00
drh
d383557960 New test cases for outer joins. Case joinE-32 currently gets an incorrect
answer.  See [forum:/forumpost/41cc3851d8|forum post 41cc3851d8] for the bug
report.

FossilOrigin-Name: 02b24863e6dc617c9260f79292a96b7c861d088268e77fd17204570515eb792c
2022-05-13 15:31:30 +00:00
drh
67a99dbee8 Improved names for flags on the Expr object: EP_FromJoin becames
EP_OuterON and EP_InnerJoin becomes EP_InnerON.

FossilOrigin-Name: 1ffea07ff98b894729c698b681cc7433df3bbfccd8a0529a706908602a636937
2022-05-13 14:52:04 +00:00
drh
8b0e5c3c7e Fix a harmless compiler warning in the CLI.
FossilOrigin-Name: 7a2ac303d1436a423a635db63d195097c88160ff46855194f6e630f9d3b3fa82
2022-05-12 17:09:33 +00:00
drh
d631c6af80 Ensure that ON clauses are applied to the correct outer join.
FossilOrigin-Name: c7e3a13a3288c577209be99c630fbe924e19880e8af1aa8a83b517acaa8b43d7
2022-05-12 11:56:44 +00:00
drh
902e2602c2 Add IS NOT DISTINCT FROM and IS DISTINCT FROM binary operators which are
equivalent to IS and IS NOT, respectively, for compatability with PostgreSQL
and hence standard SQL.

FossilOrigin-Name: db27611e172102483eaede3981d473e3d5bf93d98bc68f480398b1573876349d
2022-05-12 11:45:20 +00:00
drh
d59a388b61 Fix the ".echo" command of the CLI so that it shows the results of input
lines immediately, before invoking sqlite3_prepare().

FossilOrigin-Name: cf7fdabdba3a7600ea730263ca80ba80154645dfa15c31c037b780d6cb70e530
2022-05-12 11:01:41 +00:00
larrybr
175fdcb912 Zap stray --help output from intermediate version.
FossilOrigin-Name: deb7372b18cc8fb9d305085498fd24b3c2c17bd920ae2d03fa885af02ad47008
2022-05-11 20:29:32 +00:00
larrybr
f4874818a4 Change .echo on effect so that SQL is echoed before prepare. This slightly alters echoed output when multiple SQL statements are submitted at once. Also sync with trunk.
FossilOrigin-Name: c1eff632c41809214edea2850a93852fff66da3ca0dc393e8fe55e0976d422fd
2022-05-11 19:59:31 +00:00
drh
6868bca6c5 The unix interface now resolves all symbolic links in filenames before
actually using those filenames.

FossilOrigin-Name: d55273e36e312336b8fc77dc771657d3b2c3437fbbd79f3be37701982560d634
2022-05-11 17:57:43 +00:00
drh
b302c065d8 Use osReadlink() in os_unix.c, not readlink() directly.
FossilOrigin-Name: c3da4c1611cebd9f9d695892a3ffddc47d5f0db1a1ea8bd2b4f83ef7673b68de
2022-05-11 17:45:50 +00:00
drh
e8346d0a88 For the unix VFS, rewrite the xFullPathname method so that it automatically
resolves all symbolic links, rendering a canonical pathname that contains
no symlinks.

FossilOrigin-Name: 40c9273d0e0e74e1df22e996a5d486e838f4320defd2121e2d95eeed8aea6235
2022-05-11 16:46:27 +00:00
larrybr
d647819034 Fix .import leak in CLI and add shell leak testing to debug builds and the Tcl test suite.
FossilOrigin-Name: df842ebc796a2b0c913d19d873e88d048808dc5283465271369e302a680317e4
2022-05-11 03:42:38 +00:00
larrybr
51b011d8d5 Sync w/ trunk
FossilOrigin-Name: 1284225b0a8c7b630416be5348e99f7280f6443548ec97ffb1c85be23352b2bc
2022-05-11 03:29:52 +00:00
drh
cc212e4450 Fix a bug in the sqlite3WhereMalloc() routines that were added by
chekc-in [f237e1d8cc41b937].  The bug was detected by dbsqlfuzz
test case 4c5e3e89bc251d28378be88233f531b84ec66901.

FossilOrigin-Name: 764b71267e0b31ff7eaf2a0def7526a1a02dce4d5b456dea060d97ed342efdd1
2022-05-10 23:28:12 +00:00
larrybr
73b7af0437 Make tester.tcl work on more Windows Tcl installations. And sync w/ trunk.
FossilOrigin-Name: d25fbdf8772f1c8283828424b208fc1758c82e9e28e0e52122c87db4af1c672d
2022-05-10 22:32:27 +00:00
drh
825ecf9c05 New requirement marks.
FossilOrigin-Name: e8479e56c615a6eb38b58e6d360bea8528ec14a9d7b0798b95d3eb513bd08f0f
2022-05-10 18:43:54 +00:00
drh
0338f53b05 Fix a stale requirement mark.
FossilOrigin-Name: fcda7fb1f184a31a67572aae15f3cdcd60f8aac199106a7b0f90aca251ca7017
2022-05-10 18:18:45 +00:00
drh
d2b960cf41 Fix a stale requirement mark.
FossilOrigin-Name: 3eda4030f73384abf18b97cd8a4606e10b23e382d1b72dff7526aebfde23e0af
2022-05-10 17:42:55 +00:00
drh
de695eab88 Fix a harmless UBSAN warning.
FossilOrigin-Name: 8f9355028bc7baeeb10ee9a5e29f093adac6c2f149596dec0be827be4ce491cb
2022-05-10 15:55:10 +00:00
larrybr
1607ac3357 Sync w/ trunk
FossilOrigin-Name: b7285f92bb9bfd8471e51ee5b6dbd7030b1f731683876e8ecca4a8c033688736
2022-05-10 14:57:38 +00:00
larrybr
527c39de80 For CLI, add ".echo sql" dot-command.
FossilOrigin-Name: 35cef458ca114649ee16e00714d817d57673b96c007454946cc411ae90fd06ce
2022-05-10 14:55:45 +00:00
larrybr
be7777f4a5 Sync w/trunk
FossilOrigin-Name: 536691ed0f76ac37f3d86e4f5b1cff15ce4c011f84cd3452b5b45bafb6bf2522
2022-05-10 06:04:48 +00:00
larrybr
f015a3d19f Cause most shell tests to be run under Tcl suite valgrind config.
FossilOrigin-Name: cd085b36ff777396ac2705c030c1518f8094a70a0b0ba4a628776429524d20f0
2022-05-10 01:11:51 +00:00
drh
adef15986a Simplified "hidden" and "no-expand" handling in the *-expander.
FossilOrigin-Name: c6c3115f3a008cf9b0d7c5c812f17e38c8a75a904032c5f05f0bea03a7340527
2022-05-10 00:24:01 +00:00
larrybr
1a53219981 Create new branch named "echo-sql"
FossilOrigin-Name: 042f2935c9d07668eff6ad8a071c82aa12ccbf9a783dff7b74ddd6b4c82cf573
2022-05-09 18:33:14 +00:00
drh
f71b8123df Minor STAT4 test case change due to the ANALYZE enhancement of
[eb59c46a5aed69bc|check-in eb59c46a5aed69bc].

FossilOrigin-Name: 8ce2fecb580da53fc01c53d8de10e2cc99499094215429ba925e777717e369b2
2022-05-09 17:55:34 +00:00
drh
4077b006ad Add ALWAYS() on two unreachable branches in the * expander.
FossilOrigin-Name: 387c852375bba62df040330944c9e979a6993f95ece3443597c5fc66e34263ca
2022-05-09 16:29:53 +00:00
drh
77874e782b Simplify a branch in the "*" expansion logic. New test case for an
INSTEAD OF trigger on a RIGHT and FULL outer join.

FossilOrigin-Name: d2717348f43b571c7bb58498e0c723331abf85de174189e66aca2c438ca26d5f
2022-05-09 12:59:16 +00:00
larrybr
2f5f674066 Simplify .import leak plug and arrange for CLI to be run under valgrind.
FossilOrigin-Name: 0d3e2380197aa3e725591266acaeb0d43a7e794ca9153e6c56253cdcf60720b1
2022-05-09 12:29:47 +00:00
larrybr
fa5dfa8910 Stop a memory leak in .import, and add leak complaint to CLI debug builds.
FossilOrigin-Name: f5f09368b33b6af00f96e5b8f763e7ee2d00ba6af2aee0f2ca86bb58c03d0b71
2022-05-07 03:53:14 +00:00
larrybr
1e48d79f71 Create new branch named "import-leak-plug"
FossilOrigin-Name: 4a4cecab23ef2aab20b1db466d045d56921590eb67563ab5a31f7b0a0f75c533
2022-05-07 02:21:17 +00:00
drh
41724ebc5a Perserve the requested reserved-bytes size for the database file when
doing a VACUUM.

FossilOrigin-Name: dac6d87c71606f3ec7ce601be6d17357d323476ecb60dbb167030146783b62b2
2022-05-06 22:29:45 +00:00
drh
87b7ac0420 Prevent an infinite loop on SQLITE_ERROR_RETRY when trying to modify a
corrupt schema while PRAGMA writeable_schema=ON is active.
dbsqlfuzz ded83609f475cc989c7339d45efb5151c1495501

FossilOrigin-Name: 217b33234dc3dc36b5b6add50c170869421057a56a7576d1a61767956248d5c9
2022-05-06 00:43:06 +00:00
drh
744c17c482 Backout check-in [9fb20a21feb8f697] which was incorrect.
FossilOrigin-Name: 99225618a83b577efbd5d13c0d1ff73e9c5a71bb43c259d7c0f22cf3479c992f
2022-05-05 10:02:19 +00:00
drh
c915b9c46f Improvements for name resolution for parenthsized joins.
FossilOrigin-Name: 006b2d9c52201c9e836b649018519acfb47f793f70b968722440f00084e9d846
2022-05-04 18:43:39 +00:00
drh
049d239a8c New test cases for RIGHT and FULL JOIN, focusing on cases that make use
of Bloom filters, and a bug fix related to when ON-clause constraints are
applied.

FossilOrigin-Name: 67510354e69bab98bd8095f5bedd34aae619fe2c7885975d7a6a00b7df5ece4e
2022-05-04 17:43:59 +00:00
drh
95cb5ccf92 Code EP_InnerJoin constraints at the same time that EP_FromJoin constraints
are coded.

FossilOrigin-Name: b57033d2af2196e2f7e5305f3504fc20da5cadeb66026d38b999fe909cab8ac5
2022-05-04 17:30:51 +00:00
drh
b2cc3cf36e Merge ON-clause constraint usage fix from trunk into the joinD branch.
FossilOrigin-Name: 0a20d4a85964fb5f2060b9522356ad2711f41d0d526ba3d2e58fc51029878298
2022-05-04 14:46:08 +00:00
drh
11d63ebf2c Fix ON-clause constraint usage for FULL and RIGHT JOINs.
FossilOrigin-Name: 544268a723cafdf0460221f5f018e752836436bad0fac90852cec70e63d9dcde
2022-05-04 14:45:19 +00:00
drh
3b52f80237 New test cases using various join types and Bloom filters. Two cases
differ from PG and need to be resolved.

FossilOrigin-Name: befa8cbc0682bc3269f87e392a1f3d4baacf4db7c716ea84192bb9c13c99490b
2022-05-04 11:49:26 +00:00
larrybr
b55776230d Fix CLI use of wrong allocator for free().
FossilOrigin-Name: 9fb20a21feb8f6979812f45691e06aa3e297d7370cf0d5820523e817a4e97863
2022-05-04 03:45:32 +00:00
drh
367c146b09 In the query planner, do not let tables commute across any outer join.
FossilOrigin-Name: 8cee5388232ade91ea627bb6857eb8937d7530b5ea519e0ae6da362c37c7ed35
2022-05-04 02:01:49 +00:00
larrybr
bc33519de6 Typos cleared from README.md
FossilOrigin-Name: be3a1879c865cff85d8b1f0cc7b95295019c28cce67c687692a3210eeea6e314
2022-05-03 21:58:24 +00:00
drh
eeada07457 Merge Bloom filter bug fix from trunk into the right-join branch.
FossilOrigin-Name: 72131ad1bda3d087e59cd4a51d87f10f65a55e658645397e1ede15f9fb1f5143
2022-05-03 16:26:50 +00:00
drh
00e5d3d59e Fix a typo in a comment.
FossilOrigin-Name: c19c3c48698bf2543d775411c62d01e629791e2f3c5317970fdbb830eacafac6
2022-05-03 16:18:25 +00:00
drh
8aa7f4d813 Fix the Bloom filter pull-down optimization so that it jumps to the correct
place if it encounters a NULL key.  Fix for the bug described by
[forum:/forumpost/2482b32700384a0f|forum thread 2482b32700384a0f].

FossilOrigin-Name: 6eda9b1a7784cf6d58c8876551f67ab98e78a08e726a0579d4def5ba881985bb
2022-05-03 14:01:48 +00:00
drh
207f626356 Add assert()s to show that jumps always land an an instruction that is between
1 and Vdbe.nOp-1.  Had these assert()s been in place before, they would have
caused an assertion fault for the byte-code error reported by
[forum:/forumpost/2482b32700|forum post 2482b32700].

FossilOrigin-Name: 8f8a58feb7047d19522ca32efbe42fd9ddf49aaf9064f7373eb56a88982406a2
2022-05-03 12:11:16 +00:00
drh
d88fd53989 Organize the various flag bits of the ExprList_item object into a substructure
so that the whole lot can be copied all at once.  Faster and smaller code.

FossilOrigin-Name: 5341d4bbe9a943f9cdbbdea829e18f108e98972ebb706396c50fc62fcc6a6328
2022-05-02 20:49:30 +00:00
drh
689f1b9246 Merge trunk fixes into the right-join branch.
FossilOrigin-Name: e01f4c05c21e89dcc7985e00874f288d9ba5d5d932f7284f8d970bd3145ac0c2
2022-05-02 20:14:26 +00:00
drh
63879a2c99 Improved comments.
FossilOrigin-Name: 158b80bed61ade793ccfd979f26a5231fabc8c14697ca0141bba61bc13e3b2ba
2022-05-02 20:04:34 +00:00
drh
72d620bdb1 Name resolution and "*" wildcard expansion for parenthesized FROM clauses
seems to work the same as PG.  The code is chaos, however, and needs some
cleanup.

FossilOrigin-Name: 6f9c0b07aadc5189c65c3ee4e6938aac10fc0d98f1cb06980f5e5d7b0308f237
2022-05-02 19:59:03 +00:00
drh
56f38db700 Remove a testcase() macro taht was made obsolete by [a8da85c57e07721d].
FossilOrigin-Name: 053cf45ecaa7eac8cc64c7b2672807f736a45575a84b426263b2e1feb060b401
2022-05-02 15:47:57 +00:00
drh
c35f02d676 Document (in comments) that the SQLITE_FlttnUnionAll bit has a specific value
needed by TH3.

FossilOrigin-Name: bcaa4a44749d157c5953c6f54c88b1ba29b4035f4b21fce986b7efbea372e109
2022-05-02 15:31:06 +00:00
drh
7a8809907f Fix a harmless compiler warning in sqlite3TreeViewWinFunc() (a routine that
does not even appear in release builds).

FossilOrigin-Name: daff6070039e45df7c47b323a8352e56d1264a7bfb065fe2d79c58454c95a262
2022-05-02 15:23:59 +00:00
drh
85f93850f7 Merge the latest trunk fixes and enhancements into the right-join branch.
FossilOrigin-Name: afbcf075c1e09ae064c7b16e63501cd1d374711812664aef76bd35d02d64a2b6
2022-05-02 15:10:38 +00:00
drh
3a45d30ea5 Improvement on check-in [a193749730d6cfba] so that the subroutine call to
the IN operator right-hand side generator from the RIGHT JOIN no-match logic
does not generate unreachable byte code.

FossilOrigin-Name: cc458317bd77046c4328715ae9e3409f3f4cd422a01162cb33405ef3a142b0a3
2022-05-02 14:32:56 +00:00
drh
b94182bdc6 Bring the comments on sqlite3FindInIndex() into closer alignment with what
that routine actually does.

FossilOrigin-Name: 40f3274745b53bb72933c1052d0e85bc74be56d3a1068e9d54dc28763a2cfef9
2022-05-02 11:24:21 +00:00
drh
bae50d6719 Defensive code in sqlite3TreeViewWindow() to fix a compiler warning.
FossilOrigin-Name: b250c218b4b6327a1cae3edbc037625ba998f89ee13a9bfbc2cefd1edfc4b768
2022-04-30 19:55:28 +00:00
drh
7497364749 Simplified fix to the problem with subroutine reuse in the RIGHT JOIN no-match
logic for a subquery on the right-hand side of an IN operator.  The code still
needs simplification.

FossilOrigin-Name: a193749730d6cfba617f2a64e7254c78f92bbf29b109c19055fc33f6cc643d4c
2022-04-30 18:40:22 +00:00
drh
2aa1086cab Preserve the COLLATE operator on an index on an expression when resolving
the use of that expression into a reference to the index.  See
[forum:/info/7efabf4b03328e57|forum thread 7efabf4b03328e57] for details.

FossilOrigin-Name: a8da85c57e07721dc1c918d67433d6c99ce48421e369123cc3194d855e55f7e8
2022-04-30 12:35:51 +00:00
drh
a25bbaf74a Further improvements to codeEqualityTerm() for cases when an IN operator with
a right-hand side subquery is used as a constraint that needs to be processed
by the RIGHT JOIN non-matched logic.

FossilOrigin-Name: bb2798be3fb5737827eec505db2d4c8cb510d227d98fc26ce748bf2da7e8b382
2022-04-30 00:06:52 +00:00
drh
c64f0e71c1 Enhance the TreeView debugging output for Expr with opcode TK_IN so as to
show the RHS table and the subroutine address.

FossilOrigin-Name: aec1e4cd59ae874b66335e4f87322fbe31fbb752429e68bf41338db316d0a9ed
2022-04-30 00:05:37 +00:00
drh
3d5665366f Enhance the codeEqualityTerm() routine inside the code generator so that it is
able to reuse an IN operator that has an invariant subquery on its right-hand
side while coding the non-matched loop of a RIGHT JOIN.
dbsqlfuzz 19f1102a70cf966ab249de56d944fc20dbebcfcf

FossilOrigin-Name: 56dd3065469e49320b13af039471b3f0b85e6f7368cfd97b1cdc0cf8fa8e1956
2022-04-29 19:00:11 +00:00
drh
8e8e9de87e With TreeView, only show the table columns for a SrcItem if the data source
is a subquery rather than a persistent table.

FossilOrigin-Name: 7b4a0d0fa1d8facaf5e550650d9b261eda7eb7a2a413627f2751f01c5477e1f3
2022-04-29 17:45:39 +00:00
drh
0c0d0526dc Multiple enhancements to the TreeView output for SrcItem, cherrypicked from
the right-join experimental branch.

FossilOrigin-Name: 293afa81112e824eec2557d004a27319d484276f796936e16d64243fe24f6b68
2022-04-29 17:13:52 +00:00
drh
08e1a6a29b Show the USING clause as part of the tree-view display of SrcItem.
FossilOrigin-Name: 9cba3ce577e442f83d7a2d6926e38ffe6bc45953c88ecdd384f3455890303cce
2022-04-29 17:03:25 +00:00
drh
de7a820fd0 Minor typo fix in a comment, for the benefit of broken IDE syntax highlighters.
FossilOrigin-Name: 680ccecbc839373194ed2dcc1053e25512d9ea3f12f8c8963cb8fbd1a034d2f8
2022-04-29 12:09:43 +00:00
dan
07fd1bf323 Fix problem with SQLITE_OMIT_VIRTUALTABLE builds.
FossilOrigin-Name: a99ee612b9bd6d75b63e557ef5bdac2143425a558cf023a0480cc28c8300a9a8
2022-04-28 18:33:02 +00:00
drh
a087eb8f6d In treeview.c, show the columns of the table associated with each SrcItem.
FossilOrigin-Name: 3aafccb5c3c780c29090ee5eb428a6c3153627ce8bf834bbd392e79a30e9389b
2022-04-28 18:17:51 +00:00
drh
4bea8c6b56 Tweaks to the name resolution on parenthesized joins. A small number of
tests fail now due to extra columns appearing in the expansion of "*".

FossilOrigin-Name: c86804917e3fffcf0c19bbf11875667f7968275210fc768e650826bd9c87a5d2
2022-04-28 17:35:58 +00:00
drh
09121b0523 Merge trunk enhancements into the right-join branch.
FossilOrigin-Name: 3fd9706bba4a71cb5c7ce1341c3be0a7727941445820a073e7b2f0f32512e8ef
2022-04-28 12:52:49 +00:00
drh
22b541b55a Fix a harmless typo in a comment.
FossilOrigin-Name: e1f4a115df34e45cf1bcf98961c699b582f564a58a979e95853b219bda06212c
2022-04-27 18:38:46 +00:00
drh
609959285b When computing STAT1 values using ANALYZE, if a ratio comes out to be between
1.0 and 1.1, then round it down to 1 rather than the using the default rounding
rule of changing it to 2.  The reduces the estimation error for the
case where a column value is very nearly, but not quite unique.

FossilOrigin-Name: eb59c46a5aed69bc6fd096997bf24c082e533c1085439f6ec1fbe5ff78e8b374
2022-04-27 16:41:56 +00:00
dan
9684d71081 Fix a test problem in rbubusy.test causing a crash under some circumstances.
FossilOrigin-Name: bc5bbd9fa636cc9ef0cbbc0600b8fc1404b9732670ac4e7a8b5a230fbce758d5
2022-04-27 13:33:48 +00:00
dan
5487cdcc0a Update corruptL.test so that it works with SQLITE_ENABLE_OVERSIZE_CELL_CHECK builds.
FossilOrigin-Name: b1bec72043f798f4d4d30e6b60a45ed4dc521115c8a9f97bb8228e3f089deefb
2022-04-26 19:16:11 +00:00
drh
3e4314b4f8 Fix a problem with automatic indexes introduced by
check-in [664b461bb5063d980] and reported by
[forum:/forumpost/0d3200f4f3bcd3a3|forum post 0d3200f4f3bcd3a3].

FossilOrigin-Name: 134cfb18ff930e4bccc1a7412a02be353bf67c6d5080bc0673afaac81afa889c
2022-04-25 20:56:55 +00:00
drh
0e464b5f51 Do not allow the push-down optimization on the right table of a RIGHT JOIN.
FossilOrigin-Name: 05917bfa02a7b6678c147d10fb53f55532ab15fd5d82d925ae921ae3759f0115
2022-04-25 20:47:58 +00:00
drh
5eb6e09795 The pushDownWhereTerms() routine should be using
sqlite3ExprIsTableConstraint(), not sqlite3ExprIsTableConstant().  This fixes
many problems, but still an error persists in join7.test.

FossilOrigin-Name: 10bf0e613809f71cc1a47ad40b517e2a66671212a6464e179c9d377e8b70d499
2022-04-25 20:38:42 +00:00
drh
a9cdb90421 Fix a problem with automatic indexes introduced by
check-in [664b461bb5063d980] and reported by
[forum:/forumpost/0d3200f4f3bcd3a3|forum post 0d3200f4f3bcd3a3].

FossilOrigin-Name: 7ca3456c00998a429418ff29cf251b381586b330b88344c94a40c5df0b71da85
2022-04-25 19:40:33 +00:00
drh
95fe38f2fc Add a new optimizer disabling bit to disable just the UNION ALL branch of the
query flattener.

FossilOrigin-Name: c0f9ebab5455d8541a562122d3270b95ce571c3fd870b0048dda2b036c2b66c0
2022-04-25 14:59:59 +00:00
drh
7f417569f7 Avoid unintended side-effects on Parse.nSelect in the
sqlite3ViewGetColumnNames() routine.

FossilOrigin-Name: 59789fe1e745bb6f81898176e7e9c6064ac9f4bbefb4dc3c8f3e4c1379568f69
2022-04-25 14:49:48 +00:00
drh
1a6bac0d2f Remove NEVER() on branches formerly thought to unreachable
(see check-in [71272caff5874137]) in order to fix the first bug reported
by [forum:/forumpost/28821db852|forum post 28821db852].

FossilOrigin-Name: bd6811d8110d5f00596e2eff6d4b02af8b6d8557d41990e6f50518ead0fa01fb
2022-04-25 10:43:19 +00:00
drh
7980fadcef Merge enhancements and fixes from trunk into the right-join branch.
FossilOrigin-Name: 2fb165cf8bd1e43248612aa2922bd311df30dcbb3c2f1daee73c363e409c501f
2022-04-23 19:26:34 +00:00
drh
ecb386b71f Prevent the ORDER BY LIMIT optimization from running if the innermost loop
is a right-join, as doing so will get an incorrect answer.

FossilOrigin-Name: 3aefc874d31885c64a5e02868edb2aa56a2b4429252d494e67e4088a9298ce5b
2022-04-23 19:21:47 +00:00
drh
30d2aab5fd In debug builds, add extra code to verify that there are no jumps that try to
escape from the right-join body subroutine.

FossilOrigin-Name: 45fe919266ba1843f3eeeb511ab43126069d4976c9fc64e57e0390c21f110b6e
2022-04-23 18:46:03 +00:00