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

Commit61f352e

Browse files
committed
Fix unreachable code warning from commit2d819a0.
Found by Coverity.Discussion:https://postgr.es/m/3422201.1710711993@sss.pgh.pa.usReported-by: Tom Lane
1 parent5162f66 commit61f352e

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

‎src/backend/utils/adt/pg_locale.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2501,28 +2501,23 @@ pg_strnxfrm_prefix(char *dest, size_t destsize, const char *src,
25012501
returnresult;
25022502
}
25032503

2504+
/*
2505+
* Validate the locale and encoding combination, and return the canonical form
2506+
* of the locale name.
2507+
*
2508+
* The only supported locale for the builtin provider is "C", and it's
2509+
* available for any encoding.
2510+
*/
25042511
constchar*
25052512
builtin_validate_locale(intencoding,constchar*locale)
25062513
{
2507-
constchar*canonical_name=NULL;
2508-
intrequired_encoding=-1;
2509-
2510-
if (strcmp(locale,"C")==0)
2511-
canonical_name="C";
2512-
2513-
if (!canonical_name)
2514+
if (strcmp(locale,"C")!=0)
25142515
ereport(ERROR,
25152516
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
25162517
errmsg("invalid locale name \"%s\" for builtin provider",
25172518
locale)));
25182519

2519-
if (required_encoding >=0&&encoding!=required_encoding)
2520-
ereport(ERROR,
2521-
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
2522-
errmsg("encoding \"%s\" does not match locale \"%s\"",
2523-
pg_encoding_to_char(encoding),locale)));
2524-
2525-
returncanonical_name;
2520+
return"C";
25262521
}
25272522

25282523

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp