Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
5285b357
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,发现更多精彩内容 >>
提交
5285b357
编写于
2月 27, 2005
作者:
N
Neil Conway
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add explicit casts between int4 and boolean. Patch from Sean Chittenden,
editorializing by Neil Conway. Catalog version bumped.
上级
2d22f161
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
36 addition
and
6 deletion
+36
-6
src/backend/utils/adt/int.c
src/backend/utils/adt/int.c
+20
-1
src/include/catalog/catversion.h
src/include/catalog/catversion.h
+2
-2
src/include/catalog/pg_cast.h
src/include/catalog/pg_cast.h
+5
-1
src/include/catalog/pg_proc.h
src/include/catalog/pg_proc.h
+6
-1
src/include/utils/builtins.h
src/include/utils/builtins.h
+3
-1
未找到文件。
src/backend/utils/adt/int.c
浏览文件 @
5285b357
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/int.c,v 1.6
4 2004/12/31 22:01:22 pgsql
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/int.c,v 1.6
5 2005/02/27 08:31:30 neilc
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -361,6 +361,25 @@ text_int4(PG_FUNCTION_ARGS)
return
result
;
}
/* Cast int4 -> bool */
Datum
int4_bool
(
PG_FUNCTION_ARGS
)
{
if
(
PG_GETARG_INT32
(
0
)
==
0
)
PG_RETURN_BOOL
(
false
);
else
PG_RETURN_BOOL
(
true
);
}
/* Cast bool -> int4 */
Datum
bool_int4
(
PG_FUNCTION_ARGS
)
{
if
(
PG_GETARG_BOOL
(
0
)
==
false
)
PG_RETURN_INT32
(
0
);
else
PG_RETURN_INT32
(
1
);
}
/*
* ============================
...
...
src/include/catalog/catversion.h
浏览文件 @
5285b357
...
...
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.25
5 2005/02/26 18:43:34 tgl
Exp $
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.25
6 2005/02/27 08:31:30 neilc
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 2005022
6
1
#define CATALOG_VERSION_NO 2005022
7
1
#endif
src/include/catalog/pg_cast.h
浏览文件 @
5285b357
...
...
@@ -10,7 +10,7 @@
*
* Copyright (c) 2002-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/include/catalog/pg_cast.h,v 1.1
7 2005/01/01 05:43:09 momjian
Exp $
* $PostgreSQL: pgsql/src/include/catalog/pg_cast.h,v 1.1
8 2005/02/27 08:31:30 neilc
Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
...
...
@@ -101,6 +101,10 @@ DATA(insert ( 1700 23 1744 a ));
DATA
(
insert
(
1700
700
1745
i
));
DATA
(
insert
(
1700
701
1746
i
));
/* Allow explicit coercions between int4 and bool */
DATA
(
insert
(
23
16
2557
e
));
DATA
(
insert
(
16
23
2558
e
));
/*
* OID category: allow implicit conversion from any integral type (including
* int8, to support OID literals > 2G) to OID, as well as assignment coercion
...
...
src/include/catalog/pg_proc.h
浏览文件 @
5285b357
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.35
0 2005/02/26 18:43:34 tgl
Exp $
* $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.35
1 2005/02/27 08:31:30 neilc
Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
...
...
@@ -3604,6 +3604,11 @@ DATA(insert OID = 2550 ( integer_pl_date PGNSP PGUID 14 f f t f i 2 1082 "23 1
DATA
(
insert
OID
=
2556
(
pg_tablespace_databases
PGNSP
PGUID
12
f
f
t
t
s
1
26
"26"
_null_
pg_tablespace_databases
-
_null_
));
DESCR
(
"returns database oids in a tablespace"
);
DATA
(
insert
OID
=
2557
(
bool
PGNSP
PGUID
12
f
f
t
f
i
1
16
"23"
_null_
int4_bool
-
_null_
));
DESCR
(
"convert int4 to boolean"
);
DATA
(
insert
OID
=
2558
(
int4
PGNSP
PGUID
12
f
f
t
f
i
1
23
"16"
_null_
bool_int4
-
_null_
));
DESCR
(
"convert boolean to int4"
);
/*
* Symbolic values for provolatile column: these indicate whether the result
...
...
src/include/utils/builtins.h
浏览文件 @
5285b357
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.25
2 2004/12/31 22:03:45 pgsql
Exp $
* $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.25
3 2005/02/27 08:31:30 neilc
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -111,6 +111,8 @@ extern Datum i2toi4(PG_FUNCTION_ARGS);
extern
Datum
i4toi2
(
PG_FUNCTION_ARGS
);
extern
Datum
int2_text
(
PG_FUNCTION_ARGS
);
extern
Datum
text_int2
(
PG_FUNCTION_ARGS
);
extern
Datum
int4_bool
(
PG_FUNCTION_ARGS
);
extern
Datum
bool_int4
(
PG_FUNCTION_ARGS
);
extern
Datum
int4_text
(
PG_FUNCTION_ARGS
);
extern
Datum
text_int4
(
PG_FUNCTION_ARGS
);
extern
Datum
int4eq
(
PG_FUNCTION_ARGS
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录