apache / apache/datafusion-sqlparser-rs

MSSQL parsing errors

Ouverte
#1,709 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Rust
Étoiles
3.5k
Forks
772
Merge moyen
4 j 9 h
PR mergées (30 j)
17

Description

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 :)

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
rust, sql
Domaine
compilers, databases
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.