Repository navigation
Generic: Fix quotes when displaying SHOW ... ILIKE patterns - #2787
slopgobblercobbler wants to merge 1 commit into
Conversation
In `ShowStatementFilter::ILike`, the format string omitted single quotes around the escaped string pattern, causing statements like `SHOW DATABASES ILIKE '%DE%'` to format as `SHOW DATABASES ILIKE %DE%`, failing to reparse when the pattern is not an identifier. Closes apache#2759.
|
Thank you for the contribution. The change may well be correct, but I am closing this PR under the DataFusion AI policy, which also applies to sqlparser-rs: https://datafusion.apache.org/contributor-guide/ai-policy.html#what-is-an-ai-dump-and-why-it-is-not-helpful Maintainer review time is the scarcest resource in this project. This account has recently opened many AI-generated PRs across many repositories. That suggests the changes aren't coming from someone who uses sqlparser-rs, and that no human will be around to discuss review feedback and maintain the code. Reviewing PRs like this costs us more time than it saves. If you do use sqlparser-rs and this fix matters to you, please pick the one change you care most about. Then open a focused PR with a short description in your own words, one you have reviewed and understand, and we'd be happy to help with review. |
Dialects: generic, clickhouse
Description
Fixes #2759.
When formatting
ShowStatementFilter::ILike(pattern), single quotes around the pattern were omitted:Consequently, statements such as
SHOW DATABASES ILIKE '%DE%'were displayed asSHOW DATABASES ILIKE %DE%, failing roundtrip parsing whenever the pattern contains characters like%that are not valid barewords.This PR adds the missing single quotes around the escaped string pattern, matching
ShowStatementFilter::Like:Tests
SHOW DATABASES ILIKE '%DE%'andSHOW TABLES ILIKE '%abc%'intests/sqlparser_clickhouse.rs.SHOW CATALOGS/DATABASES/SCHEMAS ILIKEand single-quote escaping ('a''b') intests/sqlparser_common.rs.cargo test --all-features).