apache / apache/datafusion-sqlparser-rs
Expected literal number, found: $1
- Langage dominant
- Rust
- Étoiles
- 3.5k
- Forks
- 772
- Merge moyen
- 4 j 9 h
- PR mergées (30 j)
- 17
Description
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")',
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- 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
- 48/100