PostgreSQL Source Code  git master
test_multixact.c File Reference
#include "postgres.h"
#include "access/multixact.h"
#include "access/xact.h"
#include "utils/builtins.h"
#include "utils/injection_point.h"
Include dependency graph for test_multixact.c:

Go to the source code of this file.

Functions

 PG_FUNCTION_INFO_V1 (test_create_multixact)
 
 PG_FUNCTION_INFO_V1 (test_read_multixact)
 
Datum test_create_multixact (PG_FUNCTION_ARGS)
 
Datum test_read_multixact (PG_FUNCTION_ARGS)
 

Function Documentation

◆ PG_FUNCTION_INFO_V1() [1/2]

PG_FUNCTION_INFO_V1 ( test_create_multixact  )

◆ PG_FUNCTION_INFO_V1() [2/2]

PG_FUNCTION_INFO_V1 ( test_read_multixact  )

◆ test_create_multixact()

Datum test_create_multixact ( PG_FUNCTION_ARGS  )

Definition at line 29 of file test_multixact.c.

30 {
31  MultiXactId id;
32 
37 }
TransactionId MultiXactId
Definition: c.h:653
#define PG_RETURN_TRANSACTIONID(x)
Definition: fmgr.h:364
void MultiXactIdSetOldestMember(void)
Definition: multixact.c:673
MultiXactId MultiXactIdCreate(TransactionId xid1, MultiXactStatus status1, TransactionId xid2, MultiXactStatus status2)
Definition: multixact.c:434
@ MultiXactStatusForShare
Definition: multixact.h:40
@ MultiXactStatusUpdate
Definition: multixact.h:46
TransactionId GetCurrentTransactionId(void)
Definition: xact.c:453

References GetCurrentTransactionId(), MultiXactIdCreate(), MultiXactIdSetOldestMember(), MultiXactStatusForShare, MultiXactStatusUpdate, and PG_RETURN_TRANSACTIONID.

◆ test_read_multixact()

Datum test_read_multixact ( PG_FUNCTION_ARGS  )

Definition at line 44 of file test_multixact.c.

45 {
47  MultiXactMember *members;
48 
49  INJECTION_POINT("test-multixact-read");
50  /* discard caches */
52 
53  if (GetMultiXactIdMembers(id, &members, false, false) == -1)
54  elog(ERROR, "MultiXactId not found");
55 
57 }
#define ERROR
Definition: elog.h:39
#define elog(elevel,...)
Definition: elog.h:225
#define PG_RETURN_VOID()
Definition: fmgr.h:349
#define PG_GETARG_TRANSACTIONID(n)
Definition: fmgr.h:279
#define INJECTION_POINT(name)
void AtEOXact_MultiXact(void)
Definition: multixact.c:1808
int GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members, bool from_pgupgrade, bool isLockOnly)
Definition: multixact.c:1299

References AtEOXact_MultiXact(), elog, ERROR, GetMultiXactIdMembers(), INJECTION_POINT, PG_GETARG_TRANSACTIONID, and PG_RETURN_VOID.