Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 51be673

Browse files
committed
Fix some issues with TAP tests of pg_basebackup
ee9e145 has fixed the tests of pg_basebackup for checksums a first time, still one seek() call missed the shot. Also, the data written in files to emulate corruptions was not actually writing zeros as the quoting style was incorrect. Author: Michael Banck Discussion: https://postgr.es/m/1550153276.796.35.camel@credativ.de Backpatch-through: 11
1 parent 1d93d18 commit 51be673

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bin/pg_basebackup/t/010_pg_basebackup.pl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@
502502
system_or_bail 'pg_ctl', '-D', $pgdata, 'stop';
503503
open $file, '+<', "$pgdata/$file_corrupt1";
504504
seek($file, $pageheader_size, 0);
505-
syswrite($file, '\0\0\0\0\0\0\0\0\0');
505+
syswrite($file, "\0\0\0\0\0\0\0\0\0");
506506
close $file;
507507
system_or_bail 'pg_ctl', '-D', $pgdata, 'start';
508508

@@ -521,7 +521,7 @@
521521
{
522522
my $offset = $pageheader_size + $i * $block_size;
523523
seek($file, $offset, 0);
524-
syswrite($file, '\0\0\0\0\0\0\0\0\0');
524+
syswrite($file, "\0\0\0\0\0\0\0\0\0");
525525
}
526526
close $file;
527527
system_or_bail 'pg_ctl', '-D', $pgdata, 'start';
@@ -537,8 +537,8 @@
537537
# induce corruption in a second file
538538
system_or_bail 'pg_ctl', '-D', $pgdata, 'stop';
539539
open $file, '+<', "$pgdata/$file_corrupt2";
540-
seek($file, 4000, 0);
541-
syswrite($file, '\0\0\0\0\0\0\0\0\0');
540+
seek($file, $pageheader_size, 0);
541+
syswrite($file, "\0\0\0\0\0\0\0\0\0");
542542
close $file;
543543
system_or_bail 'pg_ctl', '-D', $pgdata, 'start';
544544

0 commit comments

Comments
 (0)