Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit253db39

Browse files
danielgustafssonpull[bot]
authored andcommitted
pg_upgrade: Avoid shadowing global var in function
The new_cluster parameter in check_for_new_tablespace_dir wasshadowing the globally defined new_cluster variable, causingcompiler warnings when running with -Wshadow. The function isonly applicable to the new cluster, so remove the parameterrather than rename to match check_new_cluster_is_empty whichalso only applies to the new cluster.Author: Peter Smith <peter.b.smith@fujitsu.com>Discussion:https://postgr.es/m/CAHut+PvS_PHLntWy1yTgXv0O1tWm4iVcKBQFzpoQRDsm2Ce_Fg@mail.gmail.com
1 parent5f2ff98 commit253db39

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/bin/pg_upgrade/check.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static void check_for_reg_data_type_usage(ClusterInfo *cluster);
2828
staticvoidcheck_for_aclitem_data_type_usage(ClusterInfo*cluster);
2929
staticvoidcheck_for_jsonb_9_4_usage(ClusterInfo*cluster);
3030
staticvoidcheck_for_pg_role_prefix(ClusterInfo*cluster);
31-
staticvoidcheck_for_new_tablespace_dir(ClusterInfo*new_cluster);
31+
staticvoidcheck_for_new_tablespace_dir(void);
3232
staticvoidcheck_for_user_defined_encoding_conversions(ClusterInfo*cluster);
3333

3434

@@ -209,7 +209,7 @@ check_new_cluster(void)
209209

210210
check_for_prepared_transactions(&new_cluster);
211211

212-
check_for_new_tablespace_dir(&new_cluster);
212+
check_for_new_tablespace_dir();
213213
}
214214

215215

@@ -377,7 +377,7 @@ check_new_cluster_is_empty(void)
377377
* during schema restore.
378378
*/
379379
staticvoid
380-
check_for_new_tablespace_dir(ClusterInfo*new_cluster)
380+
check_for_new_tablespace_dir(void)
381381
{
382382
inttblnum;
383383
charnew_tablespace_dir[MAXPGPATH];
@@ -390,7 +390,7 @@ check_for_new_tablespace_dir(ClusterInfo *new_cluster)
390390

391391
snprintf(new_tablespace_dir,MAXPGPATH,"%s%s",
392392
os_info.old_tablespaces[tblnum],
393-
new_cluster->tablespace_suffix);
393+
new_cluster.tablespace_suffix);
394394

395395
if (stat(new_tablespace_dir,&statbuf)==0||errno!=ENOENT)
396396
pg_fatal("new cluster tablespace directory already exists: \"%s\"",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp