Sean-Kenneth-Doherty opened a new pull request, #22299: URL: https://github.com/apache/datafusion/pull/22299
## Which issue does this PR close? - Closes #22224. ## Rationale for this change `EXPLAIN INSERT INTO t VALUES ($0)` currently panics while inferring parameter types for INSERT VALUES. Other SQL paths already reject `$0` as an invalid placeholder index, and the INSERT inference path should do the same instead of subtracting one from zero. ## What changes are included in this PR? - Adds a zero-index guard before INSERT VALUES placeholder numbers are converted to parameter vector positions. - Aligns the INSERT VALUES error with the existing invalid-placeholder planning error. - Adds a standalone SQL logic regression for `EXPLAIN INSERT INTO ... VALUES ($0)`. ## Are these changes tested? Yes. - `cargo test -p datafusion-sqllogictest --test sqllogictests -- insert_values_placeholders.slt` - `cargo test -p datafusion-sql` - `cargo fmt --check` - `cargo clippy -p datafusion-sql --all-targets -- -D warnings` - `git diff --cached --check` ## Are there any user-facing changes? Yes. `INSERT ... VALUES ($0)` now returns a planning error instead of panicking. ## Scope note The change is limited to INSERT VALUES placeholder type inference and the new regression coverage. I did not find any broader placeholder semantics that needed to change. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
