1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-01 00:25:06 +02:00

Fix bad arithmetic in pgLsnToWalSegment().

/ takes precedence over & but the appropriate parens were not provided.

By some bad luck the tests worked either way, so add a new test that only works the correct way to prevent a regression.
This commit is contained in:
David Steele
2019-12-12 16:21:51 -05:00
parent 676be2c773
commit 1378d9c58b
2 changed files with 2 additions and 1 deletions

View File

@ -619,7 +619,7 @@ pgLsnToWalSegment(uint32_t timeline, uint64_t lsn, unsigned int walSegmentSize)
FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(
strNewFmt("%08X%08X%08X", timeline, (unsigned int)(lsn >> 32), (unsigned int)(lsn & 0xFFFFFFFF / walSegmentSize)));
strNewFmt("%08X%08X%08X", timeline, (unsigned int)(lsn >> 32), (unsigned int)(lsn & 0xFFFFFFFF) / walSegmentSize));
}
/**********************************************************************************************************************************/