Skip to content

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Apr 11, 2024

This PR allows us to use DECLARE statements in TRIGGERS.
The analyzer rule applyTriggers was altered to initialize ProcedureReference for TriggerBeginEndBlock.
The important part was ensuring that all relevant nodes (TriggerBeingEndBlock, BeginEndBlock, ProcedureParam) all had the same ProcedureReference and to search in all the nodes.

Additionally, nil guards are added to all receiver methods for ProcedureReference to prevent panics.

It seems like events might have this issue, but there's a banaid fix for it. Not sure if I want to touch that code.

fixes: dolthub/dolt#7720

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! only thing i'd change is reverting/skipping TestSingleScript

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm again! more tests and tighter organization definitely improvements

@jycor jycor merged commit bce4903 into main Apr 12, 2024
@jycor jycor deleted the james/trigger branch April 12, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on BEFORE INSERT trigger using DECLARE variable

2 participants