SQLite

Check-in [d70c78814b]
Login

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

Overview
Comment:Minor optimization to the OP_Halt opcode.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | omit-rowid
Files: files | file ages | folders
SHA1: d70c78814ba565a44628eab61a3a0a5dba56269a
User & Date: drh 2013-11-06 14:05:21.964
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: a725a75f87 user: drh tags: omit-rowid)
14:05
Minor optimization to the OP_Halt opcode. (check-in: d70c78814b user: drh tags: omit-rowid)
12:56
Improved ORDER BY optimization for WITHOUT ROWID tables. (check-in: 8f1709ff2d user: drh tags: omit-rowid)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbe.c.
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890












891
892
893
894
895
896
897
      ** as the p2 of the calling OP_Program.  */
      pc = p->aOp[pc].p2-1;
    }
    aOp = p->aOp;
    aMem = p->aMem;
    break;
  }
  if( pOp->p5 ){
    static const char * const azType[] = { "NOT NULL", "UNIQUE", "CHECK",
                                           "FOREIGN KEY" };
    assert( pOp->p5>=1 && pOp->p5<=4 );
    testcase( pOp->p5==1 );
    testcase( pOp->p5==2 );
    testcase( pOp->p5==3 );
    testcase( pOp->p5==4 );
    zType = azType[pOp->p5-1];
  }else{
    zType = 0;
  }
  p->rc = pOp->p1;
  p->errorAction = (u8)pOp->p2;
  p->pc = pc;
  if( p->rc ){












    zLogFmt = "abort at %d in [%s]: %s";
    if( zType && pOp->p4.z ){
      sqlite3SetString(&p->zErrMsg, db, "%s constraint failed: %s", 
                       zType, pOp->p4.z);
    }else if( pOp->p4.z ){
      sqlite3SetString(&p->zErrMsg, db, "%s", pOp->p4.z);
    }else if( zType ){







<
<
<
<
<
<
<
<
<
<
<
<




>
>
>
>
>
>
>
>
>
>
>
>







868
869
870
871
872
873
874












875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
      ** as the p2 of the calling OP_Program.  */
      pc = p->aOp[pc].p2-1;
    }
    aOp = p->aOp;
    aMem = p->aMem;
    break;
  }












  p->rc = pOp->p1;
  p->errorAction = (u8)pOp->p2;
  p->pc = pc;
  if( p->rc ){
    if( pOp->p5 ){
      static const char * const azType[] = { "NOT NULL", "UNIQUE", "CHECK",
                                             "FOREIGN KEY" };
      assert( pOp->p5>=1 && pOp->p5<=4 );
      testcase( pOp->p5==1 );
      testcase( pOp->p5==2 );
      testcase( pOp->p5==3 );
      testcase( pOp->p5==4 );
      zType = azType[pOp->p5-1];
    }else{
      zType = 0;
    }
    zLogFmt = "abort at %d in [%s]: %s";
    if( zType && pOp->p4.z ){
      sqlite3SetString(&p->zErrMsg, db, "%s constraint failed: %s", 
                       zType, pOp->p4.z);
    }else if( pOp->p4.z ){
      sqlite3SetString(&p->zErrMsg, db, "%s", pOp->p4.z);
    }else if( zType ){