Commit 3a49a2f
authored
fix: Handle EXECUTE without statement name (#22204)
## Which issue does this PR close?
- Closes #22197.
## Rationale for this change
`EXEC()` and `EXECUTE()` can parse as `Statement::Execute` without a
statement name. The planner previously unwrapped that optional name and
panicked on user-supplied SQL.
## What changes are included in this PR?
- Return a planning error when `EXECUTE` has no statement name.
- Add sqllogictest coverage for the malformed `EXEC` / `EXECUTE` forms
from the issue.
## Are these changes tested?
- `cargo test -p datafusion-sqllogictest --test sqllogictests --
prepare`
- `cargo fmt --all`
- `cargo clippy --all-targets --all-features -- -D warnings`
## Are there any user-facing changes?
Malformed `EXEC` / `EXECUTE` statements without a name now return a
planning error instead of panicking.1 parent 1ab146a commit 3a49a2f
2 files changed
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
889 | 893 | | |
890 | 894 | | |
891 | 895 | | |
892 | 896 | | |
893 | 897 | | |
894 | 898 | | |
895 | 899 | | |
896 | | - | |
| 900 | + | |
897 | 901 | | |
898 | 902 | | |
899 | 903 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
56 | 75 | | |
57 | 76 | | |
58 | 77 | | |
| |||
0 commit comments