aboutsummaryrefslogtreecommitdiff
path: root/test/in5.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/in5.test')
-rw-r--r--test/in5.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/in5.test b/test/in5.test
index 67d212589..b49c93e15 100644
--- a/test/in5.test
+++ b/test/in5.test
@@ -183,4 +183,39 @@ do_execsql_test 6.3.1 {
SELECT count(*) FROM x2 WHERE b IN (SELECT DISTINCT a FROM x1 LIMIT 2);
} {2}
+#-------------------------------------------------------------------------
+# Test to confirm that bug [5e3c886796e5] is fixed.
+#
+do_execsql_test 7.1 {
+ CREATE TABLE y1(a, b);
+ CREATE TABLE y2(c);
+
+ INSERT INTO y1 VALUES(1, 'one');
+ INSERT INTO y1 VALUES('two', 'two');
+ INSERT INTO y1 VALUES(3, 'three');
+
+ INSERT INTO y2 VALUES('one');
+ INSERT INTO y2 VALUES('two');
+ INSERT INTO y2 VALUES('three');
+} {}
+
+do_execsql_test 7.2.1 {
+ SELECT a FROM y1 WHERE b NOT IN (SELECT a FROM y2);
+} {1 3}
+do_execsql_test 7.2.2 {
+ SELECT a FROM y1 WHERE b IN (SELECT a FROM y2);
+} {two}
+
+do_execsql_test 7.3.1 {
+ CREATE INDEX y2c ON y2(c);
+ SELECT a FROM y1 WHERE b NOT IN (SELECT a FROM y2);
+} {1 3}
+do_execsql_test 7.3.2 {
+ SELECT a FROM y1 WHERE b IN (SELECT a FROM y2);
+} {two}
+
+finish_test
+
+
+
finish_test