提交 a9375827 编写于 作者: T Taylor Vesely

Fix tzparse calls during initdb

The return value of tzparse() has changed as of commit b749790a, but the
corresponding change to the tzparse() function in pg_load_tz() was never made.
As a result, under certain circumstances the server might pick a bogus
timezone.
上级 fab372cb
......@@ -99,7 +99,7 @@ pg_load_tz(const char *name)
*/
if (strcmp(name, "GMT") == 0)
{
if (tzparse(name, &tz.state, TRUE) != 0)
if (!tzparse(name, &tz.state, TRUE))
{
/* This really, really should not happen ... */
return NULL;
......@@ -107,7 +107,7 @@ pg_load_tz(const char *name)
}
else if (tzload(name, NULL, &tz.state, TRUE) != 0)
{
if (name[0] == ':' || tzparse(name, &tz.state, FALSE) != 0)
if (name[0] == ':' || !tzparse(name, &tz.state, FALSE))
{
return NULL; /* unknown timezone */
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册