Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
9f194709
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,发现更多精彩内容 >>
提交
9f194709
编写于
5月 20, 2008
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Simplify code in formatting.c now that to upper/lower/initcase do not
modify the passed string.
上级
abb5fd86
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
65 deletion
+15
-65
src/backend/utils/adt/formatting.c
src/backend/utils/adt/formatting.c
+15
-65
未找到文件。
src/backend/utils/adt/formatting.c
浏览文件 @
9f194709
/* -----------------------------------------------------------------------
* formatting.c
*
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.14
0 2008/05/19 18:08:15 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.14
1 2008/05/20 01:41:02 momjian
Exp $
*
*
* Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group
...
...
@@ -1894,10 +1894,7 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out)
if
(
!
tm
->
tm_mon
)
break
;
if
(
S_TM
(
n
->
suffix
))
{
strcpy
(
workbuff
,
localized_full_months
[
tm
->
tm_mon
-
1
]);
sprintf
(
s
,
"%*s"
,
0
,
str_toupper
(
workbuff
));
}
strcpy
(
s
,
str_toupper
(
localized_full_months
[
tm
->
tm_mon
-
1
]));
else
{
strcpy
(
workbuff
,
months_full
[
tm
->
tm_mon
-
1
]);
...
...
@@ -1910,14 +1907,9 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out)
if
(
!
tm
->
tm_mon
)
break
;
if
(
S_TM
(
n
->
suffix
))
{
strcpy
(
workbuff
,
localized_full_months
[
tm
->
tm_mon
-
1
]);
sprintf
(
s
,
"%*s"
,
0
,
str_initcap
(
workbuff
));
}
strcpy
(
s
,
str_initcap
(
localized_full_months
[
tm
->
tm_mon
-
1
]));
else
{
sprintf
(
s
,
"%*s"
,
S_FM
(
n
->
suffix
)
?
0
:
-
9
,
months_full
[
tm
->
tm_mon
-
1
]);
}
s
+=
strlen
(
s
);
break
;
case
DCH_month
:
...
...
@@ -1925,10 +1917,7 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out)
if
(
!
tm
->
tm_mon
)
break
;
if
(
S_TM
(
n
->
suffix
))
{
strcpy
(
workbuff
,
localized_full_months
[
tm
->
tm_mon
-
1
]);
sprintf
(
s
,
"%*s"
,
0
,
str_tolower
(
workbuff
));
}
strcpy
(
s
,
str_tolower
(
localized_full_months
[
tm
->
tm_mon
-
1
]));
else
{
sprintf
(
s
,
"%*s"
,
S_FM
(
n
->
suffix
)
?
0
:
-
9
,
months_full
[
tm
->
tm_mon
-
1
]);
...
...
@@ -1941,15 +1930,9 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out)
if
(
!
tm
->
tm_mon
)
break
;
if
(
S_TM
(
n
->
suffix
))
{
strcpy
(
workbuff
,
localized_abbrev_months
[
tm
->
tm_mon
-
1
]);
sprintf
(
s
,
"%*s"
,
0
,
str_toupper
(
workbuff
));
}
strcpy
(
s
,
str_toupper
(
localized_abbrev_months
[
tm
->
tm_mon
-
1
]));
else
{
strcpy
(
workbuff
,
months
[
tm
->
tm_mon
-
1
]);
sprintf
(
s
,
"%*s"
,
0
,
str_toupper
(
workbuff
));
}
strcpy
(
s
,
str_toupper
(
months
[
tm
->
tm_mon
-
1
]));
s
+=
strlen
(
s
);
break
;
case
DCH_Mon
:
...
...
@@ -1957,14 +1940,9 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out)
if
(
!
tm
->
tm_mon
)
break
;
if
(
S_TM
(
n
->
suffix
))
{
strcpy
(
workbuff
,
localized_abbrev_months
[
tm
->
tm_mon
-
1
]);
sprintf
(
s
,
"%*s"
,
0
,
str_initcap
(
workbuff
));
}
strcpy
(
s
,
str_initcap
(
localized_abbrev_months
[
tm
->
tm_mon
-
1
]));
else
{
strcpy
(
s
,
months
[
tm
->
tm_mon
-
1
]);
}
s
+=
strlen
(
s
);
break
;
case
DCH_mon
:
...
...
@@ -1972,10 +1950,7 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out)
if
(
!
tm
->
tm_mon
)
break
;
if
(
S_TM
(
n
->
suffix
))
{
strcpy
(
workbuff
,
localized_abbrev_months
[
tm
->
tm_mon
-
1
]);
sprintf
(
s
,
"%*s"
,
0
,
str_tolower
(
workbuff
));
}
strcpy
(
s
,
str_tolower
(
localized_abbrev_months
[
tm
->
tm_mon
-
1
]));
else
{
strcpy
(
s
,
months
[
tm
->
tm_mon
-
1
]);
...
...
@@ -1992,10 +1967,7 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out)
case
DCH_DAY
:
INVALID_FOR_INTERVAL
;
if
(
S_TM
(
n
->
suffix
))
{
strcpy
(
workbuff
,
localized_full_days
[
tm
->
tm_wday
]);
sprintf
(
s
,
"%*s"
,
0
,
str_toupper
(
workbuff
));
}
strcpy
(
s
,
str_toupper
(
localized_full_days
[
tm
->
tm_wday
]));
else
{
strcpy
(
workbuff
,
days
[
tm
->
tm_wday
]);
...
...
@@ -2006,23 +1978,15 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out)
case
DCH_Day
:
INVALID_FOR_INTERVAL
;
if
(
S_TM
(
n
->
suffix
))
{
strcpy
(
workbuff
,
localized_full_days
[
tm
->
tm_wday
]);
sprintf
(
s
,
"%*s"
,
0
,
str_initcap
(
workbuff
));
}
strcpy
(
s
,
str_initcap
(
localized_full_days
[
tm
->
tm_wday
]));
else
{
sprintf
(
s
,
"%*s"
,
S_FM
(
n
->
suffix
)
?
0
:
-
9
,
days
[
tm
->
tm_wday
]);
}
s
+=
strlen
(
s
);
break
;
case
DCH_day
:
INVALID_FOR_INTERVAL
;
if
(
S_TM
(
n
->
suffix
))
{
strcpy
(
workbuff
,
localized_full_days
[
tm
->
tm_wday
]);
sprintf
(
s
,
"%*s"
,
0
,
str_tolower
(
workbuff
));
}
strcpy
(
s
,
str_tolower
(
localized_full_days
[
tm
->
tm_wday
]));
else
{
sprintf
(
s
,
"%*s"
,
S_FM
(
n
->
suffix
)
?
0
:
-
9
,
days
[
tm
->
tm_wday
]);
...
...
@@ -2033,37 +1997,23 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out)
case
DCH_DY
:
INVALID_FOR_INTERVAL
;
if
(
S_TM
(
n
->
suffix
))
{
strcpy
(
workbuff
,
localized_abbrev_days
[
tm
->
tm_wday
]);
sprintf
(
s
,
"%*s"
,
0
,
str_toupper
(
workbuff
));
}
strcpy
(
s
,
str_toupper
(
localized_abbrev_days
[
tm
->
tm_wday
]));
else
{
strcpy
(
workbuff
,
days_short
[
tm
->
tm_wday
]);
sprintf
(
s
,
"%*s"
,
0
,
str_toupper
(
workbuff
));
}
strcpy
(
s
,
str_toupper
(
days_short
[
tm
->
tm_wday
]));
s
+=
strlen
(
s
);
break
;
case
DCH_Dy
:
INVALID_FOR_INTERVAL
;
if
(
S_TM
(
n
->
suffix
))
{
strcpy
(
workbuff
,
localized_abbrev_days
[
tm
->
tm_wday
]);
sprintf
(
s
,
"%*s"
,
0
,
str_initcap
(
workbuff
));
}
strcpy
(
s
,
str_initcap
(
localized_abbrev_days
[
tm
->
tm_wday
]));
else
{
strcpy
(
s
,
days_short
[
tm
->
tm_wday
]);
}
s
+=
strlen
(
s
);
break
;
case
DCH_dy
:
INVALID_FOR_INTERVAL
;
if
(
S_TM
(
n
->
suffix
))
{
strcpy
(
workbuff
,
localized_abbrev_days
[
tm
->
tm_wday
]);
sprintf
(
s
,
"%*s"
,
0
,
str_tolower
(
workbuff
));
}
strcpy
(
s
,
str_tolower
(
localized_abbrev_days
[
tm
->
tm_wday
]));
else
{
strcpy
(
s
,
days_short
[
tm
->
tm_wday
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录