cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

sql: fix conflicting udf options validation

Open chengxiong-ruan opened this issue 3 years ago • 1 comments

A silly mistake that forgot to add option type to the map :(

Release note: None

chengxiong-ruan avatar Aug 10 '22 19:08 chengxiong-ruan

This change is Reviewable

cockroach-teamcity avatar Aug 10 '22 19:08 cockroach-teamcity

pkg/sql/opt/optbuilder/create_function.go line 72 at r1 (raw file):

Previously, mgartner (Marcus Gartner) wrote…

It's not a super performance critical code path, but the map and reflection are an anti-pattern. You could define a helper to check for duplicate options that simply stores a bool for each option type.

ah yeah, I agree, I'll make a helper for it. thanks.

chengxiong-ruan avatar Aug 11 '22 14:08 chengxiong-ruan

TFTR! 🙏 bors r+

chengxiong-ruan avatar Aug 18 '22 15:08 chengxiong-ruan

Build failed (retrying...):

craig[bot] avatar Aug 18 '22 17:08 craig[bot]

Build succeeded:

craig[bot] avatar Aug 18 '22 20:08 craig[bot]