Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
4a9c2390
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,发现更多精彩内容 >>
提交
4a9c2390
编写于
3月 15, 1999
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix brain death in !!= operator ... it's still pretty bogus
but at least now it does what it's supposed to do ...
上级
265c283e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
25 deletion
+32
-25
src/backend/utils/adt/not_in.c
src/backend/utils/adt/not_in.c
+30
-23
src/include/utils/builtins.h
src/include/utils/builtins.h
+2
-2
未找到文件。
src/backend/utils/adt/not_in.c
浏览文件 @
4a9c2390
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.1
4 1999/02/13 23:19:26 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.1
5 1999/03/15 03:24:32 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -36,11 +36,10 @@ static int my_varattno(Relation rd, char *a);
* ----------------------------------------------------------------
*/
bool
int4notin
(
int
16
not_in_arg
,
char
*
relation_and_attr
)
int4notin
(
int
32
not_in_arg
,
char
*
relation_and_attr
)
{
Relation
relation_to_scan
;
int
left_side_argument
,
integer_value
;
int32
integer_value
;
HeapTuple
current_tuple
;
HeapScanDesc
scan_descriptor
;
bool
dummy
,
...
...
@@ -48,47 +47,55 @@ int4notin(int16 not_in_arg, char *relation_and_attr)
int
attrid
;
char
*
relation
,
*
attribute
;
char
my_copy
[
3
2
];
char
my_copy
[
NAMEDATALEN
*
2
+
2
];
Datum
value
;
NameData
relNameData
;
ScanKeyData
skeyData
;
strcpy
(
my_copy
,
relation_and_attr
);
strncpy
(
my_copy
,
relation_and_attr
,
sizeof
(
my_copy
));
my_copy
[
sizeof
(
my_copy
)
-
1
]
=
'\0'
;
relation
=
(
char
*
)
strtok
(
my_copy
,
"."
);
attribute
=
(
char
*
)
strtok
(
NULL
,
"."
);
if
(
attribute
==
NULL
)
{
elog
(
ERROR
,
"int4notin: must provide relationname.attributename"
);
}
/* Open the relation and get a relation descriptor */
/* fetch tuple OID */
left_side_argument
=
not_in_arg
;
relation_to_scan
=
heap_openr
(
relation
);
if
(
!
RelationIsValid
(
relation_to_scan
))
{
elog
(
ERROR
,
"int4notin: unknown relation %s"
,
relation
);
}
/*
Open the relation and get a relation descriptor
*/
/*
Find the column to search
*/
namestrcpy
(
&
relNameData
,
relation
);
relation_to_scan
=
heap_openr
(
relNameData
.
data
);
attrid
=
my_varattno
(
relation_to_scan
,
attribute
);
if
(
attrid
<
0
)
{
elog
(
ERROR
,
"int4notin: unknown attribute %s for relation %s"
,
attribute
,
relation
);
}
/* the last argument should be a ScanKey, not an integer! - jolly */
/* it looks like the arguments are out of order, too */
/* but skeyData is never initialized! does this work?? - ay 2/95 */
scan_descriptor
=
heap_beginscan
(
relation_to_scan
,
false
,
SnapshotNow
,
0
,
&
skeyData
);
0
,
(
ScanKey
)
NULL
);
retval
=
true
;
/* do a scan of the relation, and do the check */
while
(
HeapTupleIsValid
(
current_tuple
=
heap_getnext
(
scan_descriptor
,
0
))
&&
retval
)
while
(
HeapTupleIsValid
(
current_tuple
=
heap_getnext
(
scan_descriptor
,
0
)))
{
value
=
heap_getattr
(
current_tuple
,
(
AttrNumber
)
attrid
,
RelationGetDescr
(
relation_to_scan
),
&
dummy
);
i
nteger_value
=
DatumGetInt16
(
value
);
if
(
left_side_argument
==
integer_value
)
integer_value
=
DatumGetInt32
(
value
);
i
f
(
not_in_arg
==
integer_value
)
{
retval
=
false
;
break
;
/* can stop scanning now */
}
}
/* close the relation */
...
...
src/include/utils/builtins.h
浏览文件 @
4a9c2390
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: builtins.h,v 1.7
6 1999/03/14 16:44:01 momjian
Exp $
* $Id: builtins.h,v 1.7
7 1999/03/15 03:24:31 tgl
Exp $
*
* NOTES
* This should normally only be included by fmgr.h.
...
...
@@ -331,7 +331,7 @@ extern int32 userfntest(int i);
#define NonNullValue(v,b) nonnullvalue(v,b)
/* not_in.c */
extern
bool
int4notin
(
int
16
not_in_arg
,
char
*
relation_and_attr
);
extern
bool
int4notin
(
int
32
not_in_arg
,
char
*
relation_and_attr
);
extern
bool
oidnotin
(
Oid
the_oid
,
char
*
compare
);
/* oid.c */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录