You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-29 08:21:11 +03:00
Set WAL long header flag in test function missed in e938a892
.
This was missed because the unit tests were reusing a buffer without resetting it to zero, so this flag ended up still set when the test function was called. This was not a live issue since it only expressed in tests and this code is not used in master yet.
This commit is contained in:
@ -178,6 +178,7 @@ Create a WAL file file for testing
|
|||||||
pgInterfaceWalTest##version(PgWal pgWal, unsigned char *buffer) \
|
pgInterfaceWalTest##version(PgWal pgWal, unsigned char *buffer) \
|
||||||
{ \
|
{ \
|
||||||
((XLogLongPageHeaderData *)buffer)->std.xlp_magic = XLOG_PAGE_MAGIC; \
|
((XLogLongPageHeaderData *)buffer)->std.xlp_magic = XLOG_PAGE_MAGIC; \
|
||||||
|
((XLogLongPageHeaderData *)buffer)->std.xlp_info = XLP_LONG_HEADER; \
|
||||||
((XLogLongPageHeaderData *)buffer)->xlp_sysid = pgWal.systemId; \
|
((XLogLongPageHeaderData *)buffer)->xlp_sysid = pgWal.systemId; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,9 +118,11 @@ testRun(void)
|
|||||||
"HINT: is this version of PostgreSQL supported?");
|
"HINT: is this version of PostgreSQL supported?");
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
memset(bufPtr(result), 0, bufSize(result));
|
||||||
TEST_ERROR(pgWalTestToBuffer((PgWal){.version = 0}, result), AssertError, "invalid version 0");
|
TEST_ERROR(pgWalTestToBuffer((PgWal){.version = 0}, result), AssertError, "invalid version 0");
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
memset(bufPtr(result), 0, bufSize(result));
|
||||||
pgWalTestToBuffer((PgWal){.version = PG_VERSION_11, .systemId = 0xECAFECAF}, result);
|
pgWalTestToBuffer((PgWal){.version = PG_VERSION_11, .systemId = 0xECAFECAF}, result);
|
||||||
storagePutNP(storageNewWriteNP(storageTest, walFile), result);
|
storagePutNP(storageNewWriteNP(storageTest, walFile), result);
|
||||||
|
|
||||||
@ -130,6 +132,7 @@ testRun(void)
|
|||||||
TEST_RESULT_INT(info.version, PG_VERSION_11, " check version");
|
TEST_RESULT_INT(info.version, PG_VERSION_11, " check version");
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
memset(bufPtr(result), 0, bufSize(result));
|
||||||
pgWalTestToBuffer((PgWal){.version = PG_VERSION_83, .systemId = 0xEAEAEAEA}, result);
|
pgWalTestToBuffer((PgWal){.version = PG_VERSION_83, .systemId = 0xEAEAEAEA}, result);
|
||||||
storagePutNP(storageNewWriteNP(storageTest, walFile), result);
|
storagePutNP(storageNewWriteNP(storageTest, walFile), result);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user