Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2f74e4e

Browse files
Assert that ALTER TABLE subcommands have pass set
1 parentf851361 commit2f74e4e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ static List *on_commits = NIL;
126126
* a pass determined by subcommand type.
127127
*/
128128

129+
#defineAT_PASS_UNSET-1/* UNSET will cause ERROR */
129130
#defineAT_PASS_DROP0/* DROP (all flavors) */
130131
#defineAT_PASS_ALTER_TYPE1/* ALTER COLUMN TYPE */
131132
#defineAT_PASS_OLD_INDEX2/* re-add existing indexes */
@@ -2947,7 +2948,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
29472948
boolrecurse,boolrecursing,LOCKMODElockmode)
29482949
{
29492950
AlteredTableInfo*tab;
2950-
intpass;
2951+
intpass=AT_PASS_UNSET;
29512952

29522953
/* Find or create work queue entry for this table */
29532954
tab=ATGetQueueEntry(wqueue,rel);
@@ -3160,9 +3161,10 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
31603161
default:/* oops */
31613162
elog(ERROR,"unrecognized alter table type: %d",
31623163
(int)cmd->subtype);
3163-
pass=0;/* keep compiler quiet */
3164+
pass=AT_PASS_UNSET;/* keep compiler quiet */
31643165
break;
31653166
}
3167+
Assert(pass>AT_PASS_UNSET);
31663168

31673169
/* Add the subcommand to the appropriate list for phase 2 */
31683170
tab->subcmds[pass]=lappend(tab->subcmds[pass],cmd);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp