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

Commitdd2243f

Browse files
committed
Improve regression tests' code coverage for plpgsql control structures.
I noticed that our code coverage report showed considerable deficiencyin test coverage for PL/pgSQL control statements. Notably, bothexec_stmt_block and most of the loop control statements had very poorcoverage of handling of return/exit/continue result codes from theirchild statements; and exec_stmt_fori was seriously lacking in featurecoverage, having no test that exercised its BY or REVERSE features,nor verification that its overflow defenses work.Now that we have some infrastructure for plpgsql-specific test scripts,the natural thing to do is make a new script rather than further extendplpgsql.sql. So I created a new script plpgsql_control.sql with thecharter to test plpgsql control structures, and moved a few existingtests there because they fell entirely under that charter. I thenadded new test cases that exercise the bits of code complained of above.Of the five kinds of loop statements, only exec_stmt_while's result codehandling is fully exercised by these tests. That would be a deficiencyas things stand, but a follow-on commit will merge the loop statements'result code handling into one implementation. So testing each usage ofthat implementation separately seems redundant.In passing, also add a couple test cases to plpgsql.sql to more fullyexercise plpgsql's code related to expanded arrays --- I had thoughtthat area was sufficiently covered already, but the coverage reportshowed a couple of un-executed code paths.Discussion:https://postgr.es/m/26314.1514670401@sss.pgh.pa.us
1 parent5303ffe commitdd2243f

File tree

5 files changed

+1171
-765
lines changed

5 files changed

+1171
-765
lines changed

‎src/pl/plpgsql/src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ DATA = plpgsql.control plpgsql--1.0.sql plpgsql--unpackaged--1.0.sql
2626

2727
REGRESS_OPTS = --dbname=$(PL_TESTDB)
2828

29-
REGRESS = plpgsql_call
29+
REGRESS = plpgsql_call plpgsql_control
3030

3131
all: all-lib
3232

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp