mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Allow CREATE and DROP VIEW on attached databases. (CVS 1485)
FossilOrigin-Name: ad879a957d93c0b49c289947826b451d3ea37e5b
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
# focus of this script is testing the ATTACH and DETACH commands
|
||||
# and schema changes to attached databases.
|
||||
#
|
||||
# $Id: attach3.test,v 1.2 2004/05/28 12:11:21 danielk1977 Exp $
|
||||
# $Id: attach3.test,v 1.3 2004/05/28 12:33:32 danielk1977 Exp $
|
||||
#
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ do_test attach4-3.3 {
|
||||
}
|
||||
} {}
|
||||
|
||||
# Drop the tables in the auxilary database.
|
||||
# Drop tables t1 and t2 in the auxilary database.
|
||||
do_test attach4-4.1 {
|
||||
execsql {
|
||||
DROP TABLE aux.t1;
|
||||
@ -122,10 +122,34 @@ do_test attach4-4.3 {
|
||||
SELECT name FROM aux.sqlite_master;
|
||||
}
|
||||
} {t3}
|
||||
do_test attach4-4.4 {
|
||||
|
||||
# Create a view in the auxilary database.
|
||||
do_test attach4-5.1 {
|
||||
execsql {
|
||||
DROP TABLE aux.t3;
|
||||
SELECT * FROM aux.sqlite_master;
|
||||
CREATE VIEW aux.v1 AS SELECT * FROM t3;
|
||||
}
|
||||
} {}
|
||||
do_test attach4-5.2 {
|
||||
execsql {
|
||||
SELECT * FROM aux.sqlite_master WHERE name = 'v1';
|
||||
}
|
||||
} {view v1 v1 0 {CREATE VIEW v1 AS SELECT * FROM t3}}
|
||||
do_test attach4-5.3 {
|
||||
execsql {
|
||||
INSERT INTO aux.t3 VALUES('hello', 'world');
|
||||
SELECT * FROM v1;
|
||||
}
|
||||
} {1 2 hello world}
|
||||
|
||||
# Drop the view
|
||||
do_test attach4-6.1 {
|
||||
execsql {
|
||||
DROP VIEW aux.v1;
|
||||
}
|
||||
} {}
|
||||
do_test attach4-5.2 {
|
||||
execsql {
|
||||
SELECT * FROM aux.sqlite_master WHERE name = 'v1';
|
||||
}
|
||||
} {}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing the CREATE INDEX statement.
|
||||
#
|
||||
# $Id: index.test,v 1.26 2004/05/16 22:55:28 danielk1977 Exp $
|
||||
# $Id: index.test,v 1.27 2004/05/28 12:33:32 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -51,7 +51,7 @@ do_test index-1.2 {
|
||||
do_test index-2.1 {
|
||||
set v [catch {execsql {CREATE INDEX index1 ON test1(f1)}} msg]
|
||||
lappend v $msg
|
||||
} {1 {no such table: test1}}
|
||||
} {1 {no such table: main.test1}}
|
||||
|
||||
# Try adding an index on a column of a table where the table
|
||||
# exists but the column does not.
|
||||
|
Reference in New Issue
Block a user