/ Check-in [af364cce]
Login

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

Overview
Comment:Add an assert() and five testcase() macros to the OP_Cast opcode implementation to help verify that it is fully tested.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:af364cce9da0961593ef876b646197f82df08ad5
User & Date: drh 2014-08-25 22:37:19
Context
2014-08-26
15:06
Change the page cache so that a new sqlite3_pcache object is allocated as soon as the page cache is opened, not delayed until the first fetch request. This give a noticable performance boost. The interface between pager and the page cache has changed slightly, which might break ZIPVFS. check-in: f1f94a97 user: drh tags: trunk
02:15
Merge recent performance enhancements and the CAST operator enhancements into the sessions branch. check-in: 08ae974a user: drh tags: sessions
02:02
Merge recent performance enhancements and the CAST operator enhancements into the apple-osx branch. check-in: 5c273111 user: drh tags: apple-osx
2014-08-25
22:43
Merge the CAST operator enhancements from trunk. check-in: 6c8f86e4 user: drh tags: threads
22:37
Add an assert() and five testcase() macros to the OP_Cast opcode implementation to help verify that it is fully tested. check-in: af364cce user: drh tags: trunk
21:11
Minor changes to the CAST logic to make it more testable. check-in: 1ad70ec5 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

  1779   1779   ** <li value="100"> INTEGER
  1780   1780   ** <li value="101"> REAL
  1781   1781   ** </ul>
  1782   1782   **
  1783   1783   ** A NULL value is not changed by this routine.  It remains NULL.
  1784   1784   */
  1785   1785   case OP_Cast: {                  /* in1 */
         1786  +  assert( pOp->p2>=SQLITE_AFF_TEXT && pOp->p2<=SQLITE_AFF_REAL );
         1787  +  testcase( pOp->p2==SQLITE_AFF_TEXT );
         1788  +  testcase( pOp->p2==SQLITE_AFF_NONE );
         1789  +  testcase( pOp->p2==SQLITE_AFF_NUMERIC );
         1790  +  testcase( pOp->p2==SQLITE_AFF_INTEGER );
         1791  +  testcase( pOp->p2==SQLITE_AFF_REAL );
  1786   1792     pIn1 = &aMem[pOp->p1];
  1787   1793     memAboutToChange(p, pIn1);
  1788   1794     rc = ExpandBlob(pIn1);
  1789   1795     sqlite3VdbeMemCast(pIn1, pOp->p2, encoding);
  1790   1796     UPDATE_MAX_BLOBSIZE(pIn1);
  1791   1797     break;
  1792   1798   }