apache / apache/datafusion-sqlparser-rs

MSSQL parsing errors

オープン
#1,709 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
3.5k
フォーク
772
平均マージ
4日 9時間
マージ済み PR(30日)
17

説明

1. The `PRINT string | @variable | str_expression` statement in MSSQL doesn't parse as a valid statement, and causes all other statement parsing to fail. I'm processing it now by finding and extracting all of them ahead of time, but it would be nice if they could be handled and ignored--treated essentially the same as comments.

They currently fail with:
`ParserError("Expected: an SQL statement, found: PRINT")`

2. Also, the CONSTRAINT line in this statement fails:
```
CREATE TABLE SAMPLE
(
[ID] numeric(19) NOT NULL ,
CONSTRAINT [ID_PK] PRIMARY KEY CLUSTERED ([ID] ASC)
)
```
With:
`ParserError("Expected: ), found: ASC")`

Also, am happy to contribute PR(s) if you have some general pointers as to where I should start looking :)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start by reproducing the two reported MSSQL cases: PRINT statements currently produce an expected SQL statement error, and the CREATE TABLE constraint produces an expected ')' error at ASC. Trace the parser entry points handling these statements and add regression coverage; done means PRINT no longer prevents other statements from parsing and the clustered primary-key constraint parses successfully.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust, sql
領域
compilers, databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。