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

Commitff239c3

Browse files
committed
Silence compilers about extractNotNullColumn()
Multiple buildfarm animals warn that a newly added Assert() isimpossible to fail; remove it to avoid the noise. While at it, usedirect assignment to obtain the value we need, avoiding an unnecessarymemcpy().(I decided to remove the "pfree" call for the detoasted short-datum;because this is only used for DDL, it's not problematic to leak such asmall allocation.)Noted by Tom Lane about14e87ff.Discussion:https://postgr.es/m/3649828.1731083171@sss.pgh.pa.us
1 parent3f323eb commitff239c3

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

‎src/backend/catalog/pg_constraint.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,6 @@ findDomainNotNullConstraint(Oid typid)
688688
AttrNumber
689689
extractNotNullColumn(HeapTupleconstrTup)
690690
{
691-
AttrNumbercolnum;
692691
Datumadatum;
693692
ArrayType*arr;
694693

@@ -704,13 +703,9 @@ extractNotNullColumn(HeapTuple constrTup)
704703
ARR_DIMS(arr)[0]!=1)
705704
elog(ERROR,"conkey is not a 1-D smallint array");
706705

707-
memcpy(&colnum,ARR_DATA_PTR(arr),sizeof(AttrNumber));
708-
Assert(colnum>0&&colnum <=MaxAttrNumber);
706+
/* We leak the detoasted datum, but we don't care */
709707

710-
if ((Pointer)arr!=DatumGetPointer(adatum))
711-
pfree(arr);/* free de-toasted copy, if any */
712-
713-
returncolnum;
708+
return ((AttrNumber*)ARR_DATA_PTR(arr))[0];
714709
}
715710

716711
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp