SQLite

Check-in [36b613ccf0]
Login

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

Overview
Comment:The OP_Column opcode runs faster and is smaller by manually in-lining the code that persists string values in the output register.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 36b613ccf0ddb764af90841994da91b7fcaa8f00
User & Date: drh 2014-09-19 15:28:33.728
References
2014-11-05
14:53 New ticket [094d39a4c9] Assertion fault on CREATE TABLE ... AS SELECT .... (artifact: b5f433e534 user: drh)
Context
2014-09-19
16:02
Updates to comments. No code changes. (check-in: 9b42c3da6b user: drh tags: trunk)
15:28
The OP_Column opcode runs faster and is smaller by manually in-lining the code that persists string values in the output register. (check-in: 36b613ccf0 user: drh tags: trunk)
04:42
Add the sqlite3VdbeMemClearAndResize() function. Fix a sorting-index prefilter problem. (check-in: 987a7a2119 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbe.c.
2478
2479
2480
2481
2482
2483
2484


2485












2486
2487
2488
2489
2490
2491
2492
      sqlite3VdbeSerialGet((const u8*)pDest->z, t, pDest);
      pDest->flags &= ~MEM_Ephem;
    }
  }
  pDest->enc = encoding;

op_column_out:


  Deephemeralize(pDest);












op_column_error:
  UPDATE_MAX_BLOBSIZE(pDest);
  REGISTER_TRACE(pOp->p3, pDest);
  break;
}

/* Opcode: Affinity P1 P2 * P4 *







>
>
|
>
>
>
>
>
>
>
>
>
>
>
>







2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
      sqlite3VdbeSerialGet((const u8*)pDest->z, t, pDest);
      pDest->flags &= ~MEM_Ephem;
    }
  }
  pDest->enc = encoding;

op_column_out:
  /* If the column value is an ephemeral string, go ahead and persist
  ** that string in case the cursor moves before the column value is
  ** used.  The following code does the equivalent of Deephemeralize()
  ** but does it faster. */
  if( (pDest->flags & MEM_Ephem)!=0 && pDest->z ){
    u16 f = pDest->flags & (MEM_Str|MEM_Blob);
    assert( f!=0 );
    zData = (const u8*)pDest->z;
    len = pDest->n;
    if( sqlite3VdbeMemClearAndResize(pDest, len+2) ) goto no_mem;
    memcpy(pDest->z, zData, len);
    pDest->z[len] = 0;
    pDest->z[len+1] = 0;
    pDest->flags = f|MEM_Term;
  }
op_column_error:
  UPDATE_MAX_BLOBSIZE(pDest);
  REGISTER_TRACE(pOp->p3, pDest);
  break;
}

/* Opcode: Affinity P1 P2 * P4 *