aboutsummaryrefslogtreecommitdiff
path: root/test/in.test
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-09-02 19:01:16 +0000
committerdan <dan@noemail.net>2010-09-02 19:01:16 +0000
commit74b617b22a2d26821c3580a9d8f8db271899e0ce (patch)
tree410f521941194b1b601ac09b160935e8a4a2435f /test/in.test
parent7ff2719e889d16c180baef63c39e721ea874db30 (diff)
downloadsqlite-74b617b22a2d26821c3580a9d8f8db271899e0ce.tar.gz
sqlite-74b617b22a2d26821c3580a9d8f8db271899e0ce.zip
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
Diffstat (limited to 'test/in.test')
-rw-r--r--test/in.test37
1 files changed, 33 insertions, 4 deletions
diff --git a/test/in.test b/test/in.test
index 8fbfbed8f..2c38a0f4c 100644
--- a/test/in.test
+++ b/test/in.test
@@ -404,33 +404,62 @@ do_test in-12.5 {
do_test in-12.6 {
catchsql {
SELECT * FROM t2 WHERE a IN (
- SELECT a FROM t3 UNION ALL SELECT a, b FROM t2
+ SELECT a, b FROM t3 UNION ALL SELECT a FROM t2
);
}
} {1 {SELECTs to the left and right of UNION ALL do not have the same number of result columns}}
do_test in-12.7 {
catchsql {
SELECT * FROM t2 WHERE a IN (
- SELECT a FROM t3 UNION SELECT a, b FROM t2
+ SELECT a, b FROM t3 UNION SELECT a FROM t2
);
}
} {1 {SELECTs to the left and right of UNION do not have the same number of result columns}}
do_test in-12.8 {
catchsql {
SELECT * FROM t2 WHERE a IN (
- SELECT a FROM t3 EXCEPT SELECT a, b FROM t2
+ SELECT a, b FROM t3 EXCEPT SELECT a FROM t2
);
}
} {1 {SELECTs to the left and right of EXCEPT do not have the same number of result columns}}
do_test in-12.9 {
catchsql {
SELECT * FROM t2 WHERE a IN (
- SELECT a FROM t3 INTERSECT SELECT a, b FROM t2
+ SELECT a, b FROM t3 INTERSECT SELECT a FROM t2
);
}
} {1 {SELECTs to the left and right of INTERSECT do not have the same number of result columns}}
}
+do_test in-12.10 {
+ catchsql {
+ SELECT * FROM t2 WHERE a IN (
+ SELECT a FROM t3 UNION ALL SELECT a, b FROM t2
+ );
+ }
+} {1 {only a single result allowed for a SELECT that is part of an expression}}
+do_test in-12.11 {
+ catchsql {
+ SELECT * FROM t2 WHERE a IN (
+ SELECT a FROM t3 UNION SELECT a, b FROM t2
+ );
+ }
+} {1 {only a single result allowed for a SELECT that is part of an expression}}
+do_test in-12.12 {
+ catchsql {
+ SELECT * FROM t2 WHERE a IN (
+ SELECT a FROM t3 EXCEPT SELECT a, b FROM t2
+ );
+ }
+} {1 {only a single result allowed for a SELECT that is part of an expression}}
+do_test in-12.13 {
+ catchsql {
+ SELECT * FROM t2 WHERE a IN (
+ SELECT a FROM t3 INTERSECT SELECT a, b FROM t2
+ );
+ }
+} {1 {only a single result allowed for a SELECT that is part of an expression}}
+
#------------------------------------------------------------------------
# The following tests check that NULL is handled correctly when it