1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

This is an experimental patch that ensures that all cursors have their position

saved prior to starting a ROLLBACK TO.

FossilOrigin-Name: 01d97e5b6502b1811b52a681f445e1aaae6c0ee6
This commit is contained in:
drh
2017-02-02 00:46:55 +00:00
parent 6890d3e458
commit 2343c7eb3f
3 changed files with 17 additions and 10 deletions

View File

@@ -4038,7 +4038,12 @@ int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint){
assert( op==SAVEPOINT_RELEASE || op==SAVEPOINT_ROLLBACK );
assert( iSavepoint>=0 || (iSavepoint==-1 && op==SAVEPOINT_ROLLBACK) );
sqlite3BtreeEnter(p);
rc = sqlite3PagerSavepoint(pBt->pPager, op, iSavepoint);
if( op==SAVEPOINT_ROLLBACK ){
rc = saveAllCursors(pBt, 0, 0);
}
if( rc==SQLITE_OK ){
rc = sqlite3PagerSavepoint(pBt->pPager, op, iSavepoint);
}
if( rc==SQLITE_OK ){
if( iSavepoint<0 && (pBt->btsFlags & BTS_INITIALLY_EMPTY)!=0 ){
pBt->nPage = 0;