aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2024-09-13 10:16:40 -0500
committerNathan Bossart <nathan@postgresql.org>2024-09-13 10:16:40 -0500
commit0938a4ecda33ce0630dd4cb01466f8ef4c41f8b4 (patch)
tree54ced49759eee7bfd8688bbe0688699c7a8a28f0
parent2bd4c06bba8ce1264ae3d5810b6aea1bfacbadf7 (diff)
downloadpostgresql-0938a4ecda33ce0630dd4cb01466f8ef4c41f8b4.tar.gz
postgresql-0938a4ecda33ce0630dd4cb01466f8ef4c41f8b4.zip
Fix contrib/pageinspect's test for sequences.
I managed to break this test in two different ways in commit 05036a3155. 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 aeaaf520f4 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 e2933a6e11. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/ZuOKOut5hhDlf_bP%40nathan Backpatch-through: 12
-rw-r--r--contrib/pageinspect/expected/page.out5
-rw-r--r--contrib/pageinspect/sql/page.sql3
2 files changed, 5 insertions, 3 deletions
diff --git a/contrib/pageinspect/expected/page.out b/contrib/pageinspect/expected/page.out
index 04fd9dee4bd..3fd3869c82a 100644
--- a/contrib/pageinspect/expected/page.out
+++ b/contrib/pageinspect/expected/page.out
@@ -240,11 +240,12 @@ SELECT page_checksum(decode(repeat('00', :block_size), 'hex'), 1);
(1 row)
-- tests for sequences
-create temporary sequence test_sequence;
+create sequence test_sequence start 72057594037927937;
select tuple_data_split('test_sequence'::regclass, t_data, t_infomask, t_infomask2, t_bits)
from heap_page_items(get_raw_page('test_sequence', 0));
tuple_data_split
-------------------------------------------------------
- {"\\x0100000000000000","\\x0000000000000000","\\x00"}
+ {"\\x0100000000000001","\\x0000000000000000","\\x00"}
(1 row)
+drop sequence test_sequence;
diff --git a/contrib/pageinspect/sql/page.sql b/contrib/pageinspect/sql/page.sql
index 59784fc7cce..346e4ee142c 100644
--- a/contrib/pageinspect/sql/page.sql
+++ b/contrib/pageinspect/sql/page.sql
@@ -100,6 +100,7 @@ SELECT page_header(decode(repeat('00', :block_size), 'hex'));
SELECT page_checksum(decode(repeat('00', :block_size), 'hex'), 1);
-- tests for sequences
-create temporary sequence test_sequence;
+create sequence test_sequence start 72057594037927937;
select tuple_data_split('test_sequence'::regclass, t_data, t_infomask, t_infomask2, t_bits)
from heap_page_items(get_raw_page('test_sequence', 0));
+drop sequence test_sequence;