More bugs fixed for views. (CVS 416)

FossilOrigin-Name: 813077623087ffc6cd506f57cf6d1e3d9239f806
This commit is contained in:
drh
2002-03-03 23:06:00 +00:00
parent 417be79cd1
commit 4ff6dfa7de
8 changed files with 99 additions and 34 deletions
+37 -1
View File
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing VIEW statements.
#
# $Id: view.test,v 1.2 2002/03/03 18:59:41 drh Exp $
# $Id: view.test,v 1.3 2002/03/03 23:06:02 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -86,5 +86,41 @@ do_test view-1.8 {
}
} {2 3 5 6 8 9}
do_test view-2.1 {
execsql {
CREATE VIEW v2 AS SELECT * FROM t1 WHERE a>5
}; # No semicolon
execsql2 {
SELECT * FROM v2;
}
} {x 7 a 8 b 9 c 10}
do_test view-2.2 {
catchsql {
INSERT INTO v2 VALUES(1,2,3,4);
}
} {1 {view v2 may not be modified}}
do_test view-2.3 {
catchsql {
UPDATE v2 SET a=10 WHERE a=5;
}
} {1 {view v2 may not be modified}}
do_test view-2.4 {
catchsql {
DELETE FROM v2;
}
} {1 {view v2 may not be modified}}
do_test view-2.5 {
execsql {
INSERT INTO t1 VALUES(11,12,13,14);
SELECT * FROM v2 ORDER BY x;
}
} {7 8 9 10 11 12 13 14}
do_test view-2.6 {
execsql {
SELECT x FROM v2 WHERE a>10
}
} {11}
finish_test