diff options
Diffstat (limited to 'src/vdbe.c')
-rw-r--r-- | src/vdbe.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index 68762ae5e..26336d940 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -2349,19 +2349,23 @@ case OP_IfNullRow: { /* jump */ break; } -/* Opcode: Location P1 P2 P3 * * -** Synopsis: r[P3] = location(P1) +#ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC +/* Opcode: Offset P1 P2 P3 * * +** Synopsis: r[P3] = sqlite_offset(P1) ** -** Store in register r[P3] the location in the database file that is the +** Store in register r[P3] the byte offset into the database file that is the ** start of the payload for the record at which that cursor P1 is currently ** pointing. ** -** P2 is the column number for the argument to the location() function. +** P2 is the column number for the argument to the sqlite_offset() function. ** This opcode does not use P2 itself, but the P2 value is used by the ** code generator. The P1, P2, and P3 operands to this opcode are the ** as as for OP_Column. +** +** This opcode is only available if SQLite is compiled with the +** -DSQLITE_ENABLE_OFFSET_SQL_FUNC option. */ -case OP_Location: { /* out3 */ +case OP_Offset: { /* out3 */ VdbeCursor *pC; /* The VDBE cursor */ assert( pOp->p1>=0 && pOp->p1<p->nCursor ); pC = p->apCsr[pOp->p1]; @@ -2369,10 +2373,11 @@ case OP_Location: { /* out3 */ if( pC==0 || pC->eCurType!=CURTYPE_BTREE ){ sqlite3VdbeMemSetNull(pOut); }else{ - sqlite3VdbeMemSetInt64(pOut, sqlite3BtreeLocation(pC->uc.pCursor)); + sqlite3VdbeMemSetInt64(pOut, sqlite3BtreeOffset(pC->uc.pCursor)); } break; } +#endif /* SQLITE_ENABLE_OFFSET_SQL_FUNC */ /* Opcode: Column P1 P2 P3 P4 P5 ** Synopsis: r[P3]=PX |