Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c94b182

Browse files
committed
[refer #PGPRO-1745] Fix reading compressed file
1 parent 4f4c6b7 commit c94b182

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/data.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1702,9 +1702,9 @@ fileEqualCRC(const char *path1, const char *path2, bool path2_is_compressed)
17021702

17031703
for (;;)
17041704
{
1705-
size_t read_len = 0;
1705+
int read_len = 0;
17061706
read_len = fio_gzread(gz_in, buf, sizeof(buf));
1707-
if (read_len != sizeof(buf) && !fio_gzeof(gz_in))
1707+
if (read_len <= 0 && !fio_gzeof(gz_in))
17081708
/* An error occurred while reading the file */
17091709
elog(ERROR,
17101710
"Cannot compare WAL file \"%s\" with compressed \"%s\"",

0 commit comments

Comments
 (0)