/ Check-in [ebcd4523]
Login

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

Overview
Comment:Add an ALWAYS on an unreachable branch in the ALTER TABLE logic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ebcd4523171f0988ff08e2bf36fb8a0caa40efe7ac7556b4eb206784969b03e4
User & Date: drh 2018-10-03 18:05:36
Context
2018-10-05
15:10
Changes to geopoly to silience false-positive warnings coming out of clang. check-in: 11d9015f user: drh tags: trunk
2018-10-04
18:17
The 0x8000 optimization flag associated with SQLITE_TESTCTRL_OPTIMIZATIONS causes a large penalty (200) to be added to all sorting costs, which encourages the query planner avoid using the sorter. This flag can be used in experiments to help come up with a more accurate estimate of the true cost of sorting. Leaf check-in: 857a1b01 user: drh tags: query-planner-debug
2018-10-03
18:05
Add an ALWAYS on an unreachable branch in the ALTER TABLE logic. check-in: ebcd4523 user: drh tags: trunk
11:13
Change a type in shell.c.in from "int" to "sqlite3_int64" in order to avoid a compiler warning and possible integer overflow. check-in: bf0a6634 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/alter.c.

  1057   1057     memset(&sNC, 0, sizeof(sNC));
  1058   1058     sNC.pParse = pParse;
  1059   1059     assert( pNew->pTabSchema );
  1060   1060     pParse->pTriggerTab = sqlite3FindTable(db, pNew->table, 
  1061   1061         db->aDb[sqlite3SchemaToIndex(db, pNew->pTabSchema)].zDbSName
  1062   1062     );
  1063   1063     pParse->eTriggerOp = pNew->op;
  1064         -  if( pParse->pTriggerTab ){
         1064  +  /* ALWAYS() because if the table of the trigger does not exist, the
         1065  +  ** error would have been hit before this point */
         1066  +  if( ALWAYS(pParse->pTriggerTab) ){
  1065   1067       rc = sqlite3ViewGetColumnNames(pParse, pParse->pTriggerTab);
  1066   1068     }
  1067   1069   
  1068   1070     /* Resolve symbols in WHEN clause */
  1069   1071     if( rc==SQLITE_OK && pNew->pWhen ){
  1070   1072       rc = sqlite3ResolveExprNames(&sNC, pNew->pWhen);
  1071   1073     }