You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-52489][SQL] Forbid duplicate SQLEXCEPTION and NOT FOUND handlers inside SQL Script
### What changes were proposed in this pull request?
In this PR we forbid duplicate SQLEXCEPTION or NOT FOUND exception handlers to be defined in the same scope. This was already done for different conditions and sqlstates but was not done for these 2 types of exception handlers. Code like this should fail:
```
BEGIN
DECLARE EXIT HANDLER FOR NOT FOUND
BEGIN
SELECT 1;
END;
DECLARE EXIT HANDLER FOR NOT FOUND
BEGIN
SELECT 2;
END;
END
```
### Why are the changes needed?
This is a bug fix.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
New tests in `SqlScriptingInterpreterSuite`.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes#51168 from miland-db/milan-dankovic_data/forbid-duplicate-handlers.
Authored-by: Milan Dankovic <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit 23cf926)
Signed-off-by: Wenchen Fan <[email protected]>
0 commit comments