mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-24 18:55:04 +08:00
Add some tests to check the SQL functions of control file
As the recent commit05d4cbf
(reverted after asa448e49
) has proved, there is zero coverage for the four SQL functions that can scan the control file data: - pg_control_checkpoint() - pg_control_init() - pg_control_recovery() - pg_control_system() This commit adds a minimal coverage for these functions, checking that their execution is able to complete. This would have been enough to catch the problems introduced in the commit mentioned above. More checks could be done for each individual fields, but it is unclear whether this would be better than the other checks in place in the backend code. Per discussion with Bharath Rupireddy. Discussion: https://postgr.es/m/Y1d2FZmQmyAhPSRG@paquier.xyz
This commit is contained in:
parent
c591300a8f
commit
1b9cd69c5b
@ -594,3 +594,28 @@ SELECT * FROM tenk1 a JOIN my_gen_series(1,10) g ON a.unique1 = g;
|
||||
Index Cond: (unique1 = g.g)
|
||||
(4 rows)
|
||||
|
||||
-- Test functions for control data
|
||||
SELECT count(*) > 0 AS ok FROM pg_control_checkpoint();
|
||||
ok
|
||||
----
|
||||
t
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) > 0 AS ok FROM pg_control_init();
|
||||
ok
|
||||
----
|
||||
t
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) > 0 AS ok FROM pg_control_recovery();
|
||||
ok
|
||||
----
|
||||
t
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) > 0 AS ok FROM pg_control_system();
|
||||
ok
|
||||
----
|
||||
t
|
||||
(1 row)
|
||||
|
||||
|
@ -223,3 +223,9 @@ SELECT * FROM tenk1 a JOIN my_gen_series(1,1000) g ON a.unique1 = g;
|
||||
|
||||
EXPLAIN (COSTS OFF)
|
||||
SELECT * FROM tenk1 a JOIN my_gen_series(1,10) g ON a.unique1 = g;
|
||||
|
||||
-- Test functions for control data
|
||||
SELECT count(*) > 0 AS ok FROM pg_control_checkpoint();
|
||||
SELECT count(*) > 0 AS ok FROM pg_control_init();
|
||||
SELECT count(*) > 0 AS ok FROM pg_control_recovery();
|
||||
SELECT count(*) > 0 AS ok FROM pg_control_system();
|
||||
|
Loading…
Reference in New Issue
Block a user