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

Commit3b81617

Browse files
committed
Make DatumGetInetP() unpack inet datums with a 1-byte header, and add
a new macro, DatumGetInetPP(), that does not. This brings these macrosin line with other DatumGet*P() macros.Backpatch to 8.3, where 1-byte header varlenas were introduced.
1 parent0e1c4b7 commit3b81617

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎src/backend/utils/adt/network.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ convert_network_to_scalar(Datum value, Oid typid)
907907
caseINETOID:
908908
caseCIDROID:
909909
{
910-
inet*ip=DatumGetInetP(value);
910+
inet*ip=DatumGetInetPP(value);
911911
intlen;
912912
doubleres;
913913
inti;

‎src/include/utils/inet.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ typedef struct macaddr
7070
/*
7171
* fmgr interface macros
7272
*/
73-
#defineDatumGetInetP(X)((inet *) PG_DETOAST_DATUM_PACKED(X))
73+
#defineDatumGetInetP(X)((inet *) PG_DETOAST_DATUM(X))
74+
#defineDatumGetInetPP(X)((inet *) PG_DETOAST_DATUM_PACKED(X))
7475
#defineInetPGetDatum(X)PointerGetDatum(X)
7576
#definePG_GETARG_INET_P(n) DatumGetInetP(PG_GETARG_DATUM(n))
77+
#definePG_GETARG_INET_PP(n) DatumGetInetP(PG_GETARG_DATUM_PACKED(n))
7678
#definePG_RETURN_INET_P(x) return InetPGetDatum(x)
7779
/* macaddr is a fixed-length pass-by-reference datatype */
7880
#defineDatumGetMacaddrP(X) ((macaddr *) DatumGetPointer(X))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp