/ Check-in [a2952231]
Login

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

Overview
Comment:Fix an assert() to have a test instead of a side effect
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a2952231ac7abe165ed070875728f752ae0be608
User & Date: pdr 2016-02-06 14:14:43
Context
2016-02-06
19:48
Make sure variable declarations occur at the beginning of blocks, even with SQLITE_DEBUG enabled. check-in: 2f7778e6 user: drh tags: trunk
14:14
Fix an assert() to have a test instead of a side effect check-in: a2952231 user: pdr tags: trunk
2016-02-05
21:09
Add tests for and remove unreachable branches from fts5 in order to restore test coverage. check-in: 22589018 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/alter.c.

   691    691     */
   692    692     if( pDflt ){
   693    693       sqlite3_value *pVal = 0;
   694    694       int rc;
   695    695       rc = sqlite3ValueFromExpr(db, pDflt, SQLITE_UTF8, SQLITE_AFF_BLOB, &pVal);
   696    696       assert( rc==SQLITE_OK || rc==SQLITE_NOMEM );
   697    697       if( rc!=SQLITE_OK ){
   698         -      assert( db->mallocFailed = 1 );
          698  +      assert( db->mallocFailed == 1 );
   699    699         return;
   700    700       }
   701    701       if( !pVal ){
   702    702         sqlite3ErrorMsg(pParse, "Cannot add a column with non-constant default");
   703    703         return;
   704    704       }
   705    705       sqlite3ValueFree(pVal);