aboutsummaryrefslogtreecommitdiff
path: root/src/vdbe.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2017-12-29 15:04:49 +0000
committerdrh <drh@noemail.net>2017-12-29 15:04:49 +0000
commit092457b18ce71b6b0f30ea8a67817310feffaebc (patch)
treee967666936f525c57f84a914d272dcdc22a9c031 /src/vdbe.c
parentfe6d20e9f4d17ad82fd4c4cc69181ad5f52d9d93 (diff)
downloadsqlite-092457b18ce71b6b0f30ea8a67817310feffaebc.tar.gz
sqlite-092457b18ce71b6b0f30ea8a67817310feffaebc.zip
Change the function name to sqlite_unsupported_offset(X). Only enable the
function if compiled with -DSQLITE_ENABLE_OFFSET_SQL_FUNC. The makefiles add that definition to shell builds. FossilOrigin-Name: 7a7f826e324b1a2c332e2f1d0740fd0babffcaca6275a798572f02ad367b99ab
Diffstat (limited to 'src/vdbe.c')
-rw-r--r--src/vdbe.c17
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