/ Check-in [a2952231]
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: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 Unified Diffs Ignore Whitespace Patch

Changes to src/alter.c.

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







|







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