Commit Graph

39 Commits

Author SHA1 Message Date
drh fbfd113365 Reinstate the optimization of converting "a IN (C)" into "a=C" but only
if C is a constant.  If the RHS is a table column, the complications of
managing affinity and collations become too involved to mess with.

FossilOrigin-Name: 8ac26a23d7f0ef29c5eb007c7467181f8b96102c8600ea8a5b15cc7584af27bd
2020-01-28 18:09:53 +00:00
drh 4fc836546e Fix a bug introduced earlier today by check-in [88833a9c2849c959].
Ticket [29f635e0af71234b]

FossilOrigin-Name: 6e7b4527d32cc1be0294614b9d7363d4b59cf654a954b86515b3f6888975ce73
2019-09-02 22:13:06 +00:00
drh dd668c26b5 When applying the IN_INDEX_NOOP optimization and the LHS has REAL affinity,
also apply REAL affinity to each element of the RHS.
Ticket [2841e99d104c6436].

FossilOrigin-Name: 88833a9c2849c959a37a80e0e4d2b211ce3c83a48319724c89b172b060c876b4
2019-09-02 02:21:58 +00:00
drh 7ec796d002 Add ALWAYS() to an always true conditional that results from the
previous check-in.  Add a test case for ticket [dbaf8a6820be1ece] to
supplement those already checked into TH3.

FossilOrigin-Name: aff209804722ac902c7abfde80ad2677e0f51beb2c7f28f65d51105d984a1640
2019-08-27 17:28:05 +00:00
drh 42be2ad30b Make sure the affinity of the RHS of an IN operator does not affect the
outcome even if the RHS expression contains a COLLATE clause.
Ticket [57353f8243c637c0]

FossilOrigin-Name: 0f748fe58bbbb7ce3f30303da25ec811b2bbce249549aa9c7927979ac5b38013
2019-06-11 18:07:53 +00:00
dan d1f9932e4b Add further test cases to improve VDBE branch coverage.
FossilOrigin-Name: 51a95e52fc58d8be2c9c51576dff7258c705735b66d203948f80db017b4c10d2
2019-04-04 20:55:37 +00:00
drh 042666e4fa When an IN operator drives a query loop, mark it as "CODED" so that it
will not be used afterwards for a (pointless) membership test.  This is
a better fix for ticket [df46dfb631f75694] than the previous fix that is
now on a branch as it preserves the full optimization of
check-in [e130319317e76119].

FossilOrigin-Name: fa792714ae62fa980f1767acc6d622a6727ceb677870243c88548423795dcb5b
2019-02-20 12:52:47 +00:00
mistachkin 885f410472 Remove some 'breakpoint' commands in test files.
FossilOrigin-Name: d14fc621e918915bbf8e04597eb238ea78dff3d9c5eb4402cb88692d00dbdfee
2017-07-19 18:01:42 +00:00
dan d49fd4e89a Fix some problems with multi-column IN(SELECT...) processing.
FossilOrigin-Name: 719a3b2035a335ca8b9704646b1d641011e3ea0e
2016-07-27 19:33:04 +00:00
dan d93ba6271b Initialize a variable in where.c to avoid a valgrind warning.
FossilOrigin-Name: 4d59df02d3713b3e3804e1a88e676749b2794286
2016-07-27 16:03:54 +00:00
dan 8da209b169 Fix where.c handling of "IN (SELECT ...)" expressions when the SELECT returns more than one result column. Also error handling for other row value constructor cases.
FossilOrigin-Name: 061b8006034f06a0311b4304c8b14d2c8b0153df
2016-07-26 18:06:08 +00:00
dan 923cadb1ae Test that the left and right sides of a compound SELECT operator have the same number of expressions in the expanded expression list before beginning to generate code.
FossilOrigin-Name: 4df852ce26c95d5d23c83dbe9c59d2c3435acddf
2015-06-23 12:19:55 +00:00
drh 311efc70a7 Add a test case for what was formerly thought to be an unreachable condition:
when the LHS of an OR operator contains an error and the RHS contains an IN
operator.

FossilOrigin-Name: 3872742591add4e94033484c2844e7d7ab69674b
2015-04-15 04:20:58 +00:00
drh f9c8ce3ced Standardize the error messages generated by constraint failures to a format
of "$TYPE constraint failed: $DETAIL".  This involves many changes to the
expected output of test cases.

FossilOrigin-Name: 54b221929744b1bcdbcc2030fef2e510618afd41
2013-11-05 13:33:55 +00:00
drh 5fb52caadf Do more aggressive optimization of the AND operator where one side or the
other is always false.

FossilOrigin-Name: f9a7e179cbbeeab5e57bbf392bef89750215546b
2012-03-31 02:34:35 +00:00
dan 2f56da3f26 Changes to various test scripts so that veryquick.test runs with OMIT_COMPOUND_SELECT defined.
FossilOrigin-Name: 76bb649ee2633226324130f5898622c348f93769
2012-02-13 10:00:35 +00:00
dan 74b617b22a Move the test for an (illegal) scalar sub-query that returns more than one column to earlier in SELECT processing in order to avoid an assert() that can happen later on.
FossilOrigin-Name: a55842cfb56b659c88832dce9ce7bafb50258211
2010-09-02 19:01:16 +00:00
danielk1977 de3e41e304 Fix (make test) with SQLITE_OMIT_COMPOUND_SELECT. Ticket #3235. (CVS 5530)
FossilOrigin-Name: 9ca975c8fdeaae7d5af8fe62e097d8d251362cfe
2008-08-04 03:51:24 +00:00
danielk1977 0cdc022e88 Fix handling of "x IN (...)" and "x NOT IN (...)" expressions when the set contains an SQL NULL value. (CVS 5314)
FossilOrigin-Name: d45a97be71fa61ab4a692bd807ab762130f7f5b9
2008-06-26 18:04:03 +00:00
drh f6e369a119 Fix a problem in sqlite3ExprIsInteger() causing failures on select1-4.9.2.
Other bug fixes in compound-merge.  The compound-merge is still disabled
in this check-in using "#if 0" due to additional bugs. (CVS 5295)

FossilOrigin-Name: 95037e6dbf4ed0ffd38790f3270dcaa4c1ae64ed
2008-06-24 12:46:30 +00:00
danielk1977 24acd8f939 Use 1<<$x instead of pow(2,$x) in the test suite code. (CVS 4715)
FossilOrigin-Name: 3a289b6d28bcf399845586b15f100d7c3a78b550
2008-01-16 18:20:41 +00:00
danielk1977 b9fdb2c2f7 Add test cases for errors in "IN(SELECT ...)" expressions where the SELECT statement is a compound SELECT. No faults found. (CVS 4626)
FossilOrigin-Name: 49b67adfe9f15dfac34cb30f965920bf61bceee7
2007-12-13 18:24:21 +00:00
drh 9c0cb0e893 Additional tests for ticket #1821. (CVS 3189)
FossilOrigin-Name: b93e3fb02aeff7fe6cae56c3a45c43ffdb2f030b
2006-05-23 23:25:09 +00:00
drh 8159a35f46 Fix type coercion rules for the IN operator. Ticket #1821. (CVS 3188)
FossilOrigin-Name: 6e5a49762166a942e1b2c3beae8a30c07187eb10
2006-05-23 23:22:29 +00:00
drh afa5f68091 Fix bug with CHECK constraints contain an IN operator. Ticket #1645. (CVS 3035)
FossilOrigin-Name: 944df310ce8d32798135c70becee7845676520ae
2006-01-30 14:36:59 +00:00
drh 57dbd7b324 Allow the IN operator to take a list of arbitrary expressions on its
right-hand side.  The expressions no longer need to be constant.  The
current implementation seems to work but needs more testing and optimization. (CVS 2542)

FossilOrigin-Name: ba56478dd8bc2135749966ff55831fd497883781
2005-07-08 18:25:26 +00:00
danielk1977 3e8c37e7f8 Modify test scripts to work when SQLITE_OMIT_SUBQUERY (along with other OMIT macros) is defined. (CVS 2251)
FossilOrigin-Name: bb0254ab14417f0ab40f10f37cb63a60507f070a
2005-01-21 03:12:14 +00:00
drh 5f3b4ab53c Remove the COPY command. (CVS 1477)
FossilOrigin-Name: 287f86731c71401dbac098e08357367b4f8e5a43
2004-05-27 17:22:54 +00:00
drh 23b2db23b4 Allow "<expr> IN <table>" as a shorthand for
"<expr> IN (SELECT * FROM <table>)" (CVS 1180)

FossilOrigin-Name: 01874d252ac44861e927dea3f5534f67e19b1fa8
2004-01-15 03:30:24 +00:00
drh 7bdc0c1def Modify the optimizer so that it does not assume that functions are
constant. (CVS 920)

FossilOrigin-Name: 767f1af236d115e8388e1dcc28a4df1be48d6c85
2003-04-19 17:27:24 +00:00
drh 88eee38afd Allow double-quoted strings as string constants in the IN operator. As a
side-efffect, allow the GROUP BY clause to refer to columns by their integer
column number.  Ticket #237. (CVS 856)

FossilOrigin-Name: 187d9c405891e543fc706f8ddb41f3966a842214
2003-01-31 17:16:36 +00:00
drh 38dd0b4ff0 In the VDBE, check to make sure a set has been initialized before using it.
Ticket #185. (CVS 772)

FossilOrigin-Name: 8c4cbdd05517e91879a0f2c4559d0f0518d2385b
2002-10-30 22:42:58 +00:00
drh 6cbe1f1bc4 Added additional tests. No new errors found. (CVS 653)
FossilOrigin-Name: 8924a7f5bab790ab552332d6359028d0d1825e4a
2002-07-01 00:31:36 +00:00
drh 6b12545f4f Bug fix: The IN operator was not working if either side derived from
an INTEGER PRIMARY KEY. (CVS 354)

FossilOrigin-Name: dbcfe198fbaa155874ef82a96b6a4b993ccf3931
2002-01-28 15:53:03 +00:00
drh b19a2bc603 Disclaimed copyright. Preparing for release 2.0. (CVS 250)
FossilOrigin-Name: 4e926efe2b59adfec4086eb1d2ba830238facb4c
2001-09-16 00:13:26 +00:00
drh c4a3c779b1 Added transaction support (CVS 196)
FossilOrigin-Name: 35a8feed0d10e780c477f7440fbe80637fcf9906
2001-04-04 11:48:57 +00:00
drh 967e8b7351 :-) (CVS 104)
FossilOrigin-Name: e1bf96a467b739373191bf75e6a097fc0f24bffc
2000-06-21 13:59:10 +00:00
drh d8bc708652 :-) (CVS 74)
FossilOrigin-Name: 2ffeb8509c469f5a499d56bb109da079fcdff570
2000-06-07 23:51:50 +00:00
drh 4794b98035 added IN and BETWEEN operators (CVS 57)
FossilOrigin-Name: 54d198189b58366e4e40139102bc6de94ac55e18
2000-06-06 13:54:14 +00:00