apache / apache/datafusion-sqlparser-rs
`is_alphabetic` or `is_ascii_alphabetic`?
- 主要言語
- Rust
- スター
- 3.5k
- フォーク
- 772
- 平均マージ
- 4日 9時間
- マージ済み PR(30日)
- 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
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100