aboutsummaryrefslogtreecommitdiff
path: root/test/in.test
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-09-02 02:21:58 +0000
committerdrh <drh@noemail.net>2019-09-02 02:21:58 +0000
commitdd668c26b5d7a7526638e39239844e01a1d251e0 (patch)
tree038328bfda17b19f9a12e664c5989e85f79da23c /test/in.test
parent0167ef202b2279af622956a4a1a073531759c216 (diff)
downloadsqlite-dd668c26b5d7a7526638e39239844e01a1d251e0.tar.gz
sqlite-dd668c26b5d7a7526638e39239844e01a1d251e0.zip
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
Diffstat (limited to 'test/in.test')
-rw-r--r--test/in.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/in.test b/test/in.test
index f96dfcc11..bd1209fb6 100644
--- a/test/in.test
+++ b/test/in.test
@@ -759,5 +759,21 @@ do_execsql_test in-18.1 {
SELECT * FROM t0 WHERE '1' IN (t0.c0);
} {}
+# 2019-09-02 ticket https://www.sqlite.org/src/info/2841e99d104c6436
+# For the IN_INDEX_NOOP optimization, apply REAL affinity to the LHS
+# values prior to comparison if the RHS has REAL affinity.
+#
+do_execsql_test in-19.1 {
+ DROP TABLE IF EXISTS t0;
+ CREATE TABLE t0(c0 REAL UNIQUE);
+ INSERT INTO t0(c0) VALUES(2.07093491255203046E18);
+ SELECT 1 FROM t0 WHERE c0 IN ('2070934912552030444');
+} {1}
+do_execsql_test in-19.2 {
+ SELECT c0 IN ('2070934912552030444') FROM t0;
+} {1}
+do_execsql_test in-19.3 {
+ SELECT c0 IN ('2070934912552030444',2,3) FROM t0;
+} {1}
finish_test