PostgreSQL Source Code git master
test_multixact.c
Go to the documentation of this file.
1/*--------------------------------------------------------------------------
2 *
3 * test_multixact.c
4 * Support code for multixact testing
5 *
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * IDENTIFICATION
10 * src/test/modules/test_slru/test_multixact.c
11 *
12 * -------------------------------------------------------------------------
13 */
14
15#include "postgres.h"
16
17#include "access/multixact.h"
18#include "access/xact.h"
19#include "fmgr.h"
20
23
24/*
25 * Produces multixact with 2 current xids
26 */
29{
30 MultiXactId id;
31
36}
37
38/*
39 * Reads given multixact. Discards local cache to make a real read.
40 */
43{
45 MultiXactMember *members;
46
47 /* discard caches */
49
50 if (GetMultiXactIdMembers(id, &members, false, false) == -1)
51 elog(ERROR, "MultiXactId not found");
52
54}
TransactionId MultiXactId
Definition: c.h:670
#define ERROR
Definition: elog.h:39
#define elog(elevel,...)
Definition: elog.h:226
#define PG_RETURN_VOID()
Definition: fmgr.h:349
#define PG_RETURN_TRANSACTIONID(x)
Definition: fmgr.h:364
#define PG_GETARG_TRANSACTIONID(n)
Definition: fmgr.h:279
#define PG_FUNCTION_ARGS
Definition: fmgr.h:193
void MultiXactIdSetOldestMember(void)
Definition: multixact.c:657
MultiXactId MultiXactIdCreate(TransactionId xid1, MultiXactStatus status1, TransactionId xid2, MultiXactStatus status2)
Definition: multixact.c:418
void AtEOXact_MultiXact(void)
Definition: multixact.c:1796
int GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members, bool from_pgupgrade, bool isLockOnly)
Definition: multixact.c:1334
@ MultiXactStatusForShare
Definition: multixact.h:41
@ MultiXactStatusUpdate
Definition: multixact.h:47
uint64_t Datum
Definition: postgres.h:70
PG_FUNCTION_INFO_V1(test_create_multixact)
Datum test_create_multixact(PG_FUNCTION_ARGS)
Datum test_read_multixact(PG_FUNCTION_ARGS)
TransactionId GetCurrentTransactionId(void)
Definition: xact.c:455