Skip to content

Commit ef46a73

Browse files
Fix contrib/pageinspect's test for sequences.
I managed to break this test in two different ways in commit 05036a3. First, the output of the new call to tuple_data_split() on the test sequence is dependent on endianness. This is fixed by setting a special start value for the test sequence that produces the same output regardless of the endianness of the machine. Second, on versions older than v15, the new test case fails under "force_parallel_mode = regress" with the following error: ERROR: cannot access temporary tables during a parallel operation This is because pageinspect's disk-accessing functions are incorrectly marked PARALLEL SAFE on versions older than v15 (see commit aeaaf52 for details). This one is fixed by changing the test sequence to be permanent. The only reason it was previously marked temporary was to avoid needing a DROP SEQUENCE command at the end of the test. Unlike some other tests in this file, the use of a permanent sequence here shouldn't result in any test instability like what was fixed by commit e2933a6. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/ZuOKOut5hhDlf_bP%40nathan Backpatch-through: 12
1 parent ca90252 commit ef46a73

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

contrib/pageinspect/expected/page.out

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,12 @@ SELECT page_checksum(decode(repeat('00', :block_size), 'hex'), 1);
233233
(1 row)
234234

235235
-- tests for sequences
236-
create temporary sequence test_sequence;
236+
create sequence test_sequence start 72057594037927937;
237237
select tuple_data_split('test_sequence'::regclass, t_data, t_infomask, t_infomask2, t_bits)
238238
from heap_page_items(get_raw_page('test_sequence', 0));
239239
tuple_data_split
240240
-------------------------------------------------------
241-
{"\\x0100000000000000","\\x0000000000000000","\\x00"}
241+
{"\\x0100000000000001","\\x0000000000000000","\\x00"}
242242
(1 row)
243243

244+
drop sequence test_sequence;

contrib/pageinspect/sql/page.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ SELECT page_header(decode(repeat('00', :block_size), 'hex'));
9797
SELECT page_checksum(decode(repeat('00', :block_size), 'hex'), 1);
9898

9999
-- tests for sequences
100-
create temporary sequence test_sequence;
100+
create sequence test_sequence start 72057594037927937;
101101
select tuple_data_split('test_sequence'::regclass, t_data, t_infomask, t_infomask2, t_bits)
102102
from heap_page_items(get_raw_page('test_sequence', 0));
103+
drop sequence test_sequence;

0 commit comments

Comments
 (0)