Index: src/alter.c ================================================================== --- src/alter.c +++ src/alter.c @@ -115,10 +115,11 @@ unsigned const char *z; /* Pointer to token */ int n; /* Length of token z */ int token; /* Type of token */ + UNUSED_PARAMETER(NotUsed); for(z=zInput; *z; z=z+n){ n = sqlite3GetToken(z, &token); if( token==TK_REFERENCES ){ char *zParent; do { Index: src/fkey.c ================================================================== --- src/fkey.c +++ src/fkey.c @@ -496,12 +496,13 @@ pLeft = sqlite3Expr(db, TK_REGISTER, 0); if( pLeft ){ /* Set the collation sequence and affinity of the LHS of each TK_EQ ** expression to the parent key column defaults. */ if( pIdx ){ - int iCol = pIdx->aiColumn[i]; - Column *pCol = &pIdx->pTable->aCol[iCol]; + Column *pCol; + iCol = pIdx->aiColumn[i]; + pCol = &pIdx->pTable->aCol[iCol]; pLeft->iTable = regData+iCol+1; pLeft->affinity = pCol->affinity; pLeft->pColl = sqlite3LocateCollSeq(pParse, pCol->zColl); }else{ pLeft->iTable = regData; @@ -955,11 +956,11 @@ u8 enableLookaside; /* Copy of db->lookaside.bEnabled */ char const *zFrom; /* Name of child table */ int nFrom; /* Length in bytes of zFrom */ Index *pIdx = 0; /* Parent key index for this FK */ int *aiCol = 0; /* child table cols -> parent key cols */ - TriggerStep *pStep; /* First (only) step of trigger program */ + TriggerStep *pStep = 0; /* First (only) step of trigger program */ Expr *pWhere = 0; /* WHERE clause of trigger step */ ExprList *pList = 0; /* Changes list if ON UPDATE CASCADE */ Select *pSelect = 0; /* If RESTRICT, "SELECT RAISE(...)" */ int i; /* Iterator variable */ Expr *pWhen = 0; /* WHEN clause for the trigger */