Skip to content

Commit

Permalink
Fix size function tests on MN
Browse files Browse the repository at this point in the history
In b7e04f1 we removed the useless table lock on hypertable size
functions and without this explicit lock the SELECT grant is not
necessary anymore and doing it break some MN regression tests.

Also removed the tests for PG16 since MN is not supported.
  • Loading branch information
fabriziomello committed Nov 16, 2023
1 parent 0254abd commit 115078a
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 1,122 deletions.
29 changes: 22 additions & 7 deletions tsl/test/expected/dist_util-13.out
Original file line number Diff line number Diff line change
Expand Up @@ -972,17 +972,32 @@ SELECT 1 FROM pg_table_size('nondisttable');
1
(1 row)

-- hypertable_size requires SELECT privilege on table
\set ON_ERROR_STOP 0
SELECT * FROM hypertable_size('disttable');
ERROR: permission denied for table disttable
hypertable_size
-----------------
131072
(1 row)

SELECT * FROM hypertable_size('nondisttable');
ERROR: permission denied for table nondisttable
hypertable_size
-----------------
114688
(1 row)

SELECT * FROM hypertable_detailed_size('disttable') ORDER BY node_name;
ERROR: permission denied for table disttable
table_bytes | index_bytes | toast_bytes | total_bytes | node_name
-------------+-------------+-------------+-------------+-------------
16384 | 49152 | 8192 | 73728 | data_node_1
8192 | 32768 | 8192 | 49152 | data_node_2
0 | 8192 | 0 | 8192 |
(3 rows)

SELECT * FROM hypertable_detailed_size('nondisttable') ORDER BY node_name;
ERROR: permission denied for table nondisttable
\set ON_ERROR_STOP 1
table_bytes | index_bytes | toast_bytes | total_bytes | node_name
-------------+-------------+-------------+-------------+-----------
24576 | 73728 | 16384 | 114688 |
(1 row)

SELECT * FROM chunks_detailed_size('disttable') ORDER BY chunk_schema, chunk_name, node_name;
chunk_schema | chunk_name | table_bytes | index_bytes | toast_bytes | total_bytes | node_name
-----------------------+-----------------------+-------------+-------------+-------------+-------------+-------------
Expand Down
29 changes: 22 additions & 7 deletions tsl/test/expected/dist_util-14.out
Original file line number Diff line number Diff line change
Expand Up @@ -972,17 +972,32 @@ SELECT 1 FROM pg_table_size('nondisttable');
1
(1 row)

-- hypertable_size requires SELECT privilege on table
\set ON_ERROR_STOP 0
SELECT * FROM hypertable_size('disttable');
ERROR: permission denied for table disttable
hypertable_size
-----------------
147456
(1 row)

SELECT * FROM hypertable_size('nondisttable');
ERROR: permission denied for table nondisttable
hypertable_size
-----------------
131072
(1 row)

SELECT * FROM hypertable_detailed_size('disttable') ORDER BY node_name;
ERROR: permission denied for table disttable
table_bytes | index_bytes | toast_bytes | total_bytes | node_name
-------------+-------------+-------------+-------------+-------------
24576 | 49152 | 8192 | 81920 | data_node_1
16384 | 32768 | 8192 | 57344 | data_node_2
0 | 8192 | 0 | 8192 |
(3 rows)

SELECT * FROM hypertable_detailed_size('nondisttable') ORDER BY node_name;
ERROR: permission denied for table nondisttable
\set ON_ERROR_STOP 1
table_bytes | index_bytes | toast_bytes | total_bytes | node_name
-------------+-------------+-------------+-------------+-----------
40960 | 73728 | 16384 | 131072 |
(1 row)

SELECT * FROM chunks_detailed_size('disttable') ORDER BY chunk_schema, chunk_name, node_name;
chunk_schema | chunk_name | table_bytes | index_bytes | toast_bytes | total_bytes | node_name
-----------------------+-----------------------+-------------+-------------+-------------+-------------+-------------
Expand Down
29 changes: 22 additions & 7 deletions tsl/test/expected/dist_util-15.out
Original file line number Diff line number Diff line change
Expand Up @@ -972,17 +972,32 @@ SELECT 1 FROM pg_table_size('nondisttable');
1
(1 row)

-- hypertable_size requires SELECT privilege on table
\set ON_ERROR_STOP 0
SELECT * FROM hypertable_size('disttable');
ERROR: permission denied for table disttable
hypertable_size
-----------------
147456
(1 row)

SELECT * FROM hypertable_size('nondisttable');
ERROR: permission denied for table nondisttable
hypertable_size
-----------------
131072
(1 row)

SELECT * FROM hypertable_detailed_size('disttable') ORDER BY node_name;
ERROR: permission denied for table disttable
table_bytes | index_bytes | toast_bytes | total_bytes | node_name
-------------+-------------+-------------+-------------+-------------
24576 | 49152 | 8192 | 81920 | data_node_1
16384 | 32768 | 8192 | 57344 | data_node_2
0 | 8192 | 0 | 8192 |
(3 rows)

SELECT * FROM hypertable_detailed_size('nondisttable') ORDER BY node_name;
ERROR: permission denied for table nondisttable
\set ON_ERROR_STOP 1
table_bytes | index_bytes | toast_bytes | total_bytes | node_name
-------------+-------------+-------------+-------------+-----------
40960 | 73728 | 16384 | 131072 |
(1 row)

SELECT * FROM chunks_detailed_size('disttable') ORDER BY chunk_schema, chunk_name, node_name;
chunk_schema | chunk_name | table_bytes | index_bytes | toast_bytes | total_bytes | node_name
-----------------------+-----------------------+-------------+-------------+-------------+-------------+-------------
Expand Down
Loading

0 comments on commit 115078a

Please sign in to comment.