/ Check-in [131ed95e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improved VDBE comment on UPSERT code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | upsert-opt2
Files: files | file ages | folders
SHA3-256: 131ed95e1452a5b0d92341c48a5d3915b328ccfce2cf605f702428ae7ee3e21b
User & Date: drh 2018-04-20 16:49:51
Context
2018-04-20
17:02
Avoid unnecessary cursor seeking when performing an UPSERT. check-in: 693a3dcb user: drh tags: trunk
16:49
Improved VDBE comment on UPSERT code. Closed-Leaf check-in: 131ed95e user: drh tags: upsert-opt2
16:27
Minor simplification of the previous checkin. check-in: d1906689 user: drh tags: upsert-opt2
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to src/upsert.c.

222
223
224
225
226
227
228

229
230
231
232
233
234
235
      int i;
      pParse->nMem += nPk;
      for(i=0; i<nPk; i++){
        int k;
        assert( pPk->aiColumn[i]>=0 );
        k = sqlite3ColumnOfIndex(pIdx, pPk->aiColumn[i]);
        sqlite3VdbeAddOp3(v, OP_Column, iCur, k, iPk+i);

      }
      i = sqlite3VdbeAddOp4Int(v, OP_Found, iDataCur, 0, iPk, nPk);
      VdbeCoverage(v);
      sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_CORRUPT, OE_Abort);
      sqlite3VdbeJumpHere(v, i);
    }
  }







>







222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
      int i;
      pParse->nMem += nPk;
      for(i=0; i<nPk; i++){
        int k;
        assert( pPk->aiColumn[i]>=0 );
        k = sqlite3ColumnOfIndex(pIdx, pPk->aiColumn[i]);
        sqlite3VdbeAddOp3(v, OP_Column, iCur, k, iPk+i);
        VdbeComment((v, "%s.%s", pIdx->zName, pTab->aCol[i].zName));
      }
      i = sqlite3VdbeAddOp4Int(v, OP_Found, iDataCur, 0, iPk, nPk);
      VdbeCoverage(v);
      sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_CORRUPT, OE_Abort);
      sqlite3VdbeJumpHere(v, i);
    }
  }