apache / apache/datafusion-sqlparser-rs

Expected literal number, found: $1

Open
#486 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
3.5k
Forks
772
Avg merge
4d 9h
Merged PRs (30d)
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")',
```

Contributor guide

No contributing guide indexed for this repository

Research direction

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.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.