aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vdbe.c1
-rw-r--r--src/vdbeaux.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/vdbe.c b/src/vdbe.c
index b28976987..3476c02da 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -3604,7 +3604,6 @@ case OP_AutoCommit: {
sqlite3CloseSavepoints(db);
if( p->rc==SQLITE_OK ){
rc = SQLITE_DONE;
- if( db->autoCommit ) db->flags &= ~SQLITE_CorruptRdOnly;
}else{
rc = SQLITE_ERROR;
}
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index 4005b1eb1..f03196bff 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -3116,6 +3116,9 @@ int sqlite3VdbeHalt(Vdbe *p){
return SQLITE_ERROR;
}
rc = SQLITE_CONSTRAINT_FOREIGNKEY;
+ }else if( db->flags & SQLITE_CorruptRdOnly ){
+ rc = SQLITE_CORRUPT;
+ db->flags &= ~SQLITE_CorruptRdOnly;
}else{
/* The auto-commit flag is true, the vdbe program was successful
** or hit an 'OR FAIL' constraint and there are no deferred foreign