apache / apache/shardingsphere

5.4.1 execute select * from xx where id in (1,2,3,4,5,6,7……15000); when in 10000+ postgresql occurs error mysql ok

Open
#29,672 1 comment 0 reactions 0 assignees View on GitHub
db: PostgreSQL in: SQL parse status: volunteer wanted type: enhancement
Dominant language
Java
Stars
20.8k
Forks
6.9k
Avg merge
11h 38m
Merged PRs (30d)
326

Description

## Bug Report

**For English only**, other languages will not accept.

Before report a bug, make sure you have:

- Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
- Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).

Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will **close it**.

Please answer these questions before submitting your issue. Thanks!

### Which version of ShardingSphere did you use?

5.4.1

### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-JDBC

### Expected behavior

query the correct result

### Actual behavior

occurs error
image

### Reason analyze (If you can)
![image](https://github.com/apache/shardingsphere/assets/31396902/a7079cfa-fab3-47f1-b2e7-0b23dacb1646)

![image](https://github.com/apache/shardingsphere/assets/31396902/eadc2975-dad6-4d18-8059-c26f1831236c)

every the ExprListContext have the same children

### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

select * from xx where id in (1,2,3,4,5,6,7……15000);

### Example codes for reproduce this issue (such as a github link).

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported 15,000-value IN query in ShardingSphere-JDBC 5.4.1 against PostgreSQL and compare it with MySQL. Inspect the parser behavior around ExprListContext, which the report identifies as having repeated children; done means the PostgreSQL query returns the correct result without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, mysql, postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.