apache / apache/datafusion-sqlparser-rs

Expected literal number, found: $1

Aperta
#486 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
3.5k
Fork
772
Merge medio
4g 9h
PR unite (30g)
17

Descrizione

test code:

```rust
#[test]
fn test_sql() {
let sql = "select distinct incident0_.incident_id as incident1_39_ from incident incident0_ where 1=1 order by incident0_.create_time desc limit $1";
Parser::parse_sql(&dialect, sql).unwrap();
}
```

result:

```text
called `Result::unwrap()` on an `Err` value: ParserError("Expected literal number, found: $1")
thread 'interceptor::pg::tests::test_sql' panicked at 'called `Result::unwrap()` on an `Err` value: ParserError("Expected literal number, found: $1")',
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start with the provided test case and the Parser::parse_sql entry point, then trace how the LIMIT expression handles the $1 parameter. The issue is done when this SQL parses successfully without the “Expected literal number” error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust, sql
Ambito
databases
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.