/ Check-in [5fca41a3]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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 | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5fca41a3811766b48f5f23d5d49cc4e6e79fa867
User & Date: drh 2015-03-21 12:22:16
Context
2015-03-21
12:25
Remove an unreachable branch from the OP_VCreate opcode (merge accidental fork in trunk). check-in: 2fbfec62 user: dan tags: trunk
12:22
Remove an unreachable branch from the OP_VCreate opcode. check-in: 5fca41a3 user: drh tags: trunk
10:53
Add a missing "ifcapable fts3" to a test case in vtab2.test. check-in: d845b0f6 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs 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