mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-03-17 21:18:00 +02:00
PBCKP-751: Fixed for PG 16 build and removed some compilation warnings.
This commit is contained in:
parent
9762426ce9
commit
eb5ccf91b8
1
po/LINGUAS
Normal file
1
po/LINGUAS
Normal file
@ -0,0 +1 @@
|
||||
ru
|
@ -142,7 +142,7 @@ page_may_be_compressed(Page page, CompressAlg alg, uint32 backup_version)
|
||||
phdr = (PageHeader) page;
|
||||
|
||||
/* First check if page header is valid (it seems to be fast enough check) */
|
||||
if (!(PageGetPageSize(phdr) == BLCKSZ &&
|
||||
if (!(PageGetPageSize(page) == BLCKSZ &&
|
||||
// PageGetPageLayoutVersion(phdr) == PG_PAGE_LAYOUT_VERSION &&
|
||||
(phdr->pd_flags & ~PD_VALID_FLAG_BITS) == 0 &&
|
||||
phdr->pd_lower >= SizeOfPageHeaderData &&
|
||||
@ -181,7 +181,7 @@ parse_page(Page page, XLogRecPtr *lsn)
|
||||
/* Get lsn from page header */
|
||||
*lsn = PageXLogRecPtrGet(phdr->pd_lsn);
|
||||
|
||||
if (PageGetPageSize(phdr) == BLCKSZ &&
|
||||
if (PageGetPageSize(page) == BLCKSZ &&
|
||||
// PageGetPageLayoutVersion(phdr) == PG_PAGE_LAYOUT_VERSION &&
|
||||
(phdr->pd_flags & ~PD_VALID_FLAG_BITS) == 0 &&
|
||||
phdr->pd_lower >= SizeOfPageHeaderData &&
|
||||
@ -203,10 +203,10 @@ get_header_errormsg(Page page, char **errormsg)
|
||||
PageHeader phdr = (PageHeader) page;
|
||||
*errormsg = pgut_malloc(ERRMSG_MAX_LEN);
|
||||
|
||||
if (PageGetPageSize(phdr) != BLCKSZ)
|
||||
if (PageGetPageSize(page) != BLCKSZ)
|
||||
snprintf(*errormsg, ERRMSG_MAX_LEN, "page header invalid, "
|
||||
"page size %lu is not equal to block size %u",
|
||||
PageGetPageSize(phdr), BLCKSZ);
|
||||
PageGetPageSize(page), BLCKSZ);
|
||||
|
||||
else if (phdr->pd_lower < SizeOfPageHeaderData)
|
||||
snprintf(*errormsg, ERRMSG_MAX_LEN, "page header invalid, "
|
||||
|
@ -1175,7 +1175,6 @@ check_tablespace_mapping(pgBackup *backup, bool incremental, bool force, bool pg
|
||||
{
|
||||
pgFile *link = (pgFile *) parray_get(links, i);
|
||||
const char *linked_path = link->linked;
|
||||
TablespaceListCell *cell;
|
||||
bool remapped = false;
|
||||
|
||||
for (cell = tablespace_dirs.head; cell; cell = cell->next)
|
||||
|
10
src/show.c
10
src/show.c
@ -137,7 +137,7 @@ do_show(CatalogState *catalogState, InstanceState *instanceState,
|
||||
show_instance_start();
|
||||
for (i = 0; i < parray_num(instances); i++)
|
||||
{
|
||||
InstanceState *instanceState = parray_get(instances, i);
|
||||
instanceState = parray_get(instances, i);
|
||||
|
||||
if (interrupted)
|
||||
elog(ERROR, "Interrupted during show");
|
||||
@ -202,22 +202,22 @@ pretty_size(int64 size, char *buf, size_t len)
|
||||
return;
|
||||
}
|
||||
|
||||
if (Abs(size) < limit)
|
||||
if (size < limit)
|
||||
snprintf(buf, len, "%dB", (int) size);
|
||||
else
|
||||
{
|
||||
size >>= 9;
|
||||
if (Abs(size) < limit2)
|
||||
if (size < limit2)
|
||||
snprintf(buf, len, "%dkB", (int) half_rounded(size));
|
||||
else
|
||||
{
|
||||
size >>= 10;
|
||||
if (Abs(size) < limit2)
|
||||
if (size < limit2)
|
||||
snprintf(buf, len, "%dMB", (int) half_rounded(size));
|
||||
else
|
||||
{
|
||||
size >>= 10;
|
||||
if (Abs(size) < limit2)
|
||||
if (size < limit2)
|
||||
snprintf(buf, len, "%dGB", (int) half_rounded(size));
|
||||
else
|
||||
{
|
||||
|
@ -307,7 +307,11 @@ StreamLog(void *arg)
|
||||
}
|
||||
|
||||
#if PG_VERSION_NUM >= 100000
|
||||
#if PG_VERSION_NUM >= 160000
|
||||
if (!ctl.walmethod->ops->finish(ctl.walmethod))
|
||||
#else
|
||||
if (!ctl.walmethod->finish())
|
||||
#endif
|
||||
{
|
||||
interrupted = true;
|
||||
elog(ERROR, "Could not finish writing WAL files: %s",
|
||||
@ -529,7 +533,7 @@ get_history_streaming(ConnectionOptions *conn_opt, TimeLineID tli, parray *backu
|
||||
/* link parent to child */
|
||||
for (i = 0; i < parray_num(tli_list); i++)
|
||||
{
|
||||
timelineInfo *tlinfo = (timelineInfo *) parray_get(tli_list, i);
|
||||
tlinfo = (timelineInfo *) parray_get(tli_list, i);
|
||||
|
||||
for (j = 0; j < parray_num(tli_list); j++)
|
||||
{
|
||||
@ -546,7 +550,7 @@ get_history_streaming(ConnectionOptions *conn_opt, TimeLineID tli, parray *backu
|
||||
/* add backups to each timeline info */
|
||||
for (i = 0; i < parray_num(tli_list); i++)
|
||||
{
|
||||
timelineInfo *tlinfo = parray_get(tli_list, i);
|
||||
tlinfo = parray_get(tli_list, i);
|
||||
for (j = 0; j < parray_num(backup_list); j++)
|
||||
{
|
||||
pgBackup *backup = parray_get(backup_list, j);
|
||||
|
@ -401,8 +401,6 @@ do_validate_all(CatalogState *catalogState, InstanceState *instanceState)
|
||||
{
|
||||
char child[MAXPGPATH];
|
||||
struct stat st;
|
||||
InstanceState *instanceState;
|
||||
|
||||
|
||||
/* skip entries point current dir or parent dir */
|
||||
if (strcmp(dent->d_name, ".") == 0 ||
|
||||
@ -420,7 +418,7 @@ do_validate_all(CatalogState *catalogState, InstanceState *instanceState)
|
||||
/*
|
||||
* Initialize instance configuration.
|
||||
*/
|
||||
instanceState = pgut_new(InstanceState);
|
||||
instanceState = pgut_new(InstanceState); /* memory leak */
|
||||
strncpy(instanceState->instance_name, dent->d_name, MAXPGPATH);
|
||||
|
||||
join_path_components(instanceState->instance_backup_subdir_path,
|
||||
|
Loading…
x
Reference in New Issue
Block a user