From 6bcda4a72123c3aa29fa3f03d952095675ad4468 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 28 Aug 2022 10:47:10 +0200 Subject: Fix incorrect uses of Datum conversion macros Since these macros just cast whatever you give them to the designated output type, and many normal uses also cast the output type further, a number of incorrect uses go undiscovered. The fixes in this patch have been discovered by changing these macros to inline functions, which is the subject of a future patch. Reviewed-by: Aleksander Alekseev Discussion: https://www.postgresql.org/message-id/flat/8528fb7e-0aa2-6b54-85fb-0c0886dbd6ed%40enterprisedb.com --- src/backend/utils/adt/xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/utils/adt/xml.c') diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 60a85c46971..606088cdfcc 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -4174,7 +4174,7 @@ xpath(PG_FUNCTION_ARGS) astate = initArrayResult(XMLOID, CurrentMemoryContext, true); xpath_internal(xpath_expr_text, data, namespaces, NULL, astate); - PG_RETURN_ARRAYTYPE_P(makeArrayResult(astate, CurrentMemoryContext)); + PG_RETURN_DATUM(makeArrayResult(astate, CurrentMemoryContext)); #else NO_XML_SUPPORT(); return 0; -- cgit v1.2.3