abhinav-phi opened a new pull request, #2788:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2788
`FOR NO KEY UPDATE` and `FOR KEY SHARE` are valid PostgreSQL row locking
strengths but were rejected:
sql parser error: Expected: one of UPDATE or SHARE, found: NO
sql parser error: Expected: one of UPDATE or SHARE, found: KEY
Add `LockType::NoKeyUpdate` / `LockType::KeyShare`, display them as `NO KEY
UPDATE` / `KEY SHARE`, and parse them in `parse_lock` before the existing `OF`
/ `NOWAIT` / `SKIP LOCKED` handling.
Grammar:
https://www.postgresql.org/docs/current/sql-select.html#SQL-FOR-UPDATE-SHARE
Tests cover both forms with `OF` and wait policies in PostgreSQL and
Generic, and incomplete forms are rejected. Added fuzz seed
`fuzz/fuzz_seeds/postgres_2778_row_locking.sql`.
Validation: `cargo test --all-features`, `cargo fmt --all -- --check`,
`cargo clippy --all-targets --all-features -- -D warnings`.
Fixes #2778.
AI-ASSISTED: yes. human reviewer: @abhinav-phi.
--
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]