Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1b9cd69

Browse files
committed
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 thecontrol file data:- pg_control_checkpoint()- pg_control_init()- pg_control_recovery()- pg_control_system()This commit adds a minimal coverage for these functions, checking thattheir execution is able to complete. This would have been enough tocatch the problems introduced in the commit mentioned above. Morechecks could be done for each individual fields, but it is unclearwhether this would be better than the other checks in place in thebackend code.Per discussion with Bharath Rupireddy.Discussion:https://postgr.es/m/Y1d2FZmQmyAhPSRG@paquier.xyz
1 parentc591300 commit1b9cd69

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

‎src/test/regress/expected/misc_functions.out

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,3 +594,28 @@ SELECT * FROM tenk1 a JOIN my_gen_series(1,10) g ON a.unique1 = g;
594594
Index Cond: (unique1 = g.g)
595595
(4 rows)
596596

597+
-- Test functions for control data
598+
SELECT count(*) > 0 AS ok FROM pg_control_checkpoint();
599+
ok
600+
----
601+
t
602+
(1 row)
603+
604+
SELECT count(*) > 0 AS ok FROM pg_control_init();
605+
ok
606+
----
607+
t
608+
(1 row)
609+
610+
SELECT count(*) > 0 AS ok FROM pg_control_recovery();
611+
ok
612+
----
613+
t
614+
(1 row)
615+
616+
SELECT count(*) > 0 AS ok FROM pg_control_system();
617+
ok
618+
----
619+
t
620+
(1 row)
621+

‎src/test/regress/sql/misc_functions.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,9 @@ SELECT * FROM tenk1 a JOIN my_gen_series(1,1000) g ON a.unique1 = g;
223223

224224
EXPLAIN (COSTS OFF)
225225
SELECT*FROM tenk1 aJOIN my_gen_series(1,10) gONa.unique1= g;
226+
227+
-- Test functions for control data
228+
SELECTcount(*)>0AS okFROM pg_control_checkpoint();
229+
SELECTcount(*)>0AS okFROM pg_control_init();
230+
SELECTcount(*)>0AS okFROM pg_control_recovery();
231+
SELECTcount(*)>0AS okFROM pg_control_system();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp