Skip to content

Commit 6e7361c

Browse files
committed
Fix custom validators call in build_local_reloptions()
We need to call them only when validate == true. Backpatch to 13, where opclass options were introduced. Reported-by: Tom Lane Discussion: https://postgr.es/m/2656633.1681831542%40sss.pgh.pa.us Reviewed-by: Tom Lane, Pavel Borisov Backpatch-through: 13
1 parent 109363d commit 6e7361c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/access/common/reloptions.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,8 +1972,9 @@ build_local_reloptions(local_relopts *relopts, Datum options, bool validate)
19721972
fillRelOptions(opts, relopts->relopt_struct_size, vals, noptions, validate,
19731973
elems, noptions);
19741974

1975-
foreach(lc, relopts->validators)
1976-
((relopts_validator) lfirst(lc)) (opts, vals, noptions);
1975+
if (validate)
1976+
foreach(lc, relopts->validators)
1977+
((relopts_validator) lfirst(lc)) (opts, vals, noptions);
19771978

19781979
if (elems)
19791980
pfree(elems);

0 commit comments

Comments
 (0)