/ Check-in [1dc7993b]
Login

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

Overview
Comment:Performance improvement on the OP_Variable opcode.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | value_frombind
Files: files | file ages | folders
SHA3-256: 1dc7993bb6957587a6c63142e97b8e4137c3d81bbfd724f86048e0894bcb429b
User & Date: drh 2019-04-01 20:57:11
Context
2019-04-02
00:28
Add the sqlite3_value_frombind() interface. Use that interface to improve fts3_tokenizer(). check-in: b3f2c320 user: drh tags: trunk
2019-04-01
20:57
Performance improvement on the OP_Variable opcode. Closed-Leaf check-in: 1dc7993b user: drh tags: value_frombind
2019-03-29
17:26
Change the fts3_tokenizer() function to always return the pointer as a BLOB as long as the first argument is a bound parameter, regardless of the SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER setting. check-in: 27160df7 user: drh tags: value_frombind
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/vdbe.c.

  1232   1232     assert( pOp->p1>0 && pOp->p1<=p->nVar );
  1233   1233     assert( pOp->p4.z==0 || pOp->p4.z==sqlite3VListNumToName(p->pVList,pOp->p1) );
  1234   1234     pVar = &p->aVar[pOp->p1 - 1];
  1235   1235     if( sqlite3VdbeMemTooBig(pVar) ){
  1236   1236       goto too_big;
  1237   1237     }
  1238   1238     pOut = &aMem[pOp->p2];
  1239         -  sqlite3VdbeMemShallowCopy(pOut, pVar, MEM_Static);
  1240         -  pOut->flags |= MEM_FromBind;
         1239  +  if( VdbeMemDynamic(pOut) ) sqlite3VdbeMemSetNull(pOut);
         1240  +  memcpy(pOut, pVar, MEMCELLSIZE);
         1241  +  pOut->flags &= ~(MEM_Dyn|MEM_Ephem);
         1242  +  pOut->flags |= MEM_Static|MEM_FromBind;
  1241   1243     UPDATE_MAX_BLOBSIZE(pOut);
  1242   1244     break;
  1243   1245   }
  1244   1246   
  1245   1247   /* Opcode: Move P1 P2 P3 * *
  1246   1248   ** Synopsis: r[P2@P3]=r[P1@P3]
  1247   1249   **

Changes to src/vdbemem.c.

    53     53         /* This is a pointer type.  There may be a flag to indicate what to
    54     54         ** do with the pointer. */
    55     55         assert( ((p->flags&MEM_Dyn)!=0 ? 1 : 0) +
    56     56                 ((p->flags&MEM_Ephem)!=0 ? 1 : 0) +
    57     57                 ((p->flags&MEM_Static)!=0 ? 1 : 0) <= 1 );
    58     58   
    59     59         /* No other bits set */
    60         -      assert( (p->flags & ~(MEM_Null|MEM_Term|MEM_Subtype
           60  +      assert( (p->flags & ~(MEM_Null|MEM_Term|MEM_Subtype|MEM_FromBind
    61     61                              |MEM_Dyn|MEM_Ephem|MEM_Static))==0 );
    62     62       }else{
    63     63         /* A pure NULL might have other flags, such as MEM_Static, MEM_Dyn,
    64     64         ** MEM_Ephem, MEM_Cleared, or MEM_Subtype */
    65     65       }
    66     66     }else{
    67     67       /* The MEM_Cleared bit is only allowed on NULLs */