|
502 | 502 | system_or_bail 'pg_ctl', '-D', $pgdata, 'stop';
|
503 | 503 | open $file, '+<', "$pgdata/$file_corrupt1";
|
504 | 504 | 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"); |
506 | 506 | close $file;
|
507 | 507 | system_or_bail 'pg_ctl', '-D', $pgdata, 'start';
|
508 | 508 |
|
|
521 | 521 | {
|
522 | 522 | my $offset = $pageheader_size + $i * $block_size;
|
523 | 523 | 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"); |
525 | 525 | }
|
526 | 526 | close $file;
|
527 | 527 | system_or_bail 'pg_ctl', '-D', $pgdata, 'start';
|
|
537 | 537 | # induce corruption in a second file
|
538 | 538 | system_or_bail 'pg_ctl', '-D', $pgdata, 'stop';
|
539 | 539 | 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"); |
542 | 542 | close $file;
|
543 | 543 | system_or_bail 'pg_ctl', '-D', $pgdata, 'start';
|
544 | 544 |
|
|
0 commit comments