diff options
Diffstat (limited to 'test/select7.test')
-rw-r--r-- | test/select7.test | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/select7.test b/test/select7.test index 6816b9fcb..9ed535774 100644 --- a/test/select7.test +++ b/test/select7.test @@ -15,6 +15,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl +set testprefix select7 ifcapable compound { @@ -201,4 +202,23 @@ do_test select7-7.7 { } } {text 123} +do_execsql_test 8.0 { + CREATE TABLE t01(x, y); + CREATE TABLE t02(x, y); +} + +do_catchsql_test 8.1 { + SELECT * FROM ( + SELECT * FROM t01 UNION SELECT x FROM t02 + ) WHERE y=1 +} {1 {SELECTs to the left and right of UNION do not have the same number of result columns}} + +do_catchsql_test 8.2 { + CREATE VIEW v0 as SELECT x, y FROM t01 UNION SELECT x FROM t02; + EXPLAIN QUERY PLAN SELECT * FROM v0 WHERE x='0' OR y; +} {1 {SELECTs to the left and right of UNION do not have the same number of result columns}} + + finish_test + + |