You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/10/09 03:01:18 UTC
[GitHub] [shardingsphere] 0xddy opened a new issue, #21409: Incorrect Actual SQL table
0xddy opened a new issue, #21409:
URL: https://github.com/apache/shardingsphere/issues/21409
## 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?
shardingsphere-jdbc-core-spring-boot-starter:5.2.0
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
### Expected behavior
Simple table storage and query
### Actual behavior
Incorrect Actual SQL,The SQL table is set at the wrong index
### Reason analyze (If you can)
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
1、Multiple springboot programs share this configuration
```
spring.shardingsphere.mode.type=Standalone
spring.shardingsphere.datasource.names=master
spring.shardingsphere.datasource.master.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.master.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.master.jdbc-url=jdbc:mysql://127.0.0.1:3306/bookstore?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.master.username=root
spring.shardingsphere.datasource.master.password=root
spring.shardingsphere.rules.sharding.tables.chapter.actual-data-nodes=master.chapter_$->{1..8}
spring.shardingsphere.rules.sharding.tables.chapter.table-strategy.standard.sharding-column=id
spring.shardingsphere.rules.sharding.tables.chapter.table-strategy.standard.sharding-algorithm-name=table-chapter-inline
# snowflake
spring.shardingsphere.rules.sharding.tables.chapter.key-generate-strategy.column=id
spring.shardingsphere.rules.sharding.tables.chapter.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.sharding-algorithms.table-chapter-inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.table-chapter-inline.props.algorithm-expression=chapter_$->{id%8+1}
spring.shardingsphere.rules.sharding.sharding-algorithms.table-chapter-inline.props.allow-range-query-with-inline-sharding=true
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.props.sql-show=true
```
The location of the datastore table is correct,like ID : 771489998674329601 in chapter_2,But other Springboot program for reading data pairs chapter_ 8 Query。
```
2022-10-09 10:46:05.828 INFO 24448 --- [ XNIO-1 task-1] ShardingSphere-SQL : Logic SQL: SELECT id,content,lastime,name,book_id FROM chapter WHERE (id = ?)
2022-10-09 10:46:05.828 INFO 24448 --- [ XNIO-1 task-1] ShardingSphere-SQL : Actual SQL: master ::: SELECT id,content,lastime,name,book_id FROM chapter_8
```
### Example codes for reproduce this issue (such as a github link).
```
// data is null
println(chapterService.iChapterService.getById(771489998674329601))
```
![image](https://user-images.githubusercontent.com/10867124/194735680-7cd5e2c3-21a9-42db-8cef-731433372373.png)
--
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] TeslaCN commented on issue #21409: Incorrect Actual SQL table
Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #21409:
URL: https://github.com/apache/shardingsphere/issues/21409#issuecomment-1364886771
Please try the ShardingSphere 5.3.0.
Maybe this issue has been fixed in 5.2.1? https://github.com/apache/shardingsphere/pull/21564
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] TeslaCN closed issue #21409: Incorrect Actual SQL table
Posted by GitBox <gi...@apache.org>.
TeslaCN closed issue #21409: Incorrect Actual SQL table
URL: https://github.com/apache/shardingsphere/issues/21409
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org