`SHOW TABLES ... LIKE 'p' LIMIT n` is displayed with the `LIKE` after `LIMIT`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 62/100
调研方向
Start with parse_show_stmt_options in the parser, where the suffix LIKE filter is read right after show_in, then compare it with Display for ShowStatementOptions, which writes the fields in a different order. Check the round-trip tests for SHOW TABLES and SHOW DATABASES with a ClickHouseDialect. Done when SHOW TABLES FROM system LIKE '%user%' LIMIT 2 displays in the same order it was parsed and reparses with the filter intact, and the Snowflake infix case still round-trips.
由索引模型根据 Issue 内容生成。
描述
With dialects that take the LIKE filter as a suffix (ClickHouse, MySQL, Generic, ...), Display writes it after LIMIT, and the output reparses as a LIKE inside the limit expression:
SHOW TABLES FROM system LIKE '%user%' LIMIT 2 (ClickHouseDialect)
-> displays as: SHOW TABLES FROM system LIMIT 2 LIKE '%user%'
-> reparses with LIMIT (2 LIKE '%user%') and no filter
SHOW DATABASES LIKE '%de%' LIMIT 2
-> displays as: SHOW DATABASES LIMIT 2 LIKE '%de%' (same AST change)
SHOW TABLES LIKE 'x%' LIMIT 2 (SnowflakeDialect, infix filter)
-> round-trips (fine)
ClickHouse puts the pattern before LIMIT: SHOW [FULL] [TEMPORARY] TABLES [{FROM | IN} <db>] [[NOT] LIKE | ILIKE '<pattern>'] [LIMIT <N>] ... (https://clickhouse.com/docs/sql-reference/statements/show).
parse_show_stmt_options reads the suffix filter right after show_in, before STARTS WITH / LIMIT / FROM, but Display for ShowStatementOptions uses "{like_in_infix}{show_in}{starts_with}{limit}{from}{like_in_suffix}".
Tested on main ce12f1f6 (also 0.63.0 and 0.58.0).
Found with a property-based fuzzer (round trip check); I used AI assistance for triage and verified every case above.
- 主要语言
- Rust
- 星标
- 3.5k
- 派生
- 805
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 116
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/datafusion-sqlparser-rs 的其他 Issue
-
Redshift
难度 2/5 1-3 小时 新手友好度 82/100
apache/datafusion-sqlparser-rs#2959 ·
维护者通常 1 天内回复
-
Redshift
难度 2/5 1-3 小时 新手友好度 68/100
apache/datafusion-sqlparser-rs#2958 ·
维护者通常 1 天内回复
-
PostgreSQL
难度 2/5 1-3 小时 新手友好度 76/100
apache/datafusion-sqlparser-rs#2862 ·
维护者通常 1 天内回复
-
PostgreSQL
难度 2/5 1-3 小时 新手友好度 75/100
apache/datafusion-sqlparser-rs#2861 ·
维护者通常 1 天内回复
-
PostgreSQL
难度 2/5 1-3 小时 新手友好度 77/100
apache/datafusion-sqlparser-rs#2858 ·
维护者通常 1 天内回复
查看 apache/datafusion-sqlparser-rs 的全部 Issue
相似的 Issue
-
area:schema documentation
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
ElectronicWave/Elemental#252 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
dekobon/big-code-analysis#1887 ·
维护者通常 1 天内回复
-
Shell中文符号输入异常未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复