Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
b42e37bc
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,发现更多精彩内容 >>
提交
b42e37bc
编写于
11月 10, 1997
作者:
T
Thomas G. Lockhart
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change quickdie elog notice to a single message.
Clean up FloatExceptionHandler elog message source code.
上级
25e950fc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
54 addition
and
27 deletion
+54
-27
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+14
-12
src/backend/tcop/variable.c
src/backend/tcop/variable.c
+40
-15
未找到文件。
src/backend/tcop/postgres.c
浏览文件 @
b42e37bc
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.5
3 1997/11/09 04:47:09 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.5
4 1997/11/10 15:24:55 thomas
Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -728,8 +728,9 @@ pg_eval_dest(char *query_string,/* string to execute */
* handle_warn() is used to catch kill(getpid(),1) which
* occurs when elog(WARN) is called.
*
* quickdie() occurs when signalled by the postmaster, some backend
* has bought the farm we need to stop what we're doing and exit.
* quickdie() occurs when signalled by the postmaster.
* Some backend has bought the farm,
* so we need to stop what we're doing and exit.
*
* die() preforms an orderly cleanup via ExitPostgres()
* --------------------------------
...
...
@@ -744,12 +745,12 @@ handle_warn(SIGNAL_ARGS)
static
void
quickdie
(
SIGNAL_ARGS
)
{
elog
(
NOTICE
,
"Message from PostgreSQL backend:
The Postmaster has "
);
elog
(
NOTICE
,
"informed me that some other backend died abnormally and "
);
elog
(
NOTICE
,
"possibly corrupted shared memory. I have rolled back "
);
elog
(
NOTICE
,
"the current transaction and am going to terminate your "
);
elog
(
NOTICE
,
"database system connection and exit. Please reconnect to"
);
elog
(
NOTICE
,
"
the database system and repeat your query."
);
elog
(
NOTICE
,
"Message from PostgreSQL backend:
"
"
\n\t
The Postmaster has informed me that some other backend"
" died abnormally and possibly corrupted shared memory."
"
\n\t
I have rolled back the current transaction and am"
" going to terminate your database system connection and exit."
"
\n\t
Please reconnect to
the database system and repeat your query."
);
/*
...
...
@@ -771,8 +772,9 @@ die(SIGNAL_ARGS)
static
void
FloatExceptionHandler
(
SIGNAL_ARGS
)
{
elog
(
WARN
,
"floating point exception! the last floating point operation eit\
her exceeded legal ranges or was a divide by zero"
);
elog
(
WARN
,
"floating point exception!"
" The last floating point operation either exceeded legal ranges"
" or was a divide by zero"
);
}
...
...
@@ -1339,7 +1341,7 @@ PostgresMain(int argc, char *argv[])
if
(
IsUnderPostmaster
==
false
)
{
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"$Revision: 1.5
3 $ $Date: 1997/11/09 04:47:09
$"
);
puts
(
"$Revision: 1.5
4 $ $Date: 1997/11/10 15:24:55
$"
);
}
/* ----------------
...
...
src/backend/tcop/variable.c
浏览文件 @
b42e37bc
...
...
@@ -2,7 +2,7 @@
* Routines for handling of 'SET var TO',
* 'SHOW var' and 'RESET var' statements.
*
* $Id: variable.c,v 1.
19 1997/11/07 06:43:1
6 thomas Exp $
* $Id: variable.c,v 1.
20 1997/11/10 15:24:5
6 thomas Exp $
*
*/
...
...
@@ -431,8 +431,13 @@ reset_date()
return
TRUE
;
}
/* Timezone support
* Working storage for strings is allocated with an arbitrary size of 64 bytes.
*/
static
char
*
defaultTZ
=
NULL
;
static
char
TZvalue
[
10
];
static
char
TZvalue
[
64
];
static
char
tzbuf
[
64
];
bool
parse_timezone
(
const
char
*
value
)
...
...
@@ -447,20 +452,30 @@ parse_timezone(const char *value)
while
((
value
=
get_token
(
&
tok
,
NULL
,
value
))
!=
0
)
{
if
((
defaultTZ
==
NULL
)
&&
(
getenv
(
"TZ"
)
!=
NULL
))
/* Not yet tried to save original value from environment? */
if
(
defaultTZ
==
NULL
)
{
defaultTZ
=
getenv
(
"TZ"
);
if
(
defaultTZ
=
=
NULL
)
/* found something? then save it for later */
if
(
getenv
(
"TZ"
)
!
=
NULL
)
{
defaultTZ
=
(
char
*
)
-
1
;
defaultTZ
=
getenv
(
"TZ"
);
if
(
defaultTZ
==
NULL
)
defaultTZ
=
(
char
*
)
-
1
;
else
strcpy
(
TZvalue
,
defaultTZ
);
}
/* found nothing so mark with an invalid pointer */
else
{
strcpy
(
TZvalue
,
defaultTZ
)
;
defaultTZ
=
(
char
*
)
-
1
;
}
}
setenv
(
"TZ"
,
tok
,
TRUE
);
strcpy
(
tzbuf
,
"TZ="
);
strcat
(
tzbuf
,
tok
);
if
(
putenv
(
tzbuf
)
!=
0
)
elog
(
WARN
,
"Unable to set TZ environment variable to %s"
,
tok
);
tzset
();
PFREE
(
tok
);
}
...
...
@@ -471,29 +486,39 @@ parse_timezone(const char *value)
bool
show_timezone
()
{
char
buf
[
64
];
char
*
tz
;
tz
=
getenv
(
"TZ"
);
strcpy
(
buf
,
"Time zone is "
);
strcat
(
buf
,
((
tz
!=
NULL
)
?
tz
:
"unknown"
));
elog
(
NOTICE
,
buf
,
NULL
);
elog
(
NOTICE
,
"Time zone is %s"
,
((
tz
!=
NULL
)
?
tz
:
"unknown"
));
return
TRUE
;
}
/* show_timezone() */
/* reset_timezone()
* Set TZ environment variable to original value.
* Note that if TZ was originally not set, TZ should be cleared.
* unsetenv() works fine, but is BSD, not POSIX, and is not available
* under Solaris, among others. Apparently putenv() called as below
* clears the process-specific environment variables.
* Other reasonable arguments to putenv() (e.g. "TZ=", "TZ", "") result
* in a core dump (under Linux anyway).
*/
bool
reset_timezone
()
{
if
((
defaultTZ
!=
NULL
)
&&
(
defaultTZ
!=
(
char
*
)
-
1
))
{
setenv
(
"TZ"
,
TZvalue
,
TRUE
);
strcpy
(
tzbuf
,
"TZ="
);
strcat
(
tzbuf
,
TZvalue
);
if
(
putenv
(
tzbuf
)
!=
0
)
elog
(
WARN
,
"Unable to set TZ environment variable to %s"
,
TZvalue
);
}
else
{
unsetenv
(
"TZ"
);
strcpy
(
tzbuf
,
"="
);
if
(
putenv
(
tzbuf
)
!=
0
)
elog
(
WARN
,
"Unable to clear TZ environment variable"
,
NULL
);
}
tzset
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录