Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
3dd23aad
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,发现更多精彩内容 >>
提交
3dd23aad
编写于
8月 22, 1997
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow functions and operators on internally-identical types to succeed.
上级
0ab29212
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
33 addition
and
8 deletion
+33
-8
src/backend/parser/analyze.c
src/backend/parser/analyze.c
+2
-2
src/backend/parser/catalog_utils.c
src/backend/parser/catalog_utils.c
+12
-2
src/backend/parser/parse_query.c
src/backend/parser/parse_query.c
+3
-2
src/backend/parser/parser.c
src/backend/parser/parser.c
+14
-1
src/include/catalog/pg_type.h
src/include/catalog/pg_type.h
+2
-1
未找到文件。
src/backend/parser/analyze.c
浏览文件 @
3dd23aad
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.3
4 1997/08/19 21:32:11
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.3
5 1997/08/22 00:02:04
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1345,7 +1345,7 @@ make_targetlist_expr(ParseState *pstate,
} else
if (attrtype != type_id) {
if ((attrtype == INT2OID) && (type_id == INT4OID))
lfirst(expr) = lispInteger (INT2OID);
lfirst(expr) = lispInteger (INT2OID);
do CASHOID too
else if ((attrtype == FLOAT4OID) && (type_id == FLOAT8OID))
lfirst(expr) = lispInteger (FLOAT4OID);
else
...
...
src/backend/parser/catalog_utils.c
浏览文件 @
3dd23aad
...
...
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.2
1 1997/08/19 21:32:12
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.2
2 1997/08/22 00:02:05
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -373,6 +373,7 @@ equivalentOpersAfterPromotion(CandidateList candidates)
case
FLOAT4OID
:
case
INT4OID
:
case
INT2OID
:
case
CASHOID
:
c
->
args
[
0
]
=
FLOAT8OID
;
break
;
default:
...
...
@@ -383,6 +384,7 @@ equivalentOpersAfterPromotion(CandidateList candidates)
case
FLOAT4OID
:
case
INT4OID
:
case
INT2OID
:
case
CASHOID
:
c
->
args
[
1
]
=
FLOAT8OID
;
break
;
default:
...
...
@@ -570,6 +572,7 @@ unary_oper_get_candidates(char *op,
opKey
[
1
].
sk_argument
=
CharGetDatum
(
rightleft
);
/* currently, only "unknown" can be coerced */
/* but we should allow types that are internally the same to be "coerced" */
if
(
typeId
!=
UNKNOWNOID
)
{
return
0
;
}
...
...
@@ -956,7 +959,14 @@ can_coerce(int nargs, Oid *input_typeids, Oid *func_typeids)
*/
for
(
i
=
0
;
i
<
nargs
;
i
++
)
{
if
(
input_typeids
[
i
]
!=
func_typeids
[
i
])
{
if
(
input_typeids
[
i
]
!=
UNKNOWNOID
||
func_typeids
[
i
]
==
0
)
if
((
input_typeids
[
i
]
==
BPCHAROID
&&
func_typeids
[
i
]
==
TEXTOID
)
||
(
input_typeids
[
i
]
==
BPCHAROID
&&
func_typeids
[
i
]
==
VARCHAROID
)
||
(
input_typeids
[
i
]
==
VARCHAROID
&&
func_typeids
[
i
]
==
TEXTOID
)
||
(
input_typeids
[
i
]
==
VARCHAROID
&&
func_typeids
[
i
]
==
BPCHAROID
)
||
(
input_typeids
[
i
]
==
CASHOID
&&
func_typeids
[
i
]
==
INT4OID
)
||
(
input_typeids
[
i
]
==
INT4OID
&&
func_typeids
[
i
]
==
CASHOID
))
;
/* these are OK */
else
if
(
input_typeids
[
i
]
!=
UNKNOWNOID
||
func_typeids
[
i
]
==
0
)
return
false
;
tp
=
get_id_type
(
input_typeids
[
i
]);
...
...
src/backend/parser/parse_query.c
浏览文件 @
3dd23aad
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.1
7 1997/08/19 21:32:16
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.1
8 1997/08/22 00:02:07
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -378,7 +378,8 @@ make_op(char *opname, Node *ltree, Node *rtree)
(t) == INT4OID || \
(t) == OIDOID || \
(t) == FLOAT4OID || \
(t) == FLOAT8OID)
(t) == FLOAT8OID || \
(t) == CASHOID)
/* binary operator */
ltypeId
=
(
ltree
==
NULL
)
?
UNKNOWNOID
:
exprType
(
ltree
);
...
...
src/backend/parser/parser.c
浏览文件 @
3dd23aad
...
...
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.2
0 1997/08/03 02:28:10
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.2
1 1997/08/22 00:02:08
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -238,6 +238,13 @@ parser_typecast(Value *expr, TypeName *typename, int typlen)
string_palloced = true;
sprintf(const_string,"%f", ((Const)lnext(expr))->constvalue);
break;
case CASHOID: /* money */
const_string = (char *) palloc(256);
string_palloced = true;
sprintf(const_string,"%ld",
(int) ((Const*)expr)->constvalue);
break;
case TEXTOID: /* text */
const_string = DatumGetPointer(((Const)lnext(expr))->constvalue);
...
...
@@ -350,6 +357,12 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
sprintf
(
const_string
,
"%f"
,
*
floatVal
);
break
;
}
case
CASHOID
:
/* money */
const_string
=
(
char
*
)
palloc
(
256
);
string_palloced
=
true
;
sprintf
(
const_string
,
"%ld"
,
(
long
)
((
Const
*
)
expr
)
->
constvalue
);
break
;
case
TEXTOID
:
/* text */
const_string
=
DatumGetPointer
(((
Const
*
)
expr
)
->
constvalue
);
...
...
src/include/catalog/pg_type.h
浏览文件 @
3dd23aad
...
...
@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_type.h,v 1.1
4 1997/08/21 01:37:55 vadim
Exp $
* $Id: pg_type.h,v 1.1
5 1997/08/22 00:02:19 momjian
Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
...
...
@@ -242,6 +242,7 @@ DATA(insert OID = 705 ( unknown PGUID -1 -1 f b t \054 0 18 textin textout
DATA
(
insert
OID
=
718
(
circle
PGUID
24
47
f
b
t
\
054
0
0
circle_in
circle_out
circle_in
circle_out
d
_null_
));
DATA
(
insert
OID
=
719
(
_circle
PGUID
-
1
-
1
f
b
t
\
054
0
718
array_in
array_out
array_in
array_out
d
_null_
));
DATA
(
insert
OID
=
790
(
money
PGUID
4
24
f
b
t
\
054
0
0
cash_in
cash_out
cash_in
cash_out
i
_null_
));
#define CASHOID 790
DATA
(
insert
OID
=
791
(
_money
PGUID
-
1
-
1
f
b
t
\
054
0
790
array_in
array_out
array_in
array_out
i
_null_
));
/* OIDS 800 - 899 */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录