Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d81364

Browse files
committed
more comments for fill_type_cmp_fmgr_info()
1 parentdc86c76 commit7d81364

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎src/utils.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ fill_type_cmp_fmgr_info(FmgrInfo *finfo, Oid type1, Oid type2)
6767
TypeCacheEntry*tce_1,
6868
*tce_2;
6969

70+
/* Check type compatibility */
7071
if (IsBinaryCoercible(type1,type2))
7172
type1=type2;
7273

@@ -76,6 +77,7 @@ fill_type_cmp_fmgr_info(FmgrInfo *finfo, Oid type1, Oid type2)
7677
tce_1=lookup_type_cache(type1,TYPECACHE_BTREE_OPFAMILY);
7778
tce_2=lookup_type_cache(type2,TYPECACHE_BTREE_OPFAMILY);
7879

80+
/* Both types should belong to the same opfamily */
7981
if (tce_1->btree_opf!=tce_2->btree_opf)
8082
gotofill_type_cmp_fmgr_info_error;
8183

@@ -84,13 +86,16 @@ fill_type_cmp_fmgr_info(FmgrInfo *finfo, Oid type1, Oid type2)
8486
tce_2->btree_opintype,
8587
BTORDER_PROC);
8688

87-
if (cmp_proc_oid==InvalidOid)
89+
/* No such function, emit ERROR */
90+
if (!OidIsValid(cmp_proc_oid))
8891
gotofill_type_cmp_fmgr_info_error;
8992

93+
/* Fill FmgrInfo struct */
9094
fmgr_info(cmp_proc_oid,finfo);
9195

92-
return;/*exit safely */
96+
return;/*everything is OK */
9397

98+
/* Handle errors (no such function) */
9499
fill_type_cmp_fmgr_info_error:
95100
elog(ERROR,"missing comparison function for types %s & %s",
96101
format_type_be(type1),format_type_be(type2));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp