apache / apache/shardingsphere
PostgreSQL You have an error in your SQL syntax: SELECT interval '1 -2:03' minute to second
- Dominant language
- Java
- Stars
- 20.8k
- Forks
- 6.9k
- Avg merge
- 11h 38m
- Merged PRs (30d)
- 326
Description
## Bug Report
### Which version of ShardingSphere did you use?
master - 6b095c835f5334f01bb6643565ddb3276e9f9a56
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
### Expected behavior
```
postgres=# SELECT interval '1 -2:03' minute to second;
interval
-----------------
1 day -00:02:03
(1 row)
```

### Actual behavior
```
postgres=> SELECT interval '1 -2:03' minute to second;
ERROR: You have an error in your SQL syntax: SELECT interval '1 -2:03' minute to second;, null
```

PostgreSQL grammar: https://github.com/postgres/postgres/blob/58597edea102258b21d5f4b4f0d7796c0ebf100a/src/backend/parser/gram.y#L16452-L16458
Contributor guide
Research direction
Start by reproducing `SELECT interval '1 -2:03' minute to second;` and compare it with the PostgreSQL grammar linked in the issue. Trace how ShardingSphere parses this interval expression; done means the query is accepted and returns the expected `1 day -00:02:03` result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100