diff options
Diffstat (limited to 'src/backend/utils/adt/datum.c')
-rw-r--r-- | src/backend/utils/adt/datum.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/utils/adt/datum.c b/src/backend/utils/adt/datum.c index 803ba4752e9..c6c296b9609 100644 --- a/src/backend/utils/adt/datum.c +++ b/src/backend/utils/adt/datum.c @@ -257,7 +257,7 @@ datumIsEqual(Datum value1, Datum value2, bool typByVal, int typLen) Size datumEstimateSpace(Datum value, bool isnull, bool typByVal, int typLen) { - Size sz = sizeof(int); + Size sz = sizeof(int); if (!isnull) { @@ -267,6 +267,7 @@ datumEstimateSpace(Datum value, bool isnull, bool typByVal, int typLen) else if (VARATT_IS_EXTERNAL_EXPANDED(value)) { ExpandedObjectHeader *eoh = DatumGetEOHP(value); + sz += EOH_get_flat_size(eoh); } else @@ -298,7 +299,7 @@ datumSerialize(Datum value, bool isnull, bool typByVal, int typLen, char **start_address) { ExpandedObjectHeader *eoh = NULL; - int header; + int header; /* Write header word. */ if (isnull) @@ -346,8 +347,8 @@ datumSerialize(Datum value, bool isnull, bool typByVal, int typLen, Datum datumRestore(char **start_address, bool *isnull) { - int header; - void *d; + int header; + void *d; /* Read header word. */ memcpy(&header, *start_address, sizeof(int)); |