KolorYan opened a new issue, #34281:
URL: https://github.com/apache/shardingsphere/issues/34281
## Bug Report
simple sql:
`SELECT *
FROM a
WHERE pid = #{pid}
AND `type` IN (select `type`
from b
where pid = #{bpid}
);
`
1. a is a shard table, pid is shard column
2. b is a single table, it has a column named 'pid' too
3. in method
org.apache.shardingsphere.sharding.route.engine.condition.engine.WhereClauseShardingConditionEngine#createShardingConditions(org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext,
java.util.List<java.lang.Object>)
variable columnExpressionTableNames mapping column and table, because
table a and b both exist a column 'pid', so the map ping result is pid -> b,
but expected is pid -> a, because b is a single table, should be ignored
<img width="1166" alt="image"
src="https://github.com/user-attachments/assets/cfd84246-aaec-4f0c-8875-c01f94576786"
/>
<img width="1195" alt="image"
src="https://github.com/user-attachments/assets/9fb1a057-22f7-4788-9cf2-549409ae53b4"
/>
### Which version of ShardingSphere did you use?
5.5.1
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
### Expected behavior
shard on table a_xxx
### Actual behavior
shard on all tables for a
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]