Hi,

I found the attributes of the functions consume_xids and consume_xids_until are incorrectly specified:

- Both functions are marked as IMMUTABLE attribute, but they advance the transaction ID, which modifies the system state. Thus, they should be marked as VOLATILE. - Additionally, both functions are marked as PARALLEL SAFE. Since these functions call the AssignTransactionId function, which cannot be invoked in parallel mode, they should be marked as PARALLEL UNSAFE.

This patch fixes the attributes of consume_xids and consume_xids_until accordingly.

Best,
Yushi
From 601c3510cb77c99abde03722ef72ba77862c40f2 Mon Sep 17 00:00:00 2001
From: Yushi Ogiwara <yushiogiw...@keio.jp>
Date: Fri, 11 Oct 2024 15:07:08 +0900
Subject: [PATCH] fix attr

---
 src/test/modules/xid_wraparound/xid_wraparound--1.0.sql | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/test/modules/xid_wraparound/xid_wraparound--1.0.sql b/src/test/modules/xid_wraparound/xid_wraparound--1.0.sql
index 51d25fc4c6..96356b4b97 100644
--- a/src/test/modules/xid_wraparound/xid_wraparound--1.0.sql
+++ b/src/test/modules/xid_wraparound/xid_wraparound--1.0.sql
@@ -4,9 +4,9 @@
 \echo Use "CREATE EXTENSION xid_wraparound" to load this file. \quit
 
 CREATE FUNCTION consume_xids(nxids bigint)
-RETURNS xid8 IMMUTABLE PARALLEL SAFE STRICT
+RETURNS xid8 VOLATILE PARALLEL UNSAFE STRICT
 AS 'MODULE_PATHNAME' LANGUAGE C;
 
 CREATE FUNCTION consume_xids_until(targetxid xid8)
-RETURNS xid8 IMMUTABLE PARALLEL SAFE STRICT
+RETURNS xid8 VOLATILE PARALLEL UNSAFE STRICT
 AS 'MODULE_PATHNAME' LANGUAGE C;
-- 
2.40.1

Reply via email to