Skip to content

[PBKP-531] hotfix #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,25 @@ is_cfm_file_path(const char *filepath) {
off_t
get_cfs_relation_file_decompressed_size(RelFileNodeBackend rnode, const char *fullpath, ForkNumber forknum) {
File fd;
int compressor;
off_t size;

#if PG_VERSION_NUM >= 120000
int compressor;
compressor = md_get_compressor_internal(nodeOf(rnode), rnode.backend, forknum);
fd = PathNameOpenFile(fullpath, O_RDWR | PG_BINARY, compressor);
#else
fd = PathNameOpenFile(fullpath, O_RDWR | PG_BINARY | PG_COMPRESSION);
#endif

if(fd < 0)
return (off_t)-1;

#if PG_VERSION_NUM >= 120000
size = FileSize(fd);
#else
size = FileSeek(fd, 0, SEEK_END);
#endif

FileClose(fd);

return size;
Expand Down
2 changes: 1 addition & 1 deletion engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#define PTRACK_MAGIC_SIZE 4

/* CFS support macro */
#if defined(PGPRO_EE) && PG_VERSION_NUM >= 120000
#if defined(PGPRO_EE) && PG_VERSION_NUM >= 110000
#define CFS_SUPPORT 1
#endif

Expand Down