apache / apache/datafusion-sqlparser-rs
[Postgres] Parsing sequence of `SHOW` and `SET` is a bit off
- Linguagem predominante
- Rust
- Estrelas
- 3.5k
- Forks
- 772
- Merge médio
- 4d 9h
- PRs com merge (30d)
- 17
Descrição
```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"`
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Reproduza o problema com Parser::parse_sql, PostgreSqlDialect e a sequência SHOW/SET mostrada aqui. Inspecione como o dialeto PostgreSQL analisa essas instruções e como sua saída de Display é produzida. Está concluído quando as instruções são analisadas como instruções separadas e exibidas sem absorver comandos posteriores na primeira variável SHOW.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- postgresql, rust, sql
- Domínio
- databases
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 42/100