Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
d6b5d850
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d6b5d850
编写于
2月 03, 1998
作者:
T
Thomas G. Lockhart
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Supress call to tzset() in reset_timezone() if a new time zone has never
been set in the session. General cleanup of timezone support code.
上级
a90b6a44
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
48 deletion
+20
-48
src/backend/commands/variable.c
src/backend/commands/variable.c
+20
-48
未找到文件。
src/backend/commands/variable.c
浏览文件 @
d6b5d850
...
...
@@ -2,7 +2,7 @@
* Routines for handling of 'SET var TO',
* 'SHOW var' and 'RESET var' statements.
*
* $Id: variable.c,v 1.
2 1998/01/07 18:46:26 momjian
Exp $
* $Id: variable.c,v 1.
3 1998/02/03 16:06:49 thomas
Exp $
*
*/
...
...
@@ -22,19 +22,6 @@ extern bool _use_geqo_;
extern
int32
_use_geqo_rels_
;
extern
bool
_use_right_sided_plans_
;
/*-----------------------------------------------------------------------*/
#if USE_EURODATES
#define DATE_EURO TRUE
#else
#define DATE_EURO FALSE
#endif
/*-----------------------------------------------------------------------*/
struct
PGVariables
PGVariables
=
{
{
DATE_EURO
,
Date_Postgres
}
};
/*-----------------------------------------------------------------------*/
static
const
char
*
get_token
(
char
**
tok
,
char
**
val
,
const
char
*
str
)
...
...
@@ -137,26 +124,6 @@ get_token(char **tok, char **val, const char *str)
}
/*-----------------------------------------------------------------------*/
#if FALSE
static
bool
parse_null
(
const
char
*
value
)
{
return
TRUE
;
}
static
bool
show_null
(
const
char
*
value
)
{
return
TRUE
;
}
static
bool
reset_null
(
const
char
*
value
)
{
return
TRUE
;
}
#endif
bool
parse_geqo
(
const
char
*
value
)
{
...
...
@@ -247,6 +214,7 @@ parse_r_plans(const char *value)
return
TRUE
;
}
/*-----------------------------------------------------------------------*/
bool
show_r_plans
()
{
...
...
@@ -270,6 +238,7 @@ reset_r_plans()
return
TRUE
;
}
/*-----------------------------------------------------------------------*/
bool
parse_cost_heap
(
const
char
*
value
)
{
...
...
@@ -302,6 +271,7 @@ reset_cost_heap()
return
TRUE
;
}
/*-----------------------------------------------------------------------*/
bool
parse_cost_index
(
const
char
*
value
)
{
...
...
@@ -334,6 +304,7 @@ reset_cost_index()
return
TRUE
;
}
/*-----------------------------------------------------------------------*/
bool
parse_date
(
const
char
*
value
)
{
...
...
@@ -470,22 +441,13 @@ parse_timezone(const char *value)
{
/* Not yet tried to save original value from environment? */
if
(
defaultTZ
==
NULL
)
{
/* found something? then save it for later */
if
(
getenv
(
"TZ"
)
!=
NULL
)
{
defaultTZ
=
getenv
(
"TZ"
);
if
(
defaultTZ
==
NULL
)
defaultTZ
=
(
char
*
)
-
1
;
else
strcpy
(
TZvalue
,
defaultTZ
);
}
if
((
defaultTZ
=
getenv
(
"TZ"
))
!=
NULL
)
strcpy
(
TZvalue
,
defaultTZ
);
/* found nothing so mark with an invalid pointer */
else
{
defaultTZ
=
(
char
*
)
-
1
;
}
}
strcpy
(
tzbuf
,
"TZ="
);
strcat
(
tzbuf
,
tok
);
...
...
@@ -519,24 +481,34 @@ show_timezone()
* clears the process-specific environment variables.
* Other reasonable arguments to putenv() (e.g. "TZ=", "TZ", "") result
* in a core dump (under Linux anyway).
* - thomas 1998-01-26
*/
bool
reset_timezone
()
{
if
((
defaultTZ
!=
NULL
)
&&
(
defaultTZ
!=
(
char
*
)
-
1
))
/* no time zone has been set in this session? */
if
(
defaultTZ
==
NULL
)
{
}
/* time zone was set and original explicit time zone available? */
else
if
(
defaultTZ
!=
(
char
*
)
-
1
)
{
strcpy
(
tzbuf
,
"TZ="
);
strcat
(
tzbuf
,
TZvalue
);
if
(
putenv
(
tzbuf
)
!=
0
)
elog
(
ERROR
,
"Unable to set TZ environment variable to %s"
,
TZvalue
);
tzset
();
}
/* otherwise, time zone was set but no original explicit time zone available */
else
{
strcpy
(
tzbuf
,
"="
);
if
(
putenv
(
tzbuf
)
!=
0
)
elog
(
ERROR
,
"Unable to clear TZ environment variable"
,
NULL
);
tzset
();
}
tzset
();
return
TRUE
;
}
/* reset_timezone() */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录