/ Check-in [d70c7881]
Login

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

Overview
Comment:Minor optimization to the OP_Halt opcode.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | omit-rowid
Files: files | file ages | folders
SHA1:d70c78814ba565a44628eab61a3a0a5dba56269a
User & Date: drh 2013-11-06 14:05:21
Context
2013-11-06
14:36
Allocate extra stack space for UnpackedRecord objects, reducing the need to malloc for them as often, and thereby get a performance improvement. check-in: a725a75f user: drh tags: omit-rowid
14:05
Minor optimization to the OP_Halt opcode. check-in: d70c7881 user: drh tags: omit-rowid
12:56
Improved ORDER BY optimization for WITHOUT ROWID tables. check-in: 8f1709ff user: drh tags: omit-rowid
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

   868    868         ** as the p2 of the calling OP_Program.  */
   869    869         pc = p->aOp[pc].p2-1;
   870    870       }
   871    871       aOp = p->aOp;
   872    872       aMem = p->aMem;
   873    873       break;
   874    874     }
   875         -  if( pOp->p5 ){
   876         -    static const char * const azType[] = { "NOT NULL", "UNIQUE", "CHECK",
   877         -                                           "FOREIGN KEY" };
   878         -    assert( pOp->p5>=1 && pOp->p5<=4 );
   879         -    testcase( pOp->p5==1 );
   880         -    testcase( pOp->p5==2 );
   881         -    testcase( pOp->p5==3 );
   882         -    testcase( pOp->p5==4 );
   883         -    zType = azType[pOp->p5-1];
   884         -  }else{
   885         -    zType = 0;
   886         -  }
   887    875     p->rc = pOp->p1;
   888    876     p->errorAction = (u8)pOp->p2;
   889    877     p->pc = pc;
   890    878     if( p->rc ){
          879  +    if( pOp->p5 ){
          880  +      static const char * const azType[] = { "NOT NULL", "UNIQUE", "CHECK",
          881  +                                             "FOREIGN KEY" };
          882  +      assert( pOp->p5>=1 && pOp->p5<=4 );
          883  +      testcase( pOp->p5==1 );
          884  +      testcase( pOp->p5==2 );
          885  +      testcase( pOp->p5==3 );
          886  +      testcase( pOp->p5==4 );
          887  +      zType = azType[pOp->p5-1];
          888  +    }else{
          889  +      zType = 0;
          890  +    }
   891    891       zLogFmt = "abort at %d in [%s]: %s";
   892    892       if( zType && pOp->p4.z ){
   893    893         sqlite3SetString(&p->zErrMsg, db, "%s constraint failed: %s", 
   894    894                          zType, pOp->p4.z);
   895    895       }else if( pOp->p4.z ){
   896    896         sqlite3SetString(&p->zErrMsg, db, "%s", pOp->p4.z);
   897    897       }else if( zType ){