apache / apache/datafusion-sqlparser-rs

MSSQL parsing errors

未关闭
#1,709 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
3.5k
派生
772
平均合并
4 天 9 小时
30 天内合并 PR
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 摘要。