1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Make sure ATTACH and DETACH fail if a transaction is active. (CVS 1633)

FossilOrigin-Name: c49d8bdc3e1172a283f7aaf208fbb9096acd5ab6
This commit is contained in:
danielk1977
2004-06-19 09:08:16 +00:00
parent f9d64d2c30
commit 92f9a1bbda
6 changed files with 52 additions and 17 deletions

View File

@ -12,7 +12,7 @@
# focus of this script is testing the ATTACH and DETACH commands
# and related functionality.
#
# $Id: attach2.test,v 1.19 2004/06/19 00:16:31 drh Exp $
# $Id: attach2.test,v 1.20 2004/06/19 09:08:16 danielk1977 Exp $
#
set testdir [file dirname $argv0]
@ -339,6 +339,30 @@ do_test attach2-5.5 {
glob test.db*
} {test.db test.db2}
# Check that a database cannot be ATTACHed or DETACHed during a transaction.
do_test attach2-6.1 {
execsql {
BEGIN;
}
} {}
do_test attach2-6.2 {
catchsql {
ATTACH 'test3.db' as aux2;
}
} {1 {cannot ATTACH database within transaction}}
do_test attach2-6.3 {
catchsql {
DETACH aux;
}
} {1 {cannot DETACH database within transaction}}
do_test attach2-6.4 {
execsql {
COMMIT;
DETACH aux;
}
} {}
db close
finish_test