diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/insert.c | 2 | ||||
-rw-r--r-- | src/vdbe.c | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/insert.c b/src/insert.c index 0cf670e6c..9274b0771 100644 --- a/src/insert.c +++ b/src/insert.c @@ -1422,7 +1422,7 @@ void sqlite3GenerateConstraintChecks( }else{ x = iField + regNewData + 1; } - sqlite3VdbeAddOp2(v, OP_SCopy, x, regIdx+i); + sqlite3VdbeAddOp2(v, iField<0 ? OP_IntCopy : OP_SCopy, x, regIdx+i); VdbeComment((v, "%s", iField<0 ? "rowid" : pTab->aCol[iField].zName)); } } diff --git a/src/vdbe.c b/src/vdbe.c index b2d62b7aa..980876c07 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -1273,6 +1273,22 @@ case OP_SCopy: { /* out2 */ break; } +/* Opcode: IntCopy P1 P2 * * * +** Synopsis: r[P2]=r[P1] +** +** Transfer the integer value held in register P1 into register P2. +** +** This is an optimized version of SCopy that works only for integer +** values. +*/ +case OP_IntCopy: { /* out2 */ + pIn1 = &aMem[pOp->p1]; + assert( (pIn1->flags & MEM_Int)!=0 ); + pOut = &aMem[pOp->p2]; + sqlite3VdbeMemSetInt64(pOut, pIn1->u.i); + break; +} + /* Opcode: ResultRow P1 P2 * * * ** Synopsis: output=r[P1@P2] ** |