Make FSM test portable.

In b0eaa4c51b, we allow FSM to be created only after 4 pages.  One of the
tests check the FSM contents and to do that it populates many tuples in
the relation.  The FSM contents depend on the availability of freespace in
the page and it could vary because of the alignment of tuples.

This commit removes the dependency on FSM contents.

Author: Amit Kapila
Discussion: https://postgr.es/m/CAA4eK1KADF6K1bagr0--mGv3dMcZ%3DH_Z-Qtvdfbp5PjaC6PJJA%40mail.gmail.com
This commit is contained in:
Amit Kapila 2019-02-04 10:08:29 +05:30
parent b0eaa4c51b
commit 08ecdfe7e5
2 changed files with 7 additions and 19 deletions

View File

@ -35,24 +35,11 @@ ERROR: relation "xxx" does not exist
SELECT octet_length(get_raw_page('test_rel_forks', 'xxx', 0)); SELECT octet_length(get_raw_page('test_rel_forks', 'xxx', 0));
ERROR: invalid fork name ERROR: invalid fork name
HINT: Valid fork names are "main", "fsm", "vm", and "init". HINT: Valid fork names are "main", "fsm", "vm", and "init".
SELECT * FROM fsm_page_contents(get_raw_page('test_rel_forks', 'fsm', 0)); EXPLAIN (costs off, analyze on, timing off, summary off) SELECT * FROM
fsm_page_contents fsm_page_contents(get_raw_page('test_rel_forks', 'fsm', 0));
------------------- QUERY PLAN
0: 39 + ------------------------------------------------------------
1: 39 + Function Scan on fsm_page_contents (actual rows=1 loops=1)
3: 39 +
7: 39 +
15: 39 +
31: 39 +
63: 39 +
127: 39 +
255: 39 +
511: 39 +
1023: 39 +
2047: 39 +
4095: 39 +
fp_next_slot: 0 +
(1 row) (1 row)
SELECT get_raw_page('test_rel_forks', 0) = get_raw_page('test_rel_forks', 'main', 0); SELECT get_raw_page('test_rel_forks', 0) = get_raw_page('test_rel_forks', 'main', 0);

View File

@ -22,7 +22,8 @@ SELECT octet_length(get_raw_page('test_rel_forks', 'vm', 1)) AS vm_1;
SELECT octet_length(get_raw_page('xxx', 'main', 0)); SELECT octet_length(get_raw_page('xxx', 'main', 0));
SELECT octet_length(get_raw_page('test_rel_forks', 'xxx', 0)); SELECT octet_length(get_raw_page('test_rel_forks', 'xxx', 0));
SELECT * FROM fsm_page_contents(get_raw_page('test_rel_forks', 'fsm', 0)); EXPLAIN (costs off, analyze on, timing off, summary off) SELECT * FROM
fsm_page_contents(get_raw_page('test_rel_forks', 'fsm', 0));
SELECT get_raw_page('test_rel_forks', 0) = get_raw_page('test_rel_forks', 'main', 0); SELECT get_raw_page('test_rel_forks', 0) = get_raw_page('test_rel_forks', 'main', 0);