Skip to content

Commit 39a6772

Browse files
committed
Use DatumGetInt32() to extract 32-bit integer value from a datum.
Previously DatumGetObjectId() was wrongly used for that. Author: Masahiko Sawada Reviewed-by: Kyotaro Horiguchi Reported-by: Fujii Masao Discussion: http://postgr.es/m/CAHGQGwFDWh_Qr-q_GEMpD+qH=vYPMdVqw=ZOSY3kX_Pna9R9SA@mail.gmail.com
1 parent b977780 commit 39a6772

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/replication/logical/launcher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ logicalrep_worker_launch(Oid dbid, Oid subid, const char *subname, Oid userid,
306306

307307
bgw.bgw_restart_time = BGW_NEVER_RESTART;
308308
bgw.bgw_notify_pid = MyProcPid;
309-
bgw.bgw_main_arg = slot;
309+
bgw.bgw_main_arg = Int32GetDatum(slot);
310310

311311
if (!RegisterDynamicBackgroundWorker(&bgw, &bgw_handle))
312312
{

src/backend/replication/logical/worker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ subscription_change_cb(Datum arg, int cacheid, uint32 hashvalue)
14411441
void
14421442
ApplyWorkerMain(Datum main_arg)
14431443
{
1444-
int worker_slot = DatumGetObjectId(main_arg);
1444+
int worker_slot = DatumGetInt32(main_arg);
14451445
MemoryContext oldctx;
14461446
char originname[NAMEDATALEN];
14471447
XLogRecPtr origin_startpos;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy