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

Commit34eefe8

Browse files
committed
PGPRO-202 # comment force truncation of compressed file
1 parenteb14659 commit34eefe8

File tree

1 file changed

+2
-1
lines changed
  • src/backend/storage/file

1 file changed

+2
-1
lines changed

‎src/backend/storage/file/fd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,8 @@ FileTruncate(File file, off_t offset)
21222122
pg_atomic_write_u32(&map->virtSize,offset);
21232123
pg_atomic_fetch_sub_u32(&map->usedSize,released);
21242124
cfs_unlock_file(map);
2125-
returnCode=0;
2125+
/* We can truncate compressed file only with zero offset */
2126+
returnCode= (offset==0) ?ftruncate(VfdCache[file].fd,0) :0;
21262127
}else {
21272128
returnCode=ftruncate(VfdCache[file].fd,offset);
21282129
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp