@@ -126,6 +126,7 @@ static List *on_commits = NIL;
126
126
* a pass determined by subcommand type.
127
127
*/
128
128
129
+ #define AT_PASS_UNSET -1/* UNSET will cause ERROR */
129
130
#define AT_PASS_DROP 0/* DROP (all flavors) */
130
131
#define AT_PASS_ALTER_TYPE 1/* ALTER COLUMN TYPE */
131
132
#define AT_PASS_OLD_INDEX 2/* re-add existing indexes */
@@ -2947,7 +2948,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
2947
2948
bool recurse ,bool recursing ,LOCKMODE lockmode )
2948
2949
{
2949
2950
AlteredTableInfo * tab ;
2950
- int pass ;
2951
+ int pass = AT_PASS_UNSET ;
2951
2952
2952
2953
/* Find or create work queue entry for this table */
2953
2954
tab = ATGetQueueEntry (wqueue ,rel );
@@ -3160,9 +3161,10 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
3160
3161
default :/* oops */
3161
3162
elog (ERROR ,"unrecognized alter table type: %d" ,
3162
3163
(int )cmd -> subtype );
3163
- pass = 0 ; /* keep compiler quiet */
3164
+ pass = AT_PASS_UNSET ; /* keep compiler quiet */
3164
3165
break ;
3165
3166
}
3167
+ Assert (pass > AT_PASS_UNSET );
3166
3168
3167
3169
/* Add the subcommand to the appropriate list for phase 2 */
3168
3170
tab -> subcmds [pass ]= lappend (tab -> subcmds [pass ],cmd );