|
10 | 10 | # Returns the filesystem path for the named relation.
|
11 | 11 | #
|
12 | 12 | # Assumes the test node is running
|
13 |
| -sub relation_filepath($$) |
| 13 | +sub relation_filepath |
14 | 14 | {
|
15 | 15 | my ($dbname, $relname) = @_;
|
16 | 16 |
|
|
24 | 24 | # Returns the name of the toast relation associated with the named relation.
|
25 | 25 | #
|
26 | 26 | # Assumes the test node is running
|
27 |
| -sub relation_toast($$) |
| 27 | +sub relation_toast |
28 | 28 | {
|
29 | 29 | my ($dbname, $relname) = @_;
|
30 | 30 |
|
|
34 | 34 | WHERE c.oid = '$relname'::regclass
|
35 | 35 | AND c.reltoastrelid != 0
|
36 | 36 | ));
|
37 |
| - return undef unless defined $rel; |
38 | 37 | return $rel;
|
39 | 38 | }
|
40 | 39 |
|
41 | 40 | # Adds the relation file for the given (dbname, relname) to the list
|
42 | 41 | # to be corrupted by means of overwriting junk in the first page.
|
43 | 42 | #
|
44 | 43 | # Assumes the test node is running.
|
45 |
| -sub plan_to_corrupt_first_page($$) |
| 44 | +sub plan_to_corrupt_first_page |
46 | 45 | {
|
47 | 46 | my ($dbname, $relname) = @_;
|
48 | 47 | my $relpath = relation_filepath($dbname, $relname);
|
|
53 | 52 | # to be corrupted by means of removing the file..
|
54 | 53 | #
|
55 | 54 | # Assumes the test node is running
|
56 |
| -sub plan_to_remove_relation_file($$) |
| 55 | +sub plan_to_remove_relation_file |
57 | 56 | {
|
58 | 57 | my ($dbname, $relname) = @_;
|
59 | 58 | my $relpath = relation_filepath($dbname, $relname);
|
|
65 | 64 | # corrupted by means of removing the file.
|
66 | 65 | #
|
67 | 66 | # Assumes the test node is running.
|
68 |
| -sub plan_to_remove_toast_file($$) |
| 67 | +sub plan_to_remove_toast_file |
69 | 68 | {
|
70 | 69 | my ($dbname, $relname) = @_;
|
71 | 70 | my $toastname = relation_toast($dbname, $relname);
|
72 | 71 | plan_to_remove_relation_file($dbname, $toastname) if ($toastname);
|
73 | 72 | }
|
74 | 73 |
|
75 | 74 | # Corrupts the first page of the given file path
|
76 |
| -sub corrupt_first_page($) |
| 75 | +sub corrupt_first_page |
77 | 76 | {
|
78 | 77 | my ($relpath) = @_;
|
79 | 78 |
|
|
0 commit comments