/ Check-in [279c48f6]
Login

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

Overview
Comment:Fix a VDBE comment on upsert. Provide an error message when upsert detects index corruption.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 279c48f6061f766f5437edd6964c0dd1e10399314eb17b6e5ee34df925a776ed
User & Date: drh 2018-04-20 18:01:31
Context
2018-04-20
19:32
Avoid opening a statement journal on single-row UPDATEs without triggers or FK constraints. check-in: 2772404b user: drh tags: trunk
18:01
Fix a VDBE comment on upsert. Provide an error message when upsert detects index corruption. check-in: 279c48f6 user: drh tags: trunk
17:50
Add tests for name resolution in ON CONFLICT clauses. check-in: cf253584 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/upsert.c.

   222    222         int i;
   223    223         pParse->nMem += nPk;
   224    224         for(i=0; i<nPk; i++){
   225    225           int k;
   226    226           assert( pPk->aiColumn[i]>=0 );
   227    227           k = sqlite3ColumnOfIndex(pIdx, pPk->aiColumn[i]);
   228    228           sqlite3VdbeAddOp3(v, OP_Column, iCur, k, iPk+i);
   229         -        VdbeComment((v, "%s.%s", pIdx->zName, pTab->aCol[i].zName));
          229  +        VdbeComment((v, "%s.%s", pIdx->zName,
          230  +                    pTab->aCol[pPk->aiColumn[i]].zName));
   230    231         }
   231    232         i = sqlite3VdbeAddOp4Int(v, OP_Found, iDataCur, 0, iPk, nPk);
   232    233         VdbeCoverage(v);
   233         -      sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_CORRUPT, OE_Abort);
          234  +      sqlite3VdbeAddOp4(v, OP_Halt, SQLITE_CORRUPT, OE_Abort, 0, 
          235  +            "corrupt database", P4_STATIC);
   234    236         sqlite3VdbeJumpHere(v, i);
   235    237       }
   236    238     }
   237    239     /* pUpsert does not own pUpsertSrc - the outer INSERT statement does.  So
   238    240     ** we have to make a copy before passing it down into sqlite3Update() */
   239    241     pSrc = sqlite3SrcListDup(db, pUpsert->pUpsertSrc, 0);
   240    242     sqlite3Update(pParse, pSrc, pUpsert->pUpsertSet,