apache / apache/datafusion-sqlparser-rs
MSSQL parsing errors
- Vorherrschende Sprache
- Rust
- Sterne
- 3.5k
- Forks
- 772
- Ø Merge
- 4 T. 9 Std.
- Gemergte PRs (30 T.)
- 17
Beschreibung
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 :)
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust, sql
- Bereich
- compilers, databases
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100