apache / apache/datafusion-sqlparser-rs
INSERT from SELECT cannot be parsed with an ON CONFLICT clause
- Lingua principale
- Rust
- Stelle
- 3.5k
- Fork
- 772
- Merge medio
- 4g 9h
- PR unite (30g)
- 17
Descrizione
Parsing the following SQL
```sql
INSERT INTO foo
SELECT 1, 'data'
ON CONFLICT DO NOTHING
```
fails with
```
Expected: end of statement, found: CONFLICT at Line: 3, Column: 6
```
both for Generic and PostgreSQL dialects.
However, at least in PostgreSQL it seems to be a valid construct, equivalent to
```sql
INSERT INTO foo
(SELECT 1, 'data')
ON CONFLICT DO NOTHING
```
(this one is parsed by `sqlparser` correctly).
The same query without the "ON CONFLICT" clause can be successfully parsed too.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Riproducete la query INSERT ... SELECT ... ON CONFLICT fornita tramite il parser SQL, verificando sia il dialetto Generic sia quello PostgreSQL e confrontandola con la forma tra parentesi. Tracciate il punto di ingresso del parsing dell’istruzione INSERT e confermate che la forma senza parentesi venga accettata, mentre i casi esistenti rimangono validi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust, sql
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100