mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Add the SQLITE_OMIT_TEMPDB compile time macro. (CVS 2427)
FossilOrigin-Name: c41d55443c2dd532147962b87f542fb7d37075fd
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
# focus of this script is testing the ATTACH and DETACH commands
|
||||
# and related functionality.
|
||||
#
|
||||
# $Id: attach.test,v 1.39 2005/03/15 02:04:13 drh Exp $
|
||||
# $Id: attach.test,v 1.40 2005/03/29 03:11:00 danielk1977 Exp $
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
@ -127,11 +127,13 @@ do_test attach-1.15 {
|
||||
ATTACH 'test.db' as main;
|
||||
}
|
||||
} {1 {database main is already in use}}
|
||||
do_test attach-1.16 {
|
||||
catchsql {
|
||||
ATTACH 'test.db' as temp;
|
||||
}
|
||||
} {1 {database temp is already in use}}
|
||||
ifcapable tempdb {
|
||||
do_test attach-1.16 {
|
||||
catchsql {
|
||||
ATTACH 'test.db' as temp;
|
||||
}
|
||||
} {1 {database temp is already in use}}
|
||||
}
|
||||
do_test attach-1.17 {
|
||||
catchsql {
|
||||
ATTACH 'test.db' as MAIN;
|
||||
@ -159,7 +161,9 @@ do_test attach-1.20.2 {
|
||||
} {0 main 2 db2 3 db3 4 db4 5 db6 6 db7 7 db8 8 db9 9 db10 10 db11}
|
||||
} ;# ifcapable schema_pragmas
|
||||
integrity_check attach-1.20.3
|
||||
execsql {select * from sqlite_temp_master}
|
||||
ifcapable tempdb {
|
||||
execsql {select * from sqlite_temp_master}
|
||||
}
|
||||
do_test attach-1.21 {
|
||||
catchsql {
|
||||
ATTACH 'test.db' as db12;
|
||||
@ -190,11 +194,21 @@ do_test attach-1.26 {
|
||||
DETACH main;
|
||||
}
|
||||
} {1 {cannot detach database main}}
|
||||
do_test attach-1.27 {
|
||||
catchsql {
|
||||
DETACH Temp;
|
||||
}
|
||||
} {1 {cannot detach database Temp}}
|
||||
|
||||
ifcapable tempdb {
|
||||
do_test attach-1.27 {
|
||||
catchsql {
|
||||
DETACH Temp;
|
||||
}
|
||||
} {1 {cannot detach database Temp}}
|
||||
} else {
|
||||
do_test attach-1.27 {
|
||||
catchsql {
|
||||
DETACH Temp;
|
||||
}
|
||||
} {1 {no such database: Temp}}
|
||||
}
|
||||
|
||||
do_test attach-1.28 {
|
||||
catchsql {
|
||||
DETACH db11;
|
||||
@ -209,9 +223,15 @@ do_test attach-1.28 {
|
||||
}
|
||||
} {0 {}}
|
||||
ifcapable schema_pragmas {
|
||||
do_test attach-1.29 {
|
||||
db_list db
|
||||
} {0 main 1 temp}
|
||||
ifcapable tempdb {
|
||||
do_test attach-1.29 {
|
||||
db_list db
|
||||
} {0 main 1 temp}
|
||||
} else {
|
||||
do_test attach-1.29 {
|
||||
db_list db
|
||||
} {0 main}
|
||||
}
|
||||
} ;# ifcapable schema_pragmas
|
||||
|
||||
ifcapable {trigger} { # Only do the following tests if triggers are enabled
|
||||
@ -257,11 +277,18 @@ do_test attach-2.7 {
|
||||
SELECT type, name, tbl_name FROM db2.sqlite_master;
|
||||
}
|
||||
} {table t2 t2 table tx tx trigger r1 t2}
|
||||
ifcapable schema_pragmas {
|
||||
do_test attach-2.8 {
|
||||
db_list db
|
||||
} {0 main 1 temp 2 db2}
|
||||
} ;# ifcapable schema_pragmas
|
||||
|
||||
ifcapable schema_pragmas&&tempdb {
|
||||
do_test attach-2.8 {
|
||||
db_list db
|
||||
} {0 main 1 temp 2 db2}
|
||||
} ;# ifcapable schema_pragmas&&tempdb
|
||||
ifcapable schema_pragmas&&!tempdb {
|
||||
do_test attach-2.8 {
|
||||
db_list db
|
||||
} {0 main 2 db2}
|
||||
} ;# ifcapable schema_pragmas&&!tempdb
|
||||
|
||||
do_test attach-2.9 {
|
||||
execsql {
|
||||
CREATE INDEX i2 ON t2(x);
|
||||
@ -279,9 +306,15 @@ do_test attach-2.10 {
|
||||
# }
|
||||
#} {1 {database schema has changed}}
|
||||
ifcapable schema_pragmas {
|
||||
do_test attach-2.12 {
|
||||
db_list db
|
||||
} {0 main 1 temp 2 db2}
|
||||
ifcapable tempdb {
|
||||
do_test attach-2.12 {
|
||||
db_list db
|
||||
} {0 main 1 temp 2 db2}
|
||||
} else {
|
||||
do_test attach-2.12 {
|
||||
db_list db
|
||||
} {0 main 2 db2}
|
||||
}
|
||||
} ;# ifcapable schema_pragmas
|
||||
do_test attach-2.13 {
|
||||
catchsql {
|
||||
@ -606,14 +639,16 @@ do_test attach-5.3 {
|
||||
END;
|
||||
} db2
|
||||
} {1 {trigger r5 cannot reference objects in database orig}}
|
||||
do_test attach-5.4 {
|
||||
catchsql {
|
||||
CREATE TEMP TABLE t6(p,q,r);
|
||||
CREATE TRIGGER r5 AFTER INSERT ON t5 BEGIN
|
||||
SELECT 'no-op' FROM temp.t6;
|
||||
END;
|
||||
} db2
|
||||
} {1 {trigger r5 cannot reference objects in database temp}}
|
||||
ifcapable tempdb {
|
||||
do_test attach-5.4 {
|
||||
catchsql {
|
||||
CREATE TEMP TABLE t6(p,q,r);
|
||||
CREATE TRIGGER r5 AFTER INSERT ON t5 BEGIN
|
||||
SELECT 'no-op' FROM temp.t6;
|
||||
END;
|
||||
} db2
|
||||
} {1 {trigger r5 cannot reference objects in database temp}}
|
||||
}
|
||||
ifcapable subquery {
|
||||
do_test attach-5.5 {
|
||||
catchsql {
|
||||
|
Reference in New Issue
Block a user