apache / apache/datafusion-sqlparser-rs
`is_alphabetic` or `is_ascii_alphabetic`?
- 主要语言
- Rust
- 星标
- 3.5k
- 派生
- 772
- 平均合并
- 4 天 9 小时
- 30 天内合并 PR
- 17
描述
https://github.com/sqlparser-rs/sqlparser-rs/blob/4875dadbf5e691dd1e8ef179145829d8ca3ef4d8/src/dialect/mysql.rs#L32
In here, `is_alphabetic` checks for **Unicode Char with Alphabetic property**, which overlaps BMP(Basic Multilingual Plane) but not exclusive to BMP but also to astral plane and Han etc, should those be `is_ascii_alphabetic`?
other use of `is_alphabetic` have similiar problem, i.e. psql support a-z, but also letters with diacritical marks and non-Latin letters, which is kind of ambiguous though(presumably psql mean `is_alphabetic`?
so the current impl of mysql parser will accept chat not in BMP but is still Alphabetic(which is better than mysql standard I guess? but is inconsistent with mysql standard, since there are char in BMP that is not Alphabetic like `,`(FULLWIDTH COMMA)and Alphabetic Char not in BMP
refs to standards:
- unicode standard: https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt see `# Derived Property: Alphabetic` section
- mysql standard: https://dev.mysql.com/doc/refman/8.0/en/identifiers.html see
```
- Permitted characters in unquoted identifiers:
- ASCII: [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar, underscore)
- Extended: U+0080 .. U+FFFF
```
- psql standard: https://www.postgresql.org/docs/current/sql-syntax-lexical.html see `SQL identifiers and key words must begin with a letter (a-z, but also letters with diacritical marks and non-Latin letters) or an underscore (_)`
贡献指南
这个仓库没有索引到贡献指南
调研方向
Start with src/dialect/mysql.rs at line 32 and audit the other uses of `is_alphabetic` mentioned in the issue. Compare each dialect's identifier rules with the cited MySQL, PostgreSQL, and Unicode standards, then clarify the intended behavior and add regression coverage for the agreed character ranges.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- rust, sql
- 领域
- compilers, databases
- Issue 类型
- 缺陷
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 30/100