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

Commitcad66d9

Browse files
committed
Fix copying of cfm files in pg_upgrade
1 parentd1c3524 commitcad66d9

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

‎src/bin/pg_upgrade/relfilenode.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,16 @@ transfer_relfile(FileNameMap *map, const char *type_suffix, bool vm_must_add_fro
220220
charold_file[MAXPGPATH];
221221
charnew_file[MAXPGPATH];
222222
intsegno;
223-
charextent_suffix[65];
223+
charsegno_text[65];
224+
charconst*extent_prefix="";
225+
charconst*extent_suffix="";
224226
structstatstatbuf;
225227

228+
if (strcmp(type_suffix,".cfm")==0)
229+
extent_prefix=segno_text;
230+
else
231+
extent_suffix=segno_text;
232+
226233
/*
227234
* Now copy/link any related segments as well. Remember, PG breaks large
228235
* files into 1GB segments, the first segment has no extension, subsequent
@@ -231,22 +238,24 @@ transfer_relfile(FileNameMap *map, const char *type_suffix, bool vm_must_add_fro
231238
for (segno=0;;segno++)
232239
{
233240
if (segno==0)
234-
extent_suffix[0]='\0';
241+
segno_text[0]='\0';
235242
else
236-
snprintf(extent_suffix,sizeof(extent_suffix),".%d",segno);
243+
snprintf(segno_text,sizeof(segno_text),".%d",segno);
237244

238-
snprintf(old_file,sizeof(old_file),"%s%s/%u/%u%s%s",
245+
snprintf(old_file,sizeof(old_file),"%s%s/%u/%u%s%s%s",
239246
map->old_tablespace,
240247
map->old_tablespace_suffix,
241248
map->old_db_oid,
242249
map->old_relfilenode,
250+
extent_prefix,
243251
type_suffix,
244252
extent_suffix);
245-
snprintf(new_file,sizeof(new_file),"%s%s/%u/%u%s%s",
253+
snprintf(new_file,sizeof(new_file),"%s%s/%u/%u%s%s%s",
246254
map->new_tablespace,
247255
map->new_tablespace_suffix,
248256
map->new_db_oid,
249257
map->new_relfilenode,
258+
extent_prefix,
250259
type_suffix,
251260
extent_suffix);
252261

‎src/include/storage/cfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include"port/atomics.h"
77
#include"storage/rijndael.h"
88

9-
#defineCFS_VERSION "0.45"
9+
#defineCFS_VERSION "0.47"
1010

1111
#defineCFS_GC_LOCK (MAX_BACKENDS+1)
1212

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp