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

Minor optimization to the OP_Halt opcode.

FossilOrigin-Name: d70c78814ba565a44628eab61a3a0a5dba56269a
This commit is contained in:
drh
2013-11-06 14:05:21 +00:00
parent 416846a362
commit d9b7ec9348
3 changed files with 19 additions and 19 deletions

View File

@@ -872,22 +872,22 @@ case OP_Halt: {
aMem = p->aMem;
break;
}
if( pOp->p5 ){
static const char * const azType[] = { "NOT NULL", "UNIQUE", "CHECK",
"FOREIGN KEY" };
assert( pOp->p5>=1 && pOp->p5<=4 );
testcase( pOp->p5==1 );
testcase( pOp->p5==2 );
testcase( pOp->p5==3 );
testcase( pOp->p5==4 );
zType = azType[pOp->p5-1];
}else{
zType = 0;
}
p->rc = pOp->p1;
p->errorAction = (u8)pOp->p2;
p->pc = pc;
if( p->rc ){
if( pOp->p5 ){
static const char * const azType[] = { "NOT NULL", "UNIQUE", "CHECK",
"FOREIGN KEY" };
assert( pOp->p5>=1 && pOp->p5<=4 );
testcase( pOp->p5==1 );
testcase( pOp->p5==2 );
testcase( pOp->p5==3 );
testcase( pOp->p5==4 );
zType = azType[pOp->p5-1];
}else{
zType = 0;
}
zLogFmt = "abort at %d in [%s]: %s";
if( zType && pOp->p4.z ){
sqlite3SetString(&p->zErrMsg, db, "%s constraint failed: %s",