aboutsummaryrefslogtreecommitdiff
path: root/src/insert.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2017-08-01 19:53:43 +0000
committerdrh <drh@noemail.net>2017-08-01 19:53:43 +0000
commit86b40dfd33fd58dd92be682365fa28b4a5f8b31a (patch)
treedc907ac6f2a51f331ffa1faf46ab35c5c434493f /src/insert.c
parentb7673ede37708db59ada16666f679b27fae84c5b (diff)
downloadsqlite-86b40dfd33fd58dd92be682365fa28b4a5f8b31a.tar.gz
sqlite-86b40dfd33fd58dd92be682365fa28b4a5f8b31a.zip
Split the OP_Last opcode into OP_Last and OP_SeekEnd. Use OP_SeekEnd to
position a cursor prior to appending. Ticket [cb91bf4290c211d]. FossilOrigin-Name: 3e02474c7bbe16891a7cfc8771cf72f64cd2c0692779037982d7d307512a4f23
Diffstat (limited to 'src/insert.c')
-rw-r--r--src/insert.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/insert.c b/src/insert.c
index d51e64b8f..f8e9095ea 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -2180,7 +2180,7 @@ static int xferOptimization(
}
sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1);
if( db->mDbFlags & DBFLAG_Vacuum ){
- sqlite3VdbeAddOp3(v, OP_Last, iDest, 0, -1);
+ sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest);
insFlags = OPFLAG_NCHANGE|OPFLAG_LASTROWID|
OPFLAG_APPEND|OPFLAG_USESEEKRESULT;
}else{
@@ -2217,7 +2217,7 @@ static int xferOptimization(
** collation sequence BINARY, then it can also be assumed that the
** index will be populated by inserting keys in strictly sorted
** order. In this case, instead of seeking within the b-tree as part
- ** of every OP_IdxInsert opcode, an OP_Last is added before the
+ ** of every OP_IdxInsert opcode, an OP_SeekEnd is added before the
** OP_IdxInsert to seek to the point within the b-tree where each key
** should be inserted. This is faster.
**
@@ -2232,7 +2232,7 @@ static int xferOptimization(
}
if( i==pSrcIdx->nColumn ){
idxInsFlags = OPFLAG_USESEEKRESULT;
- sqlite3VdbeAddOp3(v, OP_Last, iDest, 0, -1);
+ sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest);
}
}
if( !HasRowid(pSrc) && pDestIdx->idxType==2 ){