File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -248,6 +248,9 @@ extern struct varlena *pg_detoast_datum_packed(struct varlena *datum);
248
248
#define PG_DETOAST_DATUM_PACKED (datum ) \
249
249
pg_detoast_datum_packed((struct varlena *) DatumGetPointer(datum))
250
250
251
+ struct ExpandedObjectHeader ;
252
+ extern struct ExpandedObjectHeader * DatumGetEOHP (Datum d );
253
+
251
254
/*
252
255
* Support for cleaning up detoasted copies of inputs. This must only
253
256
* be used for pass-by-ref datatypes, and normally would only be used
@@ -259,7 +262,9 @@ extern struct varlena *pg_detoast_datum_packed(struct varlena *datum);
259
262
*/
260
263
#define PG_FREE_IF_COPY (ptr ,n ) \
261
264
do { \
262
- if ((Pointer) (ptr) != PG_GETARG_POINTER(n)) \
265
+ if ((Pointer) (ptr) != PG_GETARG_POINTER(n) && \
266
+ (!VARATT_IS_EXTERNAL_EXPANDED(PG_GETARG_POINTER(n)) || \
267
+ (Pointer) DatumGetEOHP(PG_GETARG_DATUM(n)) != (Pointer)(ptr))) \
263
268
pfree(ptr); \
264
269
} while (0)
265
270
You can’t perform that action at this time.
0 commit comments