Small performance optimization in sqlite3VdbeHalt().

FossilOrigin-Name: 9e1ecf438cb01d3d76950bcce1b3e4df29bedbb8176c8cede27e66f8e53e2098
This commit is contained in:
drh
2021-11-15 18:50:02 +00:00
parent 8745f8a3c3
commit 3ce76a0bbb
3 changed files with 17 additions and 11 deletions
+9 -3
View File
@@ -3056,9 +3056,15 @@ int sqlite3VdbeHalt(Vdbe *p){
sqlite3VdbeEnter(p);
/* Check for one of the special errors */
mrc = p->rc & 0xff;
isSpecialError = mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR
|| mrc==SQLITE_INTERRUPT || mrc==SQLITE_FULL;
if( p->rc ){
mrc = p->rc & 0xff;
isSpecialError = mrc==SQLITE_NOMEM
|| mrc==SQLITE_IOERR
|| mrc==SQLITE_INTERRUPT
|| mrc==SQLITE_FULL;
}else{
mrc = isSpecialError = 0;
}
if( isSpecialError ){
/* If the query was read-only and the error code is SQLITE_INTERRUPT,
** no rollback is necessary. Otherwise, at least a savepoint