Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit deb86e3

Browse files
author
Andrei Krichinin
committed
Accordance with core code changes after rebase
The branch of changes in Postgres 15 core for multimaster was rebased after upstream updates. This commit brings multimaster code into line with code of this rebased branche.
1 parent 8f06382 commit deb86e3

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

src/dmq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,11 @@ dmq_receiver_loop(PG_FUNCTION_ARGS)
14531453
extra = dmq_receiver_start_hook(sender_name);
14541454

14551455
/* do not hold globalxmin. XXX: try to carefully release snaps */
1456+
#if PG_VERSION_NUM < 150000
14561457
MyProc->xmin = InvalidTransactionId;
1458+
#else
1459+
pg_atomic_write_u64(&MyProc->xmin, InvalidTransactionId);
1460+
#endif
14571461

14581462
for (;;)
14591463
{

src/pglogical_config.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
#include "nodes/makefuncs.h"
2525

2626
#include "utils/builtins.h"
27+
#if PG_VERSION_NUM < 150000
2728
#include "utils/int8.h"
29+
#endif
2830
#include "utils/inval.h"
2931
#include "utils/varlena.h"
3032
#include "utils/lsyscache.h"
@@ -378,13 +380,26 @@ parse_param_bool(DefElem *elem)
378380
static uint32
379381
parse_param_uint32(DefElem *elem)
380382
{
383+
#if PG_VERSION_NUM < 150000
381384
int64 res;
382385

383386
if (!scanint8(strVal(elem->arg), true, &res))
384387
ereport(ERROR,
385388
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
386389
MTM_ERRMSG("could not parse integer value \"%s\" for parameter \"%s\"",
387390
strVal(elem->arg), elem->defname)));
391+
#else
392+
unsigned long res;
393+
char *endptr;
394+
395+
errno = 0;
396+
res = strtoul(strVal(elem->arg), &endptr, 10);
397+
if (errno != 0 || *endptr != '\0')
398+
ereport(ERROR,
399+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
400+
MTM_ERRMSG("could not parse integer value \"%s\" for parameter \"%s\"",
401+
strVal(elem->arg), elem->defname)));
402+
#endif
388403

389404
if (res > PG_UINT32_MAX || res < 0)
390405
ereport(ERROR,

src/pglogical_output.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
#include "utils/builtins.h"
4545
#include "utils/catcache.h"
4646
#include "utils/guc.h"
47+
#if PG_VERSION_NUM < 150000
4748
#include "utils/int8.h"
49+
#endif
4850
#include "utils/inval.h"
4951
#include "utils/lsyscache.h"
5052
#include "utils/memutils.h"

0 commit comments

Comments
 (0)