Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
317acd08
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,发现更多精彩内容 >>
提交
317acd08
编写于
10月 25, 1997
作者:
T
Thomas G. Lockhart
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add conversions for int2 and int4 to and from text.
上级
2c1557a2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
91 addition
and
8 deletion
+91
-8
src/backend/utils/adt/int.c
src/backend/utils/adt/int.c
+91
-8
未找到文件。
src/backend/utils/adt/int.c
浏览文件 @
317acd08
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.
8 1997/09/08 21:48:29 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.
9 1997/10/25 05:19:22 thomas
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -16,7 +16,7 @@
* I/O routines:
* int2in, int2out, int28in, int28out, int4in, int4out
* Conversion routines:
* itoi
* itoi
, int2_text, int4_text
* Boolean operators:
* inteq, intne, intlt, intle, intgt, intge
* Arithmetic operators:
...
...
@@ -29,6 +29,7 @@
* fix me when we figure out what we want to do about ANSIfication...
*/
#include <stdio.h>
#include <string.h>
#include "postgres.h"
#include "fmgr.h"
...
...
@@ -50,7 +51,7 @@ int2in(char *num)
/*
* int2out - converts short to "num"
*/
char
*
char
*
int2out
(
int16
sh
)
{
char
*
result
;
...
...
@@ -66,7 +67,7 @@ int2out(int16 sh)
* Note:
* Fills any nonexistent digits with NULLs.
*/
int16
*
int16
*
int28in
(
char
*
shs
)
{
register
int16
(
*
result
)[];
...
...
@@ -95,7 +96,7 @@ int28in(char *shs)
/*
* int28out - converts internal form to "num num ..."
*/
char
*
char
*
int28out
(
int16
(
*
shs
)[])
{
register
int
num
;
...
...
@@ -130,7 +131,7 @@ int28out(int16 (*shs)[])
* Note:
* Fills any nonexistent digits with NULLs.
*/
int32
*
int32
*
int44in
(
char
*
input_string
)
{
int32
*
foo
=
(
int32
*
)
palloc
(
4
*
sizeof
(
int32
));
...
...
@@ -151,7 +152,7 @@ int44in(char *input_string)
/*
* int28out - converts internal form to "num num ..."
*/
char
*
char
*
int44out
(
int32
an_array
[])
{
int
temp
=
4
;
...
...
@@ -194,7 +195,7 @@ int4in(char *num)
/*
* int4out - converts int4 to "num"
*/
char
*
char
*
int4out
(
int32
l
)
{
char
*
result
;
...
...
@@ -228,6 +229,88 @@ i4toi2(int32 arg1)
return
((
int16
)
arg1
);
}
text
*
int2_text
(
int16
arg1
)
{
text
*
result
;
int
len
;
char
*
str
;
str
=
int2out
(
arg1
);
len
=
(
strlen
(
str
)
+
VARHDRSZ
);
result
=
PALLOC
(
len
);
VARSIZE
(
result
)
=
len
;
memmove
(
VARDATA
(
result
),
str
,
(
len
-
VARHDRSZ
));
PFREE
(
str
);
return
(
result
);
}
/* int2_text() */
int16
text_int2
(
text
*
string
)
{
int16
result
;
int
len
;
char
*
str
;
len
=
(
VARSIZE
(
string
)
-
VARHDRSZ
);
str
=
PALLOC
(
len
+
1
);
memmove
(
str
,
VARDATA
(
string
),
len
);
*
(
str
+
len
)
=
'\0'
;
result
=
int2in
(
str
);
PFREE
(
str
);
return
(
result
);
}
/* text_int2() */
text
*
int4_text
(
int32
arg1
)
{
text
*
result
;
int
len
;
char
*
str
;
str
=
int4out
(
arg1
);
len
=
(
strlen
(
str
)
+
VARHDRSZ
);
result
=
PALLOC
(
len
);
VARSIZE
(
result
)
=
len
;
memmove
(
VARDATA
(
result
),
str
,
(
len
-
VARHDRSZ
));
PFREE
(
str
);
return
(
result
);
}
/* int4_text() */
int32
text_int4
(
text
*
string
)
{
int32
result
;
int
len
;
char
*
str
;
len
=
(
VARSIZE
(
string
)
-
VARHDRSZ
);
str
=
PALLOC
(
len
+
1
);
memmove
(
str
,
VARDATA
(
string
),
len
);
*
(
str
+
len
)
=
'\0'
;
result
=
int4in
(
str
);
PFREE
(
str
);
return
(
result
);
}
/* text_int4() */
/*
* =========================
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录