SQLite

Check-in [5fca41a381]
Login

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

Overview
Comment:Remove an unreachable branch from the OP_VCreate opcode.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5fca41a3811766b48f5f23d5d49cc4e6e79fa867
User & Date: drh 2015-03-21 12:22:16.937
Context
2015-03-21
12:25
Remove an unreachable branch from the OP_VCreate opcode (merge accidental fork in trunk). (check-in: 2fbfec62fc user: dan tags: trunk)
12:22
Remove an unreachable branch from the OP_VCreate opcode. (check-in: 5fca41a381 user: drh tags: trunk)
10:53
Add a missing "ifcapable fts3" to a test case in vtab2.test. (check-in: d845b0f690 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbe.c.
6029
6030
6031
6032
6033
6034
6035


6036
6037




6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
/* Opcode: VCreate P1 P2 * * *
**
** P2 is a register that holds the name of a virtual table in database 
** P1. Call the xCreate method for that table.
*/
case OP_VCreate: {
  Mem sMem;          /* For storing the record being decoded */


  memset(&sMem, 0, sizeof(sMem));
  sMem.db = db;




  rc = sqlite3VdbeMemCopy(&sMem, &aMem[pOp->p2]);
  if( rc==SQLITE_OK ){
    const char *zTab = (const char*)sqlite3_value_text(&sMem);
    assert( zTab || db->mallocFailed );
    if( zTab ){
      rc = sqlite3VtabCallCreate(db, pOp->p1, zTab, &p->zErrMsg);
    }
  }
  sqlite3VdbeMemRelease(&sMem);
  break;
}
#endif /* SQLITE_OMIT_VIRTUALTABLE */

#ifndef SQLITE_OMIT_VIRTUALTABLE







>
>


>
>
>
>

|
|
|
|
|
<







6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049

6050
6051
6052
6053
6054
6055
6056
/* Opcode: VCreate P1 P2 * * *
**
** P2 is a register that holds the name of a virtual table in database 
** P1. Call the xCreate method for that table.
*/
case OP_VCreate: {
  Mem sMem;          /* For storing the record being decoded */
  const char *zTab;  /* Name of the virtual table */

  memset(&sMem, 0, sizeof(sMem));
  sMem.db = db;
  /* Because P2 is always a static string, it is impossible for the
  ** sqlite3VdbeMemCopy() to fail */
  assert( (aMem[pOp->p2].flags & MEM_Str)!=0 );
  assert( (aMem[pOp->p2].flags & MEM_Static)!=0 );
  rc = sqlite3VdbeMemCopy(&sMem, &aMem[pOp->p2]);
  assert( rc==SQLITE_OK );
  zTab = (const char*)sqlite3_value_text(&sMem);
  assert( zTab || db->mallocFailed );
  if( zTab ){
    rc = sqlite3VtabCallCreate(db, pOp->p1, zTab, &p->zErrMsg);

  }
  sqlite3VdbeMemRelease(&sMem);
  break;
}
#endif /* SQLITE_OMIT_VIRTUALTABLE */

#ifndef SQLITE_OMIT_VIRTUALTABLE