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

Commitf7e954a

Browse files
committed
Rework code using list_delete_cell() in MergeAttributes
When merging two attributes, we are sure that at least one remains.However, when deleting one element in the attribute list we may finishwith an empty list returned as NIL by list_delete_cell(), but the codefailed to track that, which is not project-like. Adjust the call so aswe check for an empty list, and make use of it in an assertion.This has been introduced by e7b3349, when adding support for CREATETABLE OF.Author: Mark DilgerReviewed-by: Álvaro Herrera, Michael PaquierDiscussion:https://postgr.es/m/CAE-h2TpPDqSWgOvfvSziOaMngMPwW+QZcmPpY8hQ_KOJ2+3hXQ@mail.gmail.com
1 parent5efd604 commitf7e954a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2088,7 +2088,13 @@ MergeAttributes(List *schema, List *supers, char relpersistence,
20882088
coldef->cooked_default = restdef->cooked_default;
20892089
coldef->constraints = restdef->constraints;
20902090
coldef->is_from_type = false;
2091-
list_delete_cell(schema, rest, prev);
2091+
schema = list_delete_cell(schema, rest, prev);
2092+
2093+
/*
2094+
* As two elements are merged and one is removed, we
2095+
* should never finish with an empty list.
2096+
*/
2097+
Assert(schema != NIL);
20922098
}
20932099
else
20942100
ereport(ERROR,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp