Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
62abb039
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,发现更多精彩内容 >>
提交
62abb039
编写于
7月 12, 2005
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change 5e0 to 5.0, for consistency.
上级
220e6bfc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
33 deletion
+33
-33
src/backend/utils/adt/date.c
src/backend/utils/adt/date.c
+11
-11
src/backend/utils/adt/datetime.c
src/backend/utils/adt/datetime.c
+2
-2
src/backend/utils/adt/timestamp.c
src/backend/utils/adt/timestamp.c
+20
-20
未找到文件。
src/backend/utils/adt/date.c
浏览文件 @
62abb039
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.11
1 2005/07/10 21:13:59 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.11
2 2005/07/12 15:17:44 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -946,9 +946,9 @@ time2tm(TimeADT time, struct pg_tm * tm, fsec_t *fsec)
...
@@ -946,9 +946,9 @@ time2tm(TimeADT time, struct pg_tm * tm, fsec_t *fsec)
double
trem
;
double
trem
;
trem
=
time
;
trem
=
time
;
TMODULO
(
trem
,
tm
->
tm_hour
,
3600
e
0
);
TMODULO
(
trem
,
tm
->
tm_hour
,
3600
.
0
);
TMODULO
(
trem
,
tm
->
tm_min
,
60
e
0
);
TMODULO
(
trem
,
tm
->
tm_min
,
60
.
0
);
TMODULO
(
trem
,
tm
->
tm_sec
,
1
e
0
);
TMODULO
(
trem
,
tm
->
tm_sec
,
1
.
0
);
*
fsec
=
trem
;
*
fsec
=
trem
;
#endif
#endif
...
@@ -1683,7 +1683,7 @@ time_part(PG_FUNCTION_ARGS)
...
@@ -1683,7 +1683,7 @@ time_part(PG_FUNCTION_ARGS)
else
if
(
type
==
RESERV
&&
val
==
DTK_EPOCH
)
else
if
(
type
==
RESERV
&&
val
==
DTK_EPOCH
)
{
{
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
(
time
/
1000000
e
0
);
result
=
(
time
/
1000000
.
0
);
#else
#else
result
=
time
;
result
=
time
;
#endif
#endif
...
@@ -1841,9 +1841,9 @@ timetz2tm(TimeTzADT *time, struct pg_tm * tm, fsec_t *fsec, int *tzp)
...
@@ -1841,9 +1841,9 @@ timetz2tm(TimeTzADT *time, struct pg_tm * tm, fsec_t *fsec, int *tzp)
#else
#else
double
trem
=
time
->
time
;
double
trem
=
time
->
time
;
TMODULO
(
trem
,
tm
->
tm_hour
,
3600
e
0
);
TMODULO
(
trem
,
tm
->
tm_hour
,
3600
.
0
);
TMODULO
(
trem
,
tm
->
tm_min
,
60
e
0
);
TMODULO
(
trem
,
tm
->
tm_min
,
60
.
0
);
TMODULO
(
trem
,
tm
->
tm_sec
,
1
e
0
);
TMODULO
(
trem
,
tm
->
tm_sec
,
1
.
0
);
*
fsec
=
trem
;
*
fsec
=
trem
;
#endif
#endif
...
@@ -2398,12 +2398,12 @@ timetz_part(PG_FUNCTION_ARGS)
...
@@ -2398,12 +2398,12 @@ timetz_part(PG_FUNCTION_ARGS)
case
DTK_TZ_MINUTE
:
case
DTK_TZ_MINUTE
:
result
=
-
tz
;
result
=
-
tz
;
result
/=
60
;
result
/=
60
;
FMODULO
(
result
,
dummy
,
60
e
0
);
FMODULO
(
result
,
dummy
,
60
.
0
);
break
;
break
;
case
DTK_TZ_HOUR
:
case
DTK_TZ_HOUR
:
dummy
=
-
tz
;
dummy
=
-
tz
;
FMODULO
(
dummy
,
result
,
3600
e
0
);
FMODULO
(
dummy
,
result
,
3600
.
0
);
break
;
break
;
case
DTK_MICROSEC
:
case
DTK_MICROSEC
:
...
@@ -2458,7 +2458,7 @@ timetz_part(PG_FUNCTION_ARGS)
...
@@ -2458,7 +2458,7 @@ timetz_part(PG_FUNCTION_ARGS)
else
if
(
type
==
RESERV
&&
val
==
DTK_EPOCH
)
else
if
(
type
==
RESERV
&&
val
==
DTK_EPOCH
)
{
{
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
time
->
time
/
1000000
e
0
+
time
->
zone
;
result
=
time
->
time
/
1000000
.
0
+
time
->
zone
;
#else
#else
result
=
time
->
time
+
time
->
zone
;
result
=
time
->
time
+
time
->
zone
;
#endif
#endif
...
...
src/backend/utils/adt/datetime.c
浏览文件 @
62abb039
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.15
1 2005/06/29 22:51:56 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.15
2 2005/07/12 15:17:44 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -3278,7 +3278,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct pg_tm * tm,
...
@@ -3278,7 +3278,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct pg_tm * tm,
sec
=
(
*
fsec
/
USECS_PER_SEC
);
sec
=
(
*
fsec
/
USECS_PER_SEC
);
*
fsec
-=
(
sec
*
USECS_PER_SEC
);
*
fsec
-=
(
sec
*
USECS_PER_SEC
);
#else
#else
TMODULO
(
*
fsec
,
sec
,
1
e
0
);
TMODULO
(
*
fsec
,
sec
,
1
.
0
);
#endif
#endif
tm
->
tm_sec
+=
sec
;
tm
->
tm_sec
+=
sec
;
}
}
...
...
src/backend/utils/adt/timestamp.c
浏览文件 @
62abb039
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.13
0 2005/07/10 21:13:59 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.13
1 2005/07/12 15:17:44 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1241,9 +1241,9 @@ interval2tm(Interval span, struct pg_tm * tm, fsec_t *fsec)
...
@@ -1241,9 +1241,9 @@ interval2tm(Interval span, struct pg_tm * tm, fsec_t *fsec)
*
fsec
=
(
time
-
(
tm
->
tm_sec
*
USECS_PER_SEC
));
*
fsec
=
(
time
-
(
tm
->
tm_sec
*
USECS_PER_SEC
));
#else
#else
TMODULO
(
time
,
tm
->
tm_mday
,
(
double
)
SECS_PER_DAY
);
TMODULO
(
time
,
tm
->
tm_mday
,
(
double
)
SECS_PER_DAY
);
TMODULO
(
time
,
tm
->
tm_hour
,
3600
e
0
);
TMODULO
(
time
,
tm
->
tm_hour
,
3600
.
0
);
TMODULO
(
time
,
tm
->
tm_min
,
60
e
0
);
TMODULO
(
time
,
tm
->
tm_min
,
60
.
0
);
TMODULO
(
time
,
tm
->
tm_sec
,
1
e
0
);
TMODULO
(
time
,
tm
->
tm_sec
,
1
.
0
);
*
fsec
=
time
;
*
fsec
=
time
;
#endif
#endif
...
@@ -3330,7 +3330,7 @@ timestamp_part(PG_FUNCTION_ARGS)
...
@@ -3330,7 +3330,7 @@ timestamp_part(PG_FUNCTION_ARGS)
{
{
case
DTK_MICROSEC
:
case
DTK_MICROSEC
:
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
tm
->
tm_sec
*
1000000
e
0
+
fsec
;
result
=
tm
->
tm_sec
*
1000000
.
0
+
fsec
;
#else
#else
result
=
(
tm
->
tm_sec
+
fsec
)
*
1000000
;
result
=
(
tm
->
tm_sec
+
fsec
)
*
1000000
;
#endif
#endif
...
@@ -3338,7 +3338,7 @@ timestamp_part(PG_FUNCTION_ARGS)
...
@@ -3338,7 +3338,7 @@ timestamp_part(PG_FUNCTION_ARGS)
case
DTK_MILLISEC
:
case
DTK_MILLISEC
:
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
tm
->
tm_sec
*
1000
e0
+
fsec
/
1000e
0
;
result
=
tm
->
tm_sec
*
1000
.
0
+
fsec
/
1000
.
0
;
#else
#else
result
=
(
tm
->
tm_sec
+
fsec
)
*
1000
;
result
=
(
tm
->
tm_sec
+
fsec
)
*
1000
;
#endif
#endif
...
@@ -3346,7 +3346,7 @@ timestamp_part(PG_FUNCTION_ARGS)
...
@@ -3346,7 +3346,7 @@ timestamp_part(PG_FUNCTION_ARGS)
case
DTK_SECOND
:
case
DTK_SECOND
:
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
tm
->
tm_sec
+
fsec
/
1000000
e
0
;
result
=
tm
->
tm_sec
+
fsec
/
1000000
.
0
;
#else
#else
result
=
tm
->
tm_sec
+
fsec
;
result
=
tm
->
tm_sec
+
fsec
;
#endif
#endif
...
@@ -3424,7 +3424,7 @@ timestamp_part(PG_FUNCTION_ARGS)
...
@@ -3424,7 +3424,7 @@ timestamp_part(PG_FUNCTION_ARGS)
result
=
date2j
(
tm
->
tm_year
,
tm
->
tm_mon
,
tm
->
tm_mday
);
result
=
date2j
(
tm
->
tm_year
,
tm
->
tm_mon
,
tm
->
tm_mday
);
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
+=
((((
tm
->
tm_hour
*
60
)
+
tm
->
tm_min
)
*
60
)
+
result
+=
((((
tm
->
tm_hour
*
60
)
+
tm
->
tm_min
)
*
60
)
+
tm
->
tm_sec
+
(
fsec
/
1000000
e
0
))
/
(
double
)
SECS_PER_DAY
;
tm
->
tm_sec
+
(
fsec
/
1000000
.
0
))
/
(
double
)
SECS_PER_DAY
;
#else
#else
result
+=
((((
tm
->
tm_hour
*
60
)
+
tm
->
tm_min
)
*
60
)
+
result
+=
((((
tm
->
tm_hour
*
60
)
+
tm
->
tm_min
)
*
60
)
+
tm
->
tm_sec
+
fsec
)
/
(
double
)
SECS_PER_DAY
;
tm
->
tm_sec
+
fsec
)
/
(
double
)
SECS_PER_DAY
;
...
@@ -3468,7 +3468,7 @@ timestamp_part(PG_FUNCTION_ARGS)
...
@@ -3468,7 +3468,7 @@ timestamp_part(PG_FUNCTION_ARGS)
errmsg
(
"timestamp out of range"
)));
errmsg
(
"timestamp out of range"
)));
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
(
timestamptz
-
SetEpochTimestamp
())
/
1000000
e
0
;
result
=
(
timestamptz
-
SetEpochTimestamp
())
/
1000000
.
0
;
#else
#else
result
=
timestamptz
-
SetEpochTimestamp
();
result
=
timestamptz
-
SetEpochTimestamp
();
#endif
#endif
...
@@ -3560,17 +3560,17 @@ timestamptz_part(PG_FUNCTION_ARGS)
...
@@ -3560,17 +3560,17 @@ timestamptz_part(PG_FUNCTION_ARGS)
case
DTK_TZ_MINUTE
:
case
DTK_TZ_MINUTE
:
result
=
-
tz
;
result
=
-
tz
;
result
/=
60
;
result
/=
60
;
FMODULO
(
result
,
dummy
,
60
e
0
);
FMODULO
(
result
,
dummy
,
60
.
0
);
break
;
break
;
case
DTK_TZ_HOUR
:
case
DTK_TZ_HOUR
:
dummy
=
-
tz
;
dummy
=
-
tz
;
FMODULO
(
dummy
,
result
,
3600
e
0
);
FMODULO
(
dummy
,
result
,
3600
.
0
);
break
;
break
;
case
DTK_MICROSEC
:
case
DTK_MICROSEC
:
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
tm
->
tm_sec
*
1000000
e
0
+
fsec
;
result
=
tm
->
tm_sec
*
1000000
.
0
+
fsec
;
#else
#else
result
=
(
tm
->
tm_sec
+
fsec
)
*
1000000
;
result
=
(
tm
->
tm_sec
+
fsec
)
*
1000000
;
#endif
#endif
...
@@ -3578,7 +3578,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
...
@@ -3578,7 +3578,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
case
DTK_MILLISEC
:
case
DTK_MILLISEC
:
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
tm
->
tm_sec
*
1000
e0
+
fsec
/
1000e
0
;
result
=
tm
->
tm_sec
*
1000
.
0
+
fsec
/
1000
.
0
;
#else
#else
result
=
(
tm
->
tm_sec
+
fsec
)
*
1000
;
result
=
(
tm
->
tm_sec
+
fsec
)
*
1000
;
#endif
#endif
...
@@ -3586,7 +3586,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
...
@@ -3586,7 +3586,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
case
DTK_SECOND
:
case
DTK_SECOND
:
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
tm
->
tm_sec
+
fsec
/
1000000
e
0
;
result
=
tm
->
tm_sec
+
fsec
/
1000000
.
0
;
#else
#else
result
=
tm
->
tm_sec
+
fsec
;
result
=
tm
->
tm_sec
+
fsec
;
#endif
#endif
...
@@ -3652,7 +3652,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
...
@@ -3652,7 +3652,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
result
=
date2j
(
tm
->
tm_year
,
tm
->
tm_mon
,
tm
->
tm_mday
);
result
=
date2j
(
tm
->
tm_year
,
tm
->
tm_mon
,
tm
->
tm_mday
);
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
+=
((((
tm
->
tm_hour
*
60
)
+
tm
->
tm_min
)
*
60
)
+
result
+=
((((
tm
->
tm_hour
*
60
)
+
tm
->
tm_min
)
*
60
)
+
tm
->
tm_sec
+
(
fsec
/
1000000
e
0
))
/
(
double
)
SECS_PER_DAY
;
tm
->
tm_sec
+
(
fsec
/
1000000
.
0
))
/
(
double
)
SECS_PER_DAY
;
#else
#else
result
+=
((((
tm
->
tm_hour
*
60
)
+
tm
->
tm_min
)
*
60
)
+
result
+=
((((
tm
->
tm_hour
*
60
)
+
tm
->
tm_min
)
*
60
)
+
tm
->
tm_sec
+
fsec
)
/
(
double
)
SECS_PER_DAY
;
tm
->
tm_sec
+
fsec
)
/
(
double
)
SECS_PER_DAY
;
...
@@ -3674,7 +3674,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
...
@@ -3674,7 +3674,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
{
{
case
DTK_EPOCH
:
case
DTK_EPOCH
:
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
(
timestamp
-
SetEpochTimestamp
())
/
1000000
e
0
;
result
=
(
timestamp
-
SetEpochTimestamp
())
/
1000000
.
0
;
#else
#else
result
=
timestamp
-
SetEpochTimestamp
();
result
=
timestamp
-
SetEpochTimestamp
();
#endif
#endif
...
@@ -3751,7 +3751,7 @@ interval_part(PG_FUNCTION_ARGS)
...
@@ -3751,7 +3751,7 @@ interval_part(PG_FUNCTION_ARGS)
{
{
case
DTK_MICROSEC
:
case
DTK_MICROSEC
:
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
tm
->
tm_sec
*
1000000
e
0
+
fsec
;
result
=
tm
->
tm_sec
*
1000000
.
0
+
fsec
;
#else
#else
result
=
(
tm
->
tm_sec
+
fsec
)
*
1000000
;
result
=
(
tm
->
tm_sec
+
fsec
)
*
1000000
;
#endif
#endif
...
@@ -3759,7 +3759,7 @@ interval_part(PG_FUNCTION_ARGS)
...
@@ -3759,7 +3759,7 @@ interval_part(PG_FUNCTION_ARGS)
case
DTK_MILLISEC
:
case
DTK_MILLISEC
:
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
tm
->
tm_sec
*
1000
e0
+
fsec
/
1000e
0
;
result
=
tm
->
tm_sec
*
1000
.
0
+
fsec
/
1000
.
0
;
#else
#else
result
=
(
tm
->
tm_sec
+
fsec
)
*
1000
;
result
=
(
tm
->
tm_sec
+
fsec
)
*
1000
;
#endif
#endif
...
@@ -3767,7 +3767,7 @@ interval_part(PG_FUNCTION_ARGS)
...
@@ -3767,7 +3767,7 @@ interval_part(PG_FUNCTION_ARGS)
case
DTK_SECOND
:
case
DTK_SECOND
:
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
tm
->
tm_sec
+
fsec
/
1000000
e
0
;
result
=
tm
->
tm_sec
+
fsec
/
1000000
.
0
;
#else
#else
result
=
tm
->
tm_sec
+
fsec
;
result
=
tm
->
tm_sec
+
fsec
;
#endif
#endif
...
@@ -3831,7 +3831,7 @@ interval_part(PG_FUNCTION_ARGS)
...
@@ -3831,7 +3831,7 @@ interval_part(PG_FUNCTION_ARGS)
else
if
(
type
==
RESERV
&&
val
==
DTK_EPOCH
)
else
if
(
type
==
RESERV
&&
val
==
DTK_EPOCH
)
{
{
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
result
=
interval
->
time
/
1000000
e
0
;
result
=
interval
->
time
/
1000000
.
0
;
#else
#else
result
=
interval
->
time
;
result
=
interval
->
time
;
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录