Fix (make test) with SQLITE_OMIT_COMPOUND_SELECT. Ticket #3235. (CVS 5530)
FossilOrigin-Name: 9ca975c8fdeaae7d5af8fe62e097d8d251362cfe
This commit is contained in:
+17
-15
@@ -13,7 +13,7 @@
|
||||
# factoring constant expressions out of loops and for
|
||||
# common subexpression eliminations.
|
||||
#
|
||||
# $Id: cse.test,v 1.5 2008/04/01 18:04:11 drh Exp $
|
||||
# $Id: cse.test,v 1.6 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
@@ -94,20 +94,22 @@ do_test cse-1.10 {
|
||||
SELECT CAST(b AS integer), typeof(b), CAST(b AS text), typeof(b) FROM t1
|
||||
}
|
||||
} {11 integer 11 integer 21 integer 21 integer}
|
||||
do_test cse-1.11 {
|
||||
execsql {
|
||||
SELECT *,* FROM t1 WHERE a=2
|
||||
UNION ALL
|
||||
SELECT *,* FROM t1 WHERE a=1
|
||||
}
|
||||
} {2 21 22 23 24 25 2 21 22 23 24 25 1 11 12 13 14 15 1 11 12 13 14 15}
|
||||
do_test cse-1.12 {
|
||||
execsql {
|
||||
SELECT coalesce(b,c,d,e), a, b, c, d, e FROM t1 WHERE a=2
|
||||
UNION ALL
|
||||
SELECT coalesce(e,d,c,b), e, d, c, b, a FROM t1 WHERE a=1
|
||||
}
|
||||
} {21 2 21 22 23 24 14 14 13 12 11 1}
|
||||
ifcapable compound {
|
||||
do_test cse-1.11 {
|
||||
execsql {
|
||||
SELECT *,* FROM t1 WHERE a=2
|
||||
UNION ALL
|
||||
SELECT *,* FROM t1 WHERE a=1
|
||||
}
|
||||
} {2 21 22 23 24 25 2 21 22 23 24 25 1 11 12 13 14 15 1 11 12 13 14 15}
|
||||
do_test cse-1.12 {
|
||||
execsql {
|
||||
SELECT coalesce(b,c,d,e), a, b, c, d, e FROM t1 WHERE a=2
|
||||
UNION ALL
|
||||
SELECT coalesce(e,d,c,b), e, d, c, b, a FROM t1 WHERE a=1
|
||||
}
|
||||
} {21 2 21 22 23 24 14 14 13 12 11 1}
|
||||
}
|
||||
do_test cse-1.13 {
|
||||
execsql {
|
||||
SELECT upper(b), typeof(b), b FROM t1
|
||||
|
||||
+27
-25
@@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing built-in functions.
|
||||
#
|
||||
# $Id: func.test,v 1.85 2008/07/31 01:47:11 shane Exp $
|
||||
# $Id: func.test,v 1.86 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -290,30 +290,32 @@ do_test func-8.4 {
|
||||
SELECT max('z+'||a||'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP') FROM t3;
|
||||
}
|
||||
} {z+67890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP}
|
||||
do_test func-8.5 {
|
||||
execsql {
|
||||
SELECT sum(x) FROM (SELECT '9223372036' || '854775807' AS x
|
||||
UNION ALL SELECT -9223372036854775807)
|
||||
}
|
||||
} {0}
|
||||
do_test func-8.6 {
|
||||
execsql {
|
||||
SELECT typeof(sum(x)) FROM (SELECT '9223372036' || '854775807' AS x
|
||||
UNION ALL SELECT -9223372036854775807)
|
||||
}
|
||||
} {integer}
|
||||
do_test func-8.7 {
|
||||
execsql {
|
||||
SELECT typeof(sum(x)) FROM (SELECT '9223372036' || '854775808' AS x
|
||||
UNION ALL SELECT -9223372036854775807)
|
||||
}
|
||||
} {real}
|
||||
do_test func-8.8 {
|
||||
execsql {
|
||||
SELECT sum(x)>0.0 FROM (SELECT '9223372036' || '854775808' AS x
|
||||
UNION ALL SELECT -9223372036850000000)
|
||||
}
|
||||
} {1}
|
||||
ifcapable compound {
|
||||
do_test func-8.5 {
|
||||
execsql {
|
||||
SELECT sum(x) FROM (SELECT '9223372036' || '854775807' AS x
|
||||
UNION ALL SELECT -9223372036854775807)
|
||||
}
|
||||
} {0}
|
||||
do_test func-8.6 {
|
||||
execsql {
|
||||
SELECT typeof(sum(x)) FROM (SELECT '9223372036' || '854775807' AS x
|
||||
UNION ALL SELECT -9223372036854775807)
|
||||
}
|
||||
} {integer}
|
||||
do_test func-8.7 {
|
||||
execsql {
|
||||
SELECT typeof(sum(x)) FROM (SELECT '9223372036' || '854775808' AS x
|
||||
UNION ALL SELECT -9223372036854775807)
|
||||
}
|
||||
} {real}
|
||||
do_test func-8.8 {
|
||||
execsql {
|
||||
SELECT sum(x)>0.0 FROM (SELECT '9223372036' || '854775808' AS x
|
||||
UNION ALL SELECT -9223372036850000000)
|
||||
}
|
||||
} {1}
|
||||
}
|
||||
|
||||
# How do you test the random() function in a meaningful, deterministic way?
|
||||
#
|
||||
|
||||
+3
-1
@@ -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.21 2008/06/26 18:04:03 danielk1977 Exp $
|
||||
# $Id: in.test,v 1.22 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -366,6 +366,7 @@ do_test in-11.6 {
|
||||
|
||||
# Test error conditions with expressions of the form IN(<compound select>).
|
||||
#
|
||||
ifcapable compound {
|
||||
do_test in-12.1 {
|
||||
execsql {
|
||||
CREATE TABLE t2(a, b, c);
|
||||
@@ -428,6 +429,7 @@ do_test in-12.9 {
|
||||
);
|
||||
}
|
||||
} {1 {SELECTs to the left and right of INTERSECT do not have the same number of result columns}}
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
+10
-8
@@ -13,7 +13,7 @@
|
||||
#
|
||||
# <value> IN (SELECT <column> FROM <table>)
|
||||
#
|
||||
# $Id: in3.test,v 1.4 2008/03/12 10:39:00 danielk1977 Exp $
|
||||
# $Id: in3.test,v 1.5 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -103,13 +103,15 @@ do_test in3-1.12 {
|
||||
|
||||
# Has to use a temp-table because of the compound sub-select.
|
||||
#
|
||||
do_test in3-1.13 {
|
||||
exec_neph {
|
||||
SELECT a FROM t1 WHERE a IN (
|
||||
SELECT a FROM t1 UNION ALL SELECT a FROM t1
|
||||
)
|
||||
}
|
||||
} {1 1 3 5}
|
||||
ifcapable compound {
|
||||
do_test in3-1.13 {
|
||||
exec_neph {
|
||||
SELECT a FROM t1 WHERE a IN (
|
||||
SELECT a FROM t1 UNION ALL SELECT a FROM t1
|
||||
)
|
||||
}
|
||||
} {1 1 3 5}
|
||||
}
|
||||
|
||||
# The first of these queries has to use the temp-table, because the
|
||||
# collation sequence used for the index on "t1.a" does not match the
|
||||
|
||||
+19
-8
@@ -12,7 +12,7 @@
|
||||
# The tests in this file ensure that a temporary table is used
|
||||
# when required by an "INSERT INTO ... SELECT ..." statement.
|
||||
#
|
||||
# $Id: insert5.test,v 1.4 2008/01/06 00:25:22 drh Exp $
|
||||
# $Id: insert5.test,v 1.5 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -47,14 +47,25 @@ do_test insert5-1.0 {
|
||||
|
||||
# Run the query.
|
||||
#
|
||||
do_test insert5-1.1 {
|
||||
execsql {
|
||||
INSERT INTO B
|
||||
SELECT * FROM B UNION ALL
|
||||
SELECT * FROM MAIN WHERE exists (select * FROM B WHERE B.Id = MAIN.Id);
|
||||
ifcapable compound {
|
||||
do_test insert5-1.1 {
|
||||
execsql {
|
||||
INSERT INTO B
|
||||
SELECT * FROM B UNION ALL
|
||||
SELECT * FROM MAIN WHERE exists (select * FROM B WHERE B.Id = MAIN.Id);
|
||||
SELECT * FROM B;
|
||||
}
|
||||
} {2 3 2 3 2 3}
|
||||
}
|
||||
} {2 3 2 3 2 3}
|
||||
} else {
|
||||
do_test insert5-1.1 {
|
||||
execsql {
|
||||
INSERT INTO B SELECT * FROM B;
|
||||
INSERT INTO B
|
||||
SELECT * FROM MAIN WHERE exists (select * FROM B WHERE B.Id = MAIN.Id);
|
||||
SELECT * FROM B;
|
||||
}
|
||||
} {2 3 2 3 2 3}
|
||||
}
|
||||
do_test insert5-2.1 {
|
||||
uses_temp_table { INSERT INTO b SELECT * FROM main }
|
||||
} {0}
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing the SELECT statement.
|
||||
#
|
||||
# $Id: select1.test,v 1.64 2008/07/15 00:27:35 drh Exp $
|
||||
# $Id: select1.test,v 1.65 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -628,7 +628,7 @@ do_test select1-6.11 {
|
||||
} {1 {1st ORDER BY term does not match any column in the result set}}
|
||||
|
||||
# Ticket #2296
|
||||
ifcapable subquery {
|
||||
ifcapable subquery&&compound {
|
||||
do_test select1-6.20 {
|
||||
execsql {
|
||||
CREATE TABLE t6(a TEXT, b TEXT);
|
||||
|
||||
+3
-3
@@ -12,7 +12,7 @@
|
||||
# focus of this file is testing UNION, INTERSECT and EXCEPT operators
|
||||
# in SELECT statements.
|
||||
#
|
||||
# $Id: select4.test,v 1.28 2008/06/25 08:02:44 mihailim Exp $
|
||||
# $Id: select4.test,v 1.29 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -616,8 +616,6 @@ do_test select4-9.12 {
|
||||
} {a 1 b 2 a 3 b 4}
|
||||
} ;# ifcapable subquery
|
||||
|
||||
} ;# ifcapable compound
|
||||
|
||||
# Try combining DISTINCT, LIMIT, and OFFSET. Make sure they all work
|
||||
# together.
|
||||
#
|
||||
@@ -793,4 +791,6 @@ do_test select4-11.15 {
|
||||
}
|
||||
} {1 {SELECTs to the left and right of UNION do not have the same number of result columns}}
|
||||
|
||||
} ;# ifcapable compound
|
||||
|
||||
finish_test
|
||||
|
||||
+6
-1
@@ -17,11 +17,16 @@
|
||||
# explicit sort order and explicit collating secquites) and
|
||||
# with and without optional LIMIT and OFFSET clauses.
|
||||
#
|
||||
# $Id: selectA.test,v 1.4 2008/07/15 00:27:35 drh Exp $
|
||||
# $Id: selectA.test,v 1.5 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
ifcapable !compound {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
do_test selectA-1.0 {
|
||||
execsql {
|
||||
CREATE TABLE t1(a,b,c COLLATE NOCASE);
|
||||
|
||||
+6
-1
@@ -10,11 +10,16 @@
|
||||
#***********************************************************************
|
||||
# This file implements regression tests for SQLite library.
|
||||
#
|
||||
# $Id: selectB.test,v 1.8 2008/07/12 14:52:20 drh Exp $
|
||||
# $Id: selectB.test,v 1.9 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
ifcapable !compound {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
proc test_transform {testname sql1 sql2 results} {
|
||||
set ::vdbe1 [list]
|
||||
set ::vdbe2 [list]
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# Test the btree mutex protocol for shared cache mode.
|
||||
#
|
||||
# $Id: shared4.test,v 1.1 2008/07/14 19:39:17 drh Exp $
|
||||
# $Id: shared4.test,v 1.2 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -21,7 +21,7 @@ puts hello
|
||||
# This script is only valid if we are running shared-cache mode in a
|
||||
# threadsafe-capable database engine.
|
||||
#
|
||||
ifcapable !shared_cache {
|
||||
ifcapable !shared_cache||!compound {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# older versions of SQLite that behavior was implemented
|
||||
# incorrectly and resulted in corrupt database files.
|
||||
#
|
||||
# $Id: sidedelete.test,v 1.1 2007/12/12 22:24:13 drh Exp $
|
||||
# $Id: sidedelete.test,v 1.2 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
@@ -47,7 +47,8 @@ do_test sidedelete-2.0 {
|
||||
execsql {
|
||||
CREATE TABLE t1(a PRIMARY KEY, b);
|
||||
CREATE TABLE chng(a PRIMARY KEY, b);
|
||||
SELECT count(*) FROM t1 UNION ALL SELECT count(*) FROM chng;
|
||||
SELECT count(*) FROM t1;
|
||||
SELECT count(*) FROM chng;
|
||||
}
|
||||
} {0 0}
|
||||
for {set i 2} {$i<=100} {incr i} {
|
||||
|
||||
+9
-7
@@ -12,7 +12,7 @@
|
||||
# focus of this file is testing SELECT statements that are part of
|
||||
# expressions.
|
||||
#
|
||||
# $Id: subselect.test,v 1.15 2008/07/15 00:27:35 drh Exp $
|
||||
# $Id: subselect.test,v 1.16 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -56,12 +56,14 @@ do_test subselect-1.3c {
|
||||
do_test subselect-1.3d {
|
||||
execsql {SELECT b from t1 where a = (SELECT a FROM t1 WHERE b=8)}
|
||||
} {}
|
||||
do_test subselect-1.3e {
|
||||
execsql {
|
||||
SELECT b FROM t1
|
||||
WHERE a = (SELECT a FROM t1 UNION SELECT b FROM t1 ORDER BY 1);
|
||||
}
|
||||
} {2}
|
||||
ifcapable compound {
|
||||
do_test subselect-1.3e {
|
||||
execsql {
|
||||
SELECT b FROM t1
|
||||
WHERE a = (SELECT a FROM t1 UNION SELECT b FROM t1 ORDER BY 1);
|
||||
}
|
||||
} {2}
|
||||
}
|
||||
|
||||
# What if the subselect doesn't return any value. We should get
|
||||
# NULL as the result. Check it out.
|
||||
|
||||
+3
-3
@@ -14,17 +14,17 @@
|
||||
# fixed.
|
||||
#
|
||||
#
|
||||
# $Id: tkt2192.test,v 1.2 2007/09/12 17:01:45 danielk1977 Exp $
|
||||
# $Id: tkt2192.test,v 1.3 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
ifcapable !datetime {
|
||||
ifcapable !datetime||!compound {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
do_test tkt2191-1.1 {
|
||||
do_test tkt2192-1.1 {
|
||||
execsql {
|
||||
-- Raw data (RBS) --------
|
||||
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# This file is to test that ticket #2640 has been fixed.
|
||||
#
|
||||
# $Id: tkt2640.test,v 1.2 2007/12/10 05:03:48 danielk1977 Exp $
|
||||
# $Id: tkt2640.test,v 1.3 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
#
|
||||
|
||||
# The problem in ticket #2640 was that the query optimizer was
|
||||
@@ -28,7 +28,7 @@
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
ifcapable !subquery {
|
||||
ifcapable !subquery||!compound {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
+6
-1
@@ -13,12 +13,17 @@
|
||||
# ORDER BY clauses on compound SELECT statements raised by ticket
|
||||
# #2822 have been dealt with.
|
||||
#
|
||||
# $Id: tkt2822.test,v 1.4 2007/12/13 17:50:23 drh Exp $
|
||||
# $Id: tkt2822.test,v 1.5 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
ifcapable !compound {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
# The ORDER BY matching algorithm is three steps:
|
||||
#
|
||||
# (1) If the ORDER BY term is an integer constant i, then
|
||||
|
||||
+6
-1
@@ -11,12 +11,17 @@
|
||||
#
|
||||
# This file is to test that ticket #2927 is fixed.
|
||||
#
|
||||
# $Id: tkt2927.test,v 1.3 2008/07/12 14:52:21 drh Exp $
|
||||
# $Id: tkt2927.test,v 1.4 2008/08/04 03:51:24 danielk1977 Exp $
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
ifcapable !compound {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
# Create a database.
|
||||
#
|
||||
do_test tkt2927-1.1 {
|
||||
|
||||
+30
-27
@@ -189,32 +189,35 @@ do_test trigger9-3.4 {
|
||||
ROLLBACK;
|
||||
}
|
||||
} {1 2 3 3}
|
||||
do_test trigger9-3.5 {
|
||||
execsql {
|
||||
BEGIN;
|
||||
INSERT INTO t3 VALUES(1, 'uno');
|
||||
CREATE VIEW v1 AS SELECT a, b FROM t3 EXCEPT SELECT 1, 'one';
|
||||
CREATE TRIGGER trig1 INSTEAD OF UPDATE ON v1 BEGIN
|
||||
INSERT INTO t2 VALUES(old.a);
|
||||
END;
|
||||
UPDATE v1 SET b = 'hello';
|
||||
SELECT * FROM t2;
|
||||
ROLLBACK;
|
||||
}
|
||||
} {1 2 3}
|
||||
do_test trigger9-3.6 {
|
||||
execsql {
|
||||
BEGIN;
|
||||
INSERT INTO t3 VALUES(1, 'zero');
|
||||
CREATE VIEW v1 AS
|
||||
SELECT sum(a) AS a, max(b) AS b FROM t3 GROUP BY t3.a HAVING b>'two';
|
||||
CREATE TRIGGER trig1 INSTEAD OF UPDATE ON v1 BEGIN
|
||||
INSERT INTO t2 VALUES(old.a);
|
||||
END;
|
||||
UPDATE v1 SET b = 'hello';
|
||||
SELECT * FROM t2;
|
||||
ROLLBACK;
|
||||
}
|
||||
} {2}
|
||||
|
||||
ifcapable compound {
|
||||
do_test trigger9-3.5 {
|
||||
execsql {
|
||||
BEGIN;
|
||||
INSERT INTO t3 VALUES(1, 'uno');
|
||||
CREATE VIEW v1 AS SELECT a, b FROM t3 EXCEPT SELECT 1, 'one';
|
||||
CREATE TRIGGER trig1 INSTEAD OF UPDATE ON v1 BEGIN
|
||||
INSERT INTO t2 VALUES(old.a);
|
||||
END;
|
||||
UPDATE v1 SET b = 'hello';
|
||||
SELECT * FROM t2;
|
||||
ROLLBACK;
|
||||
}
|
||||
} {1 2 3}
|
||||
do_test trigger9-3.6 {
|
||||
execsql {
|
||||
BEGIN;
|
||||
INSERT INTO t3 VALUES(1, 'zero');
|
||||
CREATE VIEW v1 AS
|
||||
SELECT sum(a) AS a, max(b) AS b FROM t3 GROUP BY t3.a HAVING b>'two';
|
||||
CREATE TRIGGER trig1 INSTEAD OF UPDATE ON v1 BEGIN
|
||||
INSERT INTO t2 VALUES(old.a);
|
||||
END;
|
||||
UPDATE v1 SET b = 'hello';
|
||||
SELECT * FROM t2;
|
||||
ROLLBACK;
|
||||
}
|
||||
} {2}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
ifcapable {!trigger} {
|
||||
ifcapable !trigger||!compound {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user