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

Commitedda32e

Browse files
committed
Fix compiler warning
Rewrite get_attgenerated() to avoid compiler warning if the compilerdoes not recognize that elog(ERROR) does not return.Reported-by: David Rowley <david.rowley@2ndquadrant.com>
1 parent82150a0 commitedda32e

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

‎src/backend/utils/cache/lsyscache.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -836,22 +836,19 @@ char
836836
get_attgenerated(Oidrelid,AttrNumberattnum)
837837
{
838838
HeapTupletp;
839+
Form_pg_attributeatt_tup;
840+
charresult;
839841

840842
tp=SearchSysCache2(ATTNUM,
841843
ObjectIdGetDatum(relid),
842844
Int16GetDatum(attnum));
843-
if (HeapTupleIsValid(tp))
844-
{
845-
Form_pg_attributeatt_tup= (Form_pg_attribute)GETSTRUCT(tp);
846-
charresult;
847-
848-
result=att_tup->attgenerated;
849-
ReleaseSysCache(tp);
850-
returnresult;
851-
}
852-
else
845+
if (!HeapTupleIsValid(tp))
853846
elog(ERROR,"cache lookup failed for attribute %d of relation %u",
854847
attnum,relid);
848+
att_tup= (Form_pg_attribute)GETSTRUCT(tp);
849+
result=att_tup->attgenerated;
850+
ReleaseSysCache(tp);
851+
returnresult;
855852
}
856853

857854
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp