Skip to content

Commit b4a7e59

Browse files
committed
Cleanup ClusterInfo initialization in pg_upgrade
1 parent 3a08736 commit b4a7e59

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

contrib/pg_upgrade/info.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ static void free_rel_infos(RelInfoArr *rel_arr);
2222
static void print_db_infos(DbInfoArr *dbinfo);
2323
static void print_rel_infos(RelInfoArr *arr);
2424

25+
void
26+
initialize_cluster_info(ClusterInfo *cluster)
27+
{
28+
cluster->dbarr.ndbs = 0;
29+
cluster->dbarr.dbs = NULL;
30+
}
2531

2632
/*
2733
* gen_db_file_maps()

contrib/pg_upgrade/pg_upgrade.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ main(int argc, char **argv)
6363
char *deletion_script_file_name = NULL;
6464
bool live_check = false;
6565

66+
initialize_cluster_info(&old_cluster);
67+
initialize_cluster_info(&new_cluster);
68+
6669
parseCommandLine(argc, argv);
67-
old_cluster.dbarr.ndbs = 0;
68-
new_cluster.dbarr.ndbs = 0;
6970

7071
output_check_banner(&live_check);
7172

contrib/pg_upgrade/pg_upgrade.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ void check_loadable_libraries(void);
326326

327327
/* info.c */
328328

329+
void initialize_cluster_info(ClusterInfo *cluster);
329330
FileNameMap *gen_db_file_maps(DbInfo *old_db,
330331
DbInfo *new_db, int *nmaps, const char *old_pgdata,
331332
const char *new_pgdata);

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