git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0e758ae)
Fix compiler warning on MSVC
Mon, 7 Nov 2022 21:54:04 +0000 (10:54 +1300)
Mon, 7 Nov 2022 21:54:04 +0000 (10:54 +1300)
MSVC does not understand that ereport(ERROR) does not return, so just
return the first enum PartitionStrategy value to keep the compiler from
complaining about the missing return.

Discussion: https://postgr.es/m/20221104161934.GB16921@telsasoft.com


diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index deb101710e4d651d0d55b3d1060949ddf1ed7b79..2dddd8f302ca0d484ef7b3114a20e5aeecb1531d 100644 (file)
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -18428,10 +18428,13 @@ parsePartitionStrategy(char *strategy)
return PARTITION_STRATEGY_RANGE;
else if (pg_strcasecmp(strategy, "hash") == 0)
return PARTITION_STRATEGY_HASH;
+
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("unrecognized partitioning strategy \"%s\"",
strategy)));
+ return PARTITION_STRATEGY_LIST; /* keep compiler quiet */
+
}
/*
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /