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

Add the new SQLITE_ABORT_ROLLBACK extended error code to be returned for

statements that are cancelled due to a rollback.

FossilOrigin-Name: 549f4fd00d8325c10099b100e5202b77ee1d83ad
This commit is contained in:
drh
2012-02-13 17:01:51 +00:00
parent 0f198a7409
commit 21021a5cbf
8 changed files with 35 additions and 29 deletions

View File

@@ -920,12 +920,21 @@ const char *sqlite3ErrStr(int rc){
/* SQLITE_RANGE */ "bind or column index out of range",
/* SQLITE_NOTADB */ "file is encrypted or is not a database",
};
rc &= 0xff;
if( ALWAYS(rc>=0) && rc<(int)(sizeof(aMsg)/sizeof(aMsg[0])) && aMsg[rc]!=0 ){
return aMsg[rc];
}else{
return "unknown error";
const char *zErr = "unknown error";
switch( rc ){
case SQLITE_ABORT_ROLLBACK: {
zErr = "abort due to ROLLBACK";
break;
}
default: {
rc &= 0xff;
if( ALWAYS(rc>=0) && rc<ArraySize(aMsg) && aMsg[rc]!=0 ){
zErr = aMsg[rc];
}
break;
}
}
return zErr;
}
/*