aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-11-18 20:49:30 +0000
committerdrh <drh@noemail.net>2014-11-18 20:49:30 +0000
commit64b600ff13d4bac1d459cf54b649b45e520aba4c (patch)
treeb9d2242eea593c2834786c15c31d87cbb80dfdf0 /src
parentbea3b976a95b00968d6f3ca496d5c1dfd3104527 (diff)
parentbb8f92529401b09dbc6e9df4ba3e38ae3a0789f3 (diff)
downloadsqlite-64b600ff13d4bac1d459cf54b649b45e520aba4c.tar.gz
sqlite-64b600ff13d4bac1d459cf54b649b45e520aba4c.zip
Merge in all the other ROLLBACK fixes from the branch-3.8.7 branch.
I don't know why I was doing them one-by-one. FossilOrigin-Name: 296b0c7397790ceadbdb330959e962f6491abc3e
Diffstat (limited to 'src')
-rw-r--r--src/btree.c10
-rw-r--r--src/btreeInt.h10
-rw-r--r--src/vdbe.c3
3 files changed, 13 insertions, 10 deletions
diff --git a/src/btree.c b/src/btree.c
index 7a49fb1a7..9587e567a 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -3925,13 +3925,9 @@ int sqlite3BtreeCursorIsValid(BtCursor *pCur){
*/
int sqlite3BtreeKeySize(BtCursor *pCur, i64 *pSize){
assert( cursorHoldsMutex(pCur) );
- assert( pCur->eState==CURSOR_INVALID || pCur->eState==CURSOR_VALID );
- if( pCur->eState!=CURSOR_VALID ){
- *pSize = 0;
- }else{
- getCellInfo(pCur);
- *pSize = pCur->info.nKey;
- }
+ assert( pCur->eState==CURSOR_VALID );
+ getCellInfo(pCur);
+ *pSize = pCur->info.nKey;
return SQLITE_OK;
}
diff --git a/src/btreeInt.h b/src/btreeInt.h
index 2368e6c88..a28a6a297 100644
--- a/src/btreeInt.h
+++ b/src/btreeInt.h
@@ -489,6 +489,11 @@ struct CellInfo {
**
** Fields in this structure are accessed under the BtShared.mutex
** found at self->pBt->mutex.
+**
+** skipNext meaning:
+** eState==SKIPNEXT && skipNext>0: Next sqlite3BtreeNext() is no-op.
+** eState==SKIPNEXT && skipNext<0: Next sqlite3BtreePrevious() is no-op.
+** eState==FAULT: Cursor fault with skipNext as error code.
*/
struct BtCursor {
Btree *pBtree; /* The Btree to which this cursor belongs */
@@ -501,7 +506,8 @@ struct BtCursor {
void *pKey; /* Saved key that was cursor last known position */
Pgno pgnoRoot; /* The root page of this tree */
int nOvflAlloc; /* Allocated size of aOverflow[] array */
- int skipNext; /* Prev() is noop if negative. Next() is noop if positive */
+ int skipNext; /* Prev() is noop if negative. Next() is noop if positive.
+ ** Error code if eState==CURSOR_FAULT */
u8 curFlags; /* zero or more BTCF_* flags defined below */
u8 eState; /* One of the CURSOR_XXX constants (see below) */
u8 hints; /* As configured by CursorSetHints() */
@@ -547,7 +553,7 @@ struct BtCursor {
** on a different connection that shares the BtShared cache with this
** cursor. The error has left the cache in an inconsistent state.
** Do nothing else with this cursor. Any attempt to use the cursor
-** should return the error code stored in BtCursor.skip
+** should return the error code stored in BtCursor.skipNext
*/
#define CURSOR_INVALID 0
#define CURSOR_VALID 1
diff --git a/src/vdbe.c b/src/vdbe.c
index 78c5511e5..f88341294 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -2830,7 +2830,8 @@ case OP_Savepoint: {
if( p1==SAVEPOINT_ROLLBACK ){
isSchemaChange = (db->flags & SQLITE_InternChanges)!=0;
for(ii=0; ii<db->nDb; ii++){
- rc = sqlite3BtreeTripAllCursors(db->aDb[ii].pBt, SQLITE_ABORT,
+ rc = sqlite3BtreeTripAllCursors(db->aDb[ii].pBt,
+ SQLITE_ABORT_ROLLBACK,
isSchemaChange==0);
if( rc!=SQLITE_OK ) goto abort_due_to_error;
}