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

Commit3ef16c4

Browse files
committed
Add some checks on "char"-type columns to type_sanity and opr_sanity.
I noticed that the sanity checks in the regression tests omitted tocheck a couple of "poor man's enum" columns that you'd reasonablyexpect them to check.There are other "char"-type columns in system catalogs that are notcovered by either type_sanity or opr_sanity, e.g. pg_rewrite.ev_type.However, those catalogs are not populated with any manually-createddata during bootstrap, so it seems less necessary to check themthis way.
1 parent26d538d commit3ef16c4

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ WHERE p1.prolang = 0 OR p1.prorettype = 0 OR
5757
array_upper(p1.proargtypes, 1) != p1.pronargs-1 OR
5858
0::oid = ANY (p1.proargtypes) OR
5959
procost <= 0 OR
60-
CASE WHEN proretset THEN prorows <= 0 ELSE prorows != 0 END;
60+
CASE WHEN proretset THEN prorows <= 0 ELSE prorows != 0 END OR
61+
provolatile NOT IN ('i', 's', 'v') OR
62+
proparallel NOT IN ('s', 'r', 'u');
6163
oid | proname
6264
-----+---------
6365
(0 rows)

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,9 @@ ORDER BY 1;
465465
-- Look for illegal values in pg_class fields
466466
SELECT p1.oid, p1.relname
467467
FROM pg_class as p1
468-
WHERE p1.relkind NOT IN ('r', 'i', 's', 'S', 'c', 't', 'v', 'f');
468+
WHERE relkind NOT IN ('r', 'i', 's', 'S', 'c', 't', 'v', 'f') OR
469+
relpersistence NOT IN ('p', 'u', 't') OR
470+
relreplident NOT IN ('d', 'n', 'f', 'i');
469471
oid | relname
470472
-----+---------
471473
(0 rows)

‎src/test/regress/sql/opr_sanity.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ WHERE p1.prolang = 0 OR p1.prorettype = 0 OR
6464
array_upper(p1.proargtypes,1)!=p1.pronargs-1OR
6565
0::oid= ANY (p1.proargtypes)OR
6666
procost<=0OR
67-
CASE WHEN proretset THEN prorows<=0 ELSE prorows!=0 END;
67+
CASE WHEN proretset THEN prorows<=0 ELSE prorows!=0 ENDOR
68+
provolatile NOTIN ('i','s','v')OR
69+
proparallel NOTIN ('s','r','u');
6870

6971
-- prosrc should never be null or empty
7072
SELECTp1.oid,p1.proname

‎src/test/regress/sql/type_sanity.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,9 @@ ORDER BY 1;
339339

340340
SELECTp1.oid,p1.relname
341341
FROM pg_classas p1
342-
WHEREp1.relkind NOTIN ('r','i','s','S','c','t','v','f');
342+
WHERE relkind NOTIN ('r','i','s','S','c','t','v','f')OR
343+
relpersistence NOTIN ('p','u','t')OR
344+
relreplident NOTIN ('d','n','f','i');
343345

344346
-- Indexes should have an access method, others not.
345347

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp