cockroachdb / cockroachdb/cockroach
sql: support deferred optbuild for trigger function
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Trigger function body statements are now eagerly optbuild. We should make it consistent with the deferred optbuild model of routines.
And it requires the same "can it mutate" check like for routines. The missing pieces are: optbuilder must read CanMutate from the trigger descriptor instead of deriving it from the eagerly built body, and propagateCanMutateToCallersDSC must also walk TriggerFunctionCall back-references, not just function back-references.
Jira issue: CRDB-65989
Epic: CRDB-66266
Contributor guide
Research direction
Start by locating the optbuilder logic for trigger descriptors and the propagateCanMutateToCallersDSC implementation. Compare trigger-function handling with the existing deferred optbuild and mutation checks for routines, including how function back-references are traversed. Done means trigger bodies use deferred optbuild, CanMutate is read from the trigger descriptor, and TriggerFunctionCall back-references are propagated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100