apache / apache/datafusion-sqlparser-rs
MySQL Compatibility Issues
- 主要言語
- Rust
- スター
- 3.5k
- フォーク
- 772
- 平均マージ
- 4日 9時間
- マージ済み PR(30日)
- 17
説明
Hi - first want to say what an amazing and fun to work with lib this is!
Looking to use this for a MySQL project, but some of the queries I'm working with aren't supported yet.
It seems for now you are accepting dialect-specific extensions in the mainline parser, so am happy to work on this. I have a fork which fixes each of the following issues. Should I open separate issues/PRs, or is it more helpful if I raise a PR for all them? (Several are just `bool`s on `Statement::{ }` variants)
##### `INSERT [IGNORE] ...` ([mysqltutorial](https://www.mysqltutorial.org/mysql-insert-ignore/))
__Summary:__ An optional `IGNORE` keyword after `INSERT`
__Query:__ `INSERT IGNORE INTO user (id) VALUES (1)`
__Result:__ `ParserError("Expected one of INTO or OVERWRITE, found: IGNORE")`
---
##### `INSERT [INTO] tbl_name ...` ([docs](https://dev.mysql.com/doc/refman/5.6/en/insert.html))
__Summary:__ The `INTO` keywords is optional
__Query:__ `INSERT user (id) VALUES (1)`
__Result:__ `ParserError("Expected one of INTO or OVERWRITE, found: users")`
---
##### `INSERT ... SET ` ([docs](https://dev.mysql.com/doc/refman/5.6/en/insert.html), [SO](https://stackoverflow.com/questions/861722/mysql-insert-into-table-values-vs-insert-into-table-set))
__Summary:__ Inserts can set fields with an alternate syntax, similar to an `UPDATE` query
__Query:__ `INSERT INTO user SET id = 1`
__Result:__ `ParserError("Expected SELECT, VALUES, or a subquery in the query body, found: SET")`
---
##### `INSERT ... [ON DUPLICATE KEY UPDATE ]` ([mysqltutorial](https://www.mysqltutorial.org/mysql-insert-or-update-on-duplicate-key-update/))
__Summary:__ Inserts can fallback to updates on a key collision
__Query:__ `INSERT INTO user (id, name) VALUES (1, 'Printer') ON DUPLICATE KEY UPDATE name = 'Central Printer'`
__Result:__ `ParserError("Expected end of statement, found: ON")`
---
##### `UPDATE ... [ORDER BY ...] [LIMIT row_count]` ([docs](https://dev.mysql.com/doc/refman/8.0/en/update.html))
__Summary:__ Updates can optionally include `ORDER BY` and `LIMIT` clauses
__Query:__ `UPDATE user SET id = 1 ORDER BY id LIMIT 1`
__Result:__ `ParserError("Expected end of statement, found: ORDER")`
---
##### `DELETE ... [ORDER BY ...] [LIMIT row_count]` ([docs](https://dev.mysql.com/doc/refman/5.6/en/delete.html))
__Summary:__ Deletes can optionally include `ORDER BY` and `LIMIT` clauses
__Query:__ `DELETE FROM user ORDER BY id LIMIT 1`
__Result:__ `ParserError("Expected end of statement, found: ORDER")`
---
##### `BINARY ` ([docs](https://dev.mysql.com/doc/refman/5.6/en/cast-functions.html#operator_binary))
__Summary:__ The `BINARY` operator/unary function can operate without parameters (similar to `INTERVAL 1 DAYS`)
__Query:__ `SELECT * FROM user WHERE name = BINARY 'name'`
__Result:__ `ParserError("Expected end of statement, found: \'name\'")`
---
Many thanks!
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
メインラインパーサーと issue で言及されている Statement の各バリアントから始め、次に 7 つの MySQL クエリをそれぞれ再現して、現在のパース失敗を特定します。列挙されたすべての INSERT、UPDATE、DELETE、BINARY 形式がパーサーエラーなしで受け入れられ、各構文バリアントのカバレッジが追加されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- mysql, rust, sql
- 領域
- databases
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100