apache / apache/datafusion-sqlparser-rs

Unquoted identifiers naming rule is incorrect

未關閉
#1,197 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Rust
星號
3.5k
分支
772
平均合併
4 天 9 小時
30 天內合併 PR
17

描述

The naming rule is in https://dev.mysql.com/doc/refman/8.0/en/identifiers.html

The rule for unquoted identifiers is incorrect.
* ASCII: [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar, underscore)
* Extended: U+0080 .. U+FFFF

In the following test, we can see that `@` is unpermitted
https://github.com/sqlparser-rs/sqlparser-rs/blob/44727891713114b72546facf21a335606380845a/tests/sqlparser_mysql.rs#L1661

I think we need to fix the unquoted identifiers for MYSQL and HIVE
https://github.com/sqlparser-rs/sqlparser-rs/blob/44727891713114b72546facf21a335606380845a/src/tokenizer.rs#L803-L811

MYSQL
https://github.com/sqlparser-rs/sqlparser-rs/blob/44727891713114b72546facf21a335606380845a/src/dialect/mysql.rs#L28-L41

HIVE
https://github.com/sqlparser-rs/sqlparser-rs/blob/44727891713114b72546facf21a335606380845a/src/dialect/hive.rs#L28-L36

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

從 tests/sqlparser_mysql.rs:1661 附近的 MySQL 測試開始,接著閱讀 src/tokenizer.rs:803-811 中未加引號識別碼的邏輯,以及 MYSQL 和 HIVE 方言定義。更新兩個方言的規則涵蓋範圍,並新增或調整測試,使 @ 被拒絕,同時接受文件中說明的 ASCII 和擴充範圍。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
mysql, rust, sql
領域
databases
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。