From b733e1bebee8c39f1d341a1f2edf78a4db3284bc Mon Sep 17 00:00:00 2001 From: gentle_hu Date: Sat, 26 Aug 2023 11:09:43 +0800 Subject: [PATCH] add testcase for statement_history and standby_statement_history --- src/test/regress/input/pg_proc_test.source | 8 ++++++++ src/test/regress/output/pg_proc_test.source | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/test/regress/input/pg_proc_test.source b/src/test/regress/input/pg_proc_test.source index 75e56d4c1..f6c20bbac 100644 --- a/src/test/regress/input/pg_proc_test.source +++ b/src/test/regress/input/pg_proc_test.source @@ -1,2 +1,10 @@ select provariadic,oid, proname from pg_proc where arraycontains(proargmodes::char[],ARRAY['v'::char]) order by oid; select prokind,length(prokind),count(*) from pg_proc where oid < 16384 group by prokind; + +-- The structure of function standby_statement_history must be consistent with table statement_history. +select + (select relnatts from pg_class where relname = 'statement_history' limit 1) + = + (select array_length(proargnames, 1) - 1 from pg_proc where proname = 'standby_statement_history' order by 1 limit 1) + as issame; + diff --git a/src/test/regress/output/pg_proc_test.source b/src/test/regress/output/pg_proc_test.source index 195b72bca..09411481c 100644 --- a/src/test/regress/output/pg_proc_test.source +++ b/src/test/regress/output/pg_proc_test.source @@ -34,3 +34,14 @@ select prokind,length(prokind),count(*) from pg_proc where oid < 16384 group by --? f | 1 | .* (1 row) +-- The structure of function standby_statement_history must be consistent with table statement_history. +select + (select relnatts from pg_class where relname = 'statement_history' limit 1) + = + (select array_length(proargnames, 1) - 1 from pg_proc where proname = 'standby_statement_history' order by 1 limit 1) + as issame; + issame +-------- + t +(1 row) +