Skip to content

Commit 777476c

Browse files
author
Alexander Korotkov
committed
Make pg_locks view aware of 64-bit xids in lock tags.
1 parent 10df277 commit 777476c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/backend/utils/adt/lockfuncs.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ pg_lock_status(PG_FUNCTION_ARGS)
269269
break;
270270
case LOCKTAG_TRANSACTION:
271271
values[6] =
272-
TransactionIdGetDatum(instance->locktag.locktag_field1);
272+
TransactionIdGetDatum(
273+
(TransactionId)instance->locktag.locktag_field1 |
274+
((TransactionId)instance->locktag.locktag_field2 << 32));
273275
nulls[1] = true;
274276
nulls[2] = true;
275277
nulls[3] = true;
@@ -281,7 +283,8 @@ pg_lock_status(PG_FUNCTION_ARGS)
281283
break;
282284
case LOCKTAG_VIRTUALTRANSACTION:
283285
values[5] = VXIDGetDatum(instance->locktag.locktag_field1,
284-
instance->locktag.locktag_field2);
286+
(TransactionId)instance->locktag.locktag_field2 |
287+
((TransactionId)instance->locktag.locktag_field3 << 32));
285288
nulls[1] = true;
286289
nulls[2] = true;
287290
nulls[3] = true;

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