apache / apache/datafusion-sqlparser-rs
[Postgres] Parsing sequence of `SHOW` and `SET` is a bit off
- Langage dominant
- Rust
- Étoiles
- 3.5k
- Forks
- 772
- Merge moyen
- 4 j 9 h
- PR mergées (30 j)
- 17
Description
```rust
Parser::parse_sql(&PostgreSqlDialect {}, "SHOW search_path; SHOW timezone; SET search_path TO public;").unwrap()
```
The above results in:
```rust
[
ShowVariable {
variable: [
Ident {
value: "search_path",
quote_style: None,
span: Span(Location(1,6)..Location(1,17)),
},
Ident {
value: "SHOW",
quote_style: None,
span: Span(Location(1,19)..Location(1,23)),
},
Ident {
value: "timezone",
quote_style: None,
span: Span(Location(1,24)..Location(1,32)),
},
Ident {
value: "SET",
quote_style: None,
span: Span(Location(1,34)..Location(1,37)),
},
Ident {
value: "search_path",
quote_style: None,
span: Span(Location(1,38)..Location(1,49)),
},
Ident {
value: "TO",
quote_style: None,
span: Span(Location(1,50)..Location(1,52)),
},
Ident {
value: "public",
quote_style: None,
span: Span(Location(1,53)..Location(1,59)),
},
],
},
]
```
Its `Display` impl results in `"SHOW search_path SHOW timezone SET search_path TO public"`
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Reproduisez le problème avec Parser::parse_sql, PostgreSqlDialect et la séquence SHOW/SET présentée ici. Examinez comment le dialecte PostgreSQL analyse ces instructions et comment leur sortie Display est produite. C'est terminé lorsque les instructions sont analysées comme des instructions distinctes et affichées sans absorber les commandes ultérieures dans la première variable SHOW.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- postgresql, rust, sql
- Domaine
- databases
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 42/100