]> granicus.if.org Git - postgresql/commitdiff
pageinspect: Make page test more portable
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 1 Nov 2016 16:00:00 +0000 (12:00 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 2 Nov 2016 12:45:17 +0000 (08:45 -0400)
Choose test data that makes the output independent of endianness.

contrib/pageinspect/expected/page.out
contrib/pageinspect/sql/page.sql

index 673a8529a6c480fb83cd040beb7c25bc42c70881..13964cd878d51130f10e8b4c43cd8312f5e45d73 100644 (file)
@@ -1,6 +1,6 @@
 CREATE EXTENSION pageinspect;
-CREATE TABLE test1 (a int, b text);
-INSERT INTO test1 VALUES (1, 'one');
+CREATE TABLE test1 (a int, b int);
+INSERT INTO test1 VALUES (16777217, 131584);
 VACUUM test1;  -- set up FSM
 -- The page contents can vary, so just test that it can be read
 -- successfully, but don't keep the output.
@@ -47,7 +47,7 @@ SELECT tuple_data_split('test1'::regclass, t_data, t_infomask, t_infomask2, t_bi
     FROM heap_page_items(get_raw_page('test1', 0));
        tuple_data_split        
 -------------------------------
- {"\\x01000000","\\x096f6e65"}
+ {"\\x01000001","\\x00020200"}
 (1 row)
 
 SELECT * FROM fsm_page_contents(get_raw_page('test1', 'fsm', 0));
index a304151f07a50afa97f8e64975389a9c18741710..97eef9829a7488c87002d0d644be7f43402fe94f 100644 (file)
@@ -1,7 +1,7 @@
 CREATE EXTENSION pageinspect;
 
-CREATE TABLE test1 (a int, b text);
-INSERT INTO test1 VALUES (1, 'one');
+CREATE TABLE test1 (a int, b int);
+INSERT INTO test1 VALUES (16777217, 131584);
 
 VACUUM test1;  -- set up FSM