@@ -54,20 +54,17 @@ sub invalid_entry_order_leaf_page_test
5454
5555$node -> stop;
5656
57- my $blkno = 1;# root
57+ my $blkno = 1;# root
5858
5959# produce wrong order by replacing aaaaa with ccccc
60- string_replace_block(
61- $relpath ,
62- ' aaaaa' ,
63- ' ccccc' ,
64- $blkno
65- );
60+ string_replace_block($relpath ,' aaaaa' ,' ccccc' ,$blkno );
6661
6762$node -> start;
6863
69- my ($result ,$stdout ,$stderr ) =$node -> psql(' postgres' ,qq( SELECT gin_index_check('$indexname ')) );
70- my $expected =" index\" $indexname \" has wrong tuple order on entry tree page, block 1, offset 2, rightlink 4294967295" ;
64+ my ($result ,$stdout ,$stderr ) =
65+ $node -> psql(' postgres' ,qq( SELECT gin_index_check('$indexname ')) );
66+ my $expected =
67+ " index\" $indexname \" has wrong tuple order on entry tree page, block 1, offset 2, rightlink 4294967295" ;
7168like($stderr ,qr /$expected / );
7269}
7370
@@ -96,20 +93,17 @@ sub invalid_entry_order_inner_page_test
9693
9794$node -> stop;
9895
99- my $blkno = 1;# root
96+ my $blkno = 1;# root
10097
10198# we have rrrrrrrrr... and tttttttttt... as keys in the root, so produce wrong order by replacing rrrrrrrrrr....
102- string_replace_block(
103- $relpath ,
104- ' rrrrrrrrrr' ,
105- ' zzzzzzzzzz' ,
106- $blkno
107- );
99+ string_replace_block($relpath ,' rrrrrrrrrr' ,' zzzzzzzzzz' ,$blkno );
108100
109101$node -> start;
110102
111- my ($result ,$stdout ,$stderr ) =$node -> psql(' postgres' ,qq( SELECT gin_index_check('$indexname ')) );
112- my $expected =" index\" $indexname \" has wrong tuple order on entry tree page, block 1, offset 2, rightlink 4294967295" ;
103+ my ($result ,$stdout ,$stderr ) =
104+ $node -> psql(' postgres' ,qq( SELECT gin_index_check('$indexname ')) );
105+ my $expected =
106+ " index\" $indexname \" has wrong tuple order on entry tree page, block 1, offset 2, rightlink 4294967295" ;
113107like($stderr ,qr /$expected / );
114108}
115109
@@ -129,7 +123,7 @@ sub invalid_entry_columns_order_test
129123
130124$node -> stop;
131125
132- my $blkno = 1;# root
126+ my $blkno = 1;# root
133127
134128# mess column numbers
135129# root items order before: (1,aaa), (2,bbb)
@@ -139,26 +133,18 @@ sub invalid_entry_columns_order_test
139133
140134my $find =qr / ($attrno_1 )(.)(aaa)/ s ;
141135my $replace =$attrno_2 .' $2$3' ;
142- string_replace_block(
143- $relpath ,
144- $find ,
145- $replace ,
146- $blkno
147- );
136+ string_replace_block($relpath ,$find ,$replace ,$blkno );
148137
149138$find =qr / ($attrno_2 )(.)(bbb)/ s ;
150139$replace =$attrno_1 .' $2$3' ;
151- string_replace_block(
152- $relpath ,
153- $find ,
154- $replace ,
155- $blkno
156- );
140+ string_replace_block($relpath ,$find ,$replace ,$blkno );
157141
158142$node -> start;
159143
160- my ($result ,$stdout ,$stderr ) =$node -> psql(' postgres' ,qq( SELECT gin_index_check('$indexname ')) );
161- my $expected =" index\" $indexname \" has wrong tuple order on entry tree page, block 1, offset 2, rightlink 4294967295" ;
144+ my ($result ,$stdout ,$stderr ) =
145+ $node -> psql(' postgres' ,qq( SELECT gin_index_check('$indexname ')) );
146+ my $expected =
147+ " index\" $indexname \" has wrong tuple order on entry tree page, block 1, offset 2, rightlink 4294967295" ;
162148like($stderr ,qr /$expected / );
163149}
164150
@@ -183,20 +169,17 @@ sub inconsistent_with_parent_key__parent_key_corrupted_test
183169
184170$node -> stop;
185171
186- my $blkno = 1;# root
172+ my $blkno = 1;# root
187173
188174# we have nnnnnnnnnn... as parent key in the root, so replace it with something smaller then child's keys
189- string_replace_block(
190- $relpath ,
191- ' nnnnnnnnnn' ,
192- ' aaaaaaaaaa' ,
193- $blkno
194- );
175+ string_replace_block($relpath ,' nnnnnnnnnn' ,' aaaaaaaaaa' ,$blkno );
195176
196177$node -> start;
197178
198- my ($result ,$stdout ,$stderr ) =$node -> psql(' postgres' ,qq( SELECT gin_index_check('$indexname ')) );
199- my $expected =" index\" $indexname \" has inconsistent records on page 3 offset 3" ;
179+ my ($result ,$stdout ,$stderr ) =
180+ $node -> psql(' postgres' ,qq( SELECT gin_index_check('$indexname ')) );
181+ my $expected =
182+ " index\" $indexname \" has inconsistent records on page 3 offset 3" ;
200183like($stderr ,qr /$expected / );
201184}
202185
@@ -221,20 +204,17 @@ sub inconsistent_with_parent_key__child_key_corrupted_test
221204
222205$node -> stop;
223206
224- my $blkno = 3;# leaf
207+ my $blkno = 3;# leaf
225208
226209# we have nnnnnnnnnn... as parent key in the root, so replace child key with something bigger
227- string_replace_block(
228- $relpath ,
229- ' nnnnnnnnnn' ,
230- ' pppppppppp' ,
231- $blkno
232- );
210+ string_replace_block($relpath ,' nnnnnnnnnn' ,' pppppppppp' ,$blkno );
233211
234212$node -> start;
235213
236- my ($result ,$stdout ,$stderr ) =$node -> psql(' postgres' ,qq( SELECT gin_index_check('$indexname ')) );
237- my $expected =" index\" $indexname \" has inconsistent records on page 3 offset 3" ;
214+ my ($result ,$stdout ,$stderr ) =
215+ $node -> psql(' postgres' ,qq( SELECT gin_index_check('$indexname ')) );
216+ my $expected =
217+ " index\" $indexname \" has inconsistent records on page 3 offset 3" ;
238218like($stderr ,qr /$expected / );
239219}
240220
@@ -254,24 +234,21 @@ sub inconsistent_with_parent_key__parent_key_corrupted_posting_tree_test
254234
255235$node -> stop;
256236
257- my $blkno = 2;# posting tree root
237+ my $blkno = 2;# posting tree root
258238
259239# we have a posting tree for 'aaaaa' key with the root at 2nd block
260240# and two leaf pages 3 and 4. replace 4th page's high key with (1,1)
261241# so that there are tid's in leaf page that are larger then the new high key.
262242my $find =pack (' S*' , 0, 4, 0) .' ....' ;
263243my $replace =pack (' S*' , 0, 4, 0, 1, 1);
264- string_replace_block(
265- $relpath ,
266- $find ,
267- $replace ,
268- $blkno
269- );
244+ string_replace_block($relpath ,$find ,$replace ,$blkno );
270245
271246$node -> start;
272247
273- my ($result ,$stdout ,$stderr ) =$node -> psql(' postgres' ,qq( SELECT gin_index_check('$indexname ')) );
274- my $expected =" index\" $indexname \" : tid exceeds parent's high key in postingTree leaf on block 4" ;
248+ my ($result ,$stdout ,$stderr ) =
249+ $node -> psql(' postgres' ,qq( SELECT gin_index_check('$indexname ')) );
250+ my $expected =
251+ " index\" $indexname \" : tid exceeds parent's high key in postingTree leaf on block 4" ;
275252like($stderr ,qr /$expected / );
276253}
277254