Repository navigation
Commit a23b89f
fix: reject unsupported DELETE LIMIT (#25005)
## Which issue does this PR close?
- Part of #24998; this PR adds a safe rejection until bounded DELETE is
implemented.
## Rationale for this change
DELETE with LIMIT currently appears to plan successfully, but the table
provider receives only the filters and deletes every matching row.
Rejecting the unsupported clause prevents a bounded delete from silently
becoming an unbounded one and matches the existing UPDATE LIMIT
behavior.
## What changes are included in this PR?
- reject DELETE LIMIT during SQL planning
- remove the unreachable limit construction from delete_to_plan
- replace the misleading EXPLAIN snapshots with error regressions, both
with and without WHERE
- directly cover both planner rejection branches in the SQL integration
suite
## What is the testing strategy for this PR?
- cargo test -p datafusion-sqllogictest --test sqllogictests -- delete
- cargo test -p datafusion-sql --lib (88 passed)
- cargo test -p datafusion-sql --test sql_integration
plan_delete_rejects_limit (2 passed)
- cargo clippy -p datafusion-sql --all-targets -- -D warnings
- cargo fmt --all -- --check
## Are there any user-facing changes?
Yes. DELETE statements containing LIMIT now return a not-implemented
planning error instead of accepting the limit and potentially deleting
every matching row. There is no public Rust API change.
Implementation and validation were completed with AI coding assistance
under the account owner’s direction.
---------
Co-authored-by: Andrew Lamb <[email protected]>
Co-authored-by: Martin Grigorov <[email protected]>
Co-authored-by: Martin Tzvetanov Grigorov <[email protected]>1 parent 409e3b8 commit a23b89f
3 files changed
Lines changed: 21 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1248 | 1248 | | |
1249 | 1249 | | |
1250 | 1250 | | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
1251 | 1255 | | |
1252 | 1256 | | |
1253 | 1257 | | |
| |||
1256 | 1260 | | |
1257 | 1261 | | |
1258 | 1262 | | |
1259 | | - | |
| 1263 | + | |
1260 | 1264 | | |
1261 | 1265 | | |
1262 | 1266 | | |
| |||
2346 | 2350 | | |
2347 | 2351 | | |
2348 | 2352 | | |
2349 | | - | |
2350 | 2353 | | |
2351 | 2354 | | |
2352 | 2355 | | |
| |||
2360 | 2363 | | |
2361 | 2364 | | |
2362 | 2365 | | |
2363 | | - | |
| 2366 | + | |
2364 | 2367 | | |
2365 | 2368 | | |
2366 | 2369 | | |
| |||
2377 | 2380 | | |
2378 | 2381 | | |
2379 | 2382 | | |
2380 | | - | |
2381 | | - | |
2382 | | - | |
2383 | | - | |
2384 | | - | |
2385 | | - | |
2386 | | - | |
2387 | | - | |
2388 | 2383 | | |
2389 | 2384 | | |
2390 | 2385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
853 | 864 | | |
854 | 865 | | |
855 | 866 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 120 | + | |
| 121 | + | |
130 | 122 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 123 | + | |
| 124 | + | |
143 | 125 | | |
144 | 126 | | |
145 | 127 | | |
| |||
0 commit comments