mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-24 23:34:25 +08:00
Refactor calculating count in GetLockConflicts
Refactors implementation of calculating the result count in GetLockConflictsCompat in PG 11 and earlier, so it follows the implementation as in PG 12.
This commit is contained in:
parent
9a3211f3aa
commit
68e64f6540
@ -45,12 +45,9 @@ GetLockConflictsCompat(const LOCKTAG *locktag, LOCKMODE lockmode, int *countp)
|
||||
VirtualTransactionId *ids = GetLockConflicts(locktag, lockmode);
|
||||
if (countp != NULL)
|
||||
{
|
||||
VirtualTransactionId *i = ids;
|
||||
*countp = 0;
|
||||
while (VirtualTransactionIdIsValid(*i))
|
||||
for (*countp = 0; VirtualTransactionIdIsValid(ids[*countp]); (*countp)++)
|
||||
{
|
||||
i += 1;
|
||||
*countp += 1;
|
||||
/* Counts the number of virtual transactions ids into countp */
|
||||
}
|
||||
}
|
||||
return ids;
|
||||
|
Loading…
x
Reference in New Issue
Block a user