1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Allow ATTACH and DETACH inside of a transaction.

FossilOrigin-Name: 95e8f31658254dd2df3eeaae337aff0fe2125d170ae966c74f4fc70400e099b1
This commit is contained in:
drh
2017-08-01 00:20:34 +00:00
5 changed files with 21 additions and 29 deletions

View File

@@ -93,10 +93,6 @@ static void attachFunc(
);
goto attach_error;
}
if( !db->autoCommit ){
zErrDyn = sqlite3MPrintf(db, "cannot ATTACH database within transaction");
goto attach_error;
}
for(i=0; i<db->nDb; i++){
char *z = db->aDb[i].zDbSName;
assert( z && zName );
@@ -288,11 +284,6 @@ static void detachFunc(
sqlite3_snprintf(sizeof(zErr),zErr, "cannot detach database %s", zName);
goto detach_error;
}
if( !db->autoCommit ){
sqlite3_snprintf(sizeof(zErr), zErr,
"cannot DETACH database within transaction");
goto detach_error;
}
if( sqlite3BtreeIsInReadTrans(pDb->pBt) || sqlite3BtreeIsInBackup(pDb->pBt) ){
sqlite3_snprintf(sizeof(zErr),zErr, "database %s is locked", zName);
goto detach_error;