]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add test cases for errors in "IN(SELECT ...)" expressions where the SELECT statement...
authordanielk1977 <danielk1977@noemail.net>
Thu, 13 Dec 2007 18:24:21 +0000 (18:24 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Thu, 13 Dec 2007 18:24:21 +0000 (18:24 +0000)
FossilOrigin-Name: 49b67adfe9f15dfac34cb30f965920bf61bceee7

manifest
manifest.uuid
test/in.test

index 0b12921036749be724af57c7ad5006e43f6430d3..9895000bd416d198a2f146fd36850d9d7a3baf88 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\snew\smakefile\starget\sfor\s"testcli"\sthat\sbuilds\sa\sCLI\susing\sindividual\nsource\sfiles\sinstead\sof\sthe\samalgamation.\s\sTicket\s#2838.\s(CVS\s4625)
-D 2007-12-13T18:20:46
+C Add\stest\scases\sfor\serrors\sin\s"IN(SELECT\s...)"\sexpressions\swhere\sthe\sSELECT\sstatement\sis\sa\scompound\sSELECT.\sNo\sfaults\sfound.\s(CVS\s4626)
+D 2007-12-13T18:24:22
 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
 F Makefile.in e66cf1239b8009b073156b36f92e68657d4755da
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -320,7 +320,7 @@ F test/fuzz_common.tcl ff4bc2dfc465f6878f8e2d819620914365382731
 F test/fuzz_malloc.test 166b58dfd77cc04f6afeeaef0cfc1087abf134d1
 F test/hook.test 3870abead2ee75d2c03585c916256ca8b5584679
 F test/icu.test e6bfae7f625c88fd14df6f540fe835bdfc1e4329
-F test/in.test 369cb2aa1eab02296b4ec470732fe8c131260b1d
+F test/in.test 87270d14e2dd870da77d178985b43fea4675eb56
 F test/in2.test b1f447f4f0f67e9f83ff931e7e2e30873f9ea055
 F test/in3.test e335959db24d71d6cfdff9553c90ce2b56fb978c
 F test/incrblob.test 602dbfa956904d6e58c45635b58850ad0f02d927
@@ -600,7 +600,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 8f184e40ff79c3c5ef98337615f58a4a6d0249dd
-R 6bad6caa2383e3aa8a396a85f0146a5c
-U drh
-Z c69ad200fab9c01740cad90490ab2754
+P b6f04e5b93bb65287bfb697f2f059dd34c13102a
+R 5cc904e5bc9f83891fe81bff3ae57100
+U danielk1977
+Z 1eae098b23de6eb32777ca1bcfba9fb8
index a1d9ffe73e964aa63e72a044a4f5d0f2630cb68d..0705e8ec68c9b0a3469a98ea112ed51b13410b35 100644 (file)
@@ -1 +1 @@
-b6f04e5b93bb65287bfb697f2f059dd34c13102a
\ No newline at end of file
+49b67adfe9f15dfac34cb30f965920bf61bceee7
\ No newline at end of file
index 84147fded013bb77b59ea96f8220921969b3980b..6d6af278610f6f69dc1d491fdbc5aea15e56e751 100644 (file)
@@ -11,7 +11,7 @@
 # This file implements regression tests for SQLite library.  The
 # focus of this file is testing the IN and BETWEEN operator.
 #
-# $Id: in.test,v 1.17 2006/05/23 23:25:10 drh Exp $
+# $Id: in.test,v 1.18 2007/12/13 18:24:22 danielk1977 Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -364,4 +364,69 @@ do_test in-11.6 {
   }
 } {}
 
+# Test error conditions with expressions of the form IN(<compound select>).
+#
+do_test in-12.1 {
+  execsql {
+    CREATE TABLE t2(a, b, c);
+    CREATE TABLE t3(a, b, c);
+  }
+} {}
+do_test in-12.2 {
+  catchsql {
+    SELECT * FROM t2 WHERE a IN (
+      SELECT a, b 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.3 {
+  catchsql {
+    SELECT * FROM t2 WHERE a IN (
+      SELECT a, b 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.4 {
+  catchsql {
+    SELECT * FROM t2 WHERE a IN (
+      SELECT a, b 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.5 {
+  catchsql {
+    SELECT * FROM t2 WHERE a IN (
+      SELECT a, b FROM t3 INTERSECT SELECT a, b FROM t2
+    );
+  }
+} {1 {only a single result allowed for a SELECT that is part of an expression}}
+do_test in-12.6 {
+  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.7 {
+  catchsql {
+    SELECT * FROM t2 WHERE a IN (
+      SELECT a FROM t3 UNION SELECT a, b 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
+    );
+  }
+} {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
+    );
+  }
+} {1 {SELECTs to the left and right of INTERSECT do not have the same number of result columns}}
+
 finish_test