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 2020/04/28 08:34:24 UTC
[GitHub] [shardingsphere] leego86 opened a new issue #5366: batch insert route result is wrong
leego86 opened a new issue #5366:
URL: https://github.com/apache/shardingsphere/issues/5366
## 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 **more than 7 days** 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?
4.0.0
### Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-JDBC
### Expected behavior
Logic SQL:
insert into test_complex (`name`,age,create_time,modified_time,user_id,phone,address)
values(?,?,?,?,?, ?,?) , (?,?,?,?,?,?,?)
route result of sharding key(id)
logicName=sharding_db, value=461910991453999104, hash=1101970150 , mod=0
logicName=sharding_db, mod=0 ,route =sharding_db_0
logicName=test_complex, value=461910991453999104, hash=1101970150 , mod=6
logicName=test_complex, mod=6 ,route =test_complex_6
logicName=test_complex, mod=1 ,route =test_complex_1
logicName=sharding_db, value=461910991453999108, hash=1101970154 , mod=0
logicName=sharding_db, mod=0 ,route =sharding_db_0
logicName=test_complex, value=461910991453999108, hash=1101970154 , mod=2
logicName=test_complex, mod=2 ,route =test_complex_2
### Actual behavior
Actual SQL: sharding_db_1 ::: insert into test_complex_3 (`name`,age,create_time,modified_time,user_id,phone,address,id) values
(?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?)
::: [null, 1, 2020-04-28 15:09:21.415, 2020-04-28 15:09:21.415, 09c53d8e85934bbf8aeeec3d4711c0c95, 09c53d8e85934bbf8aeeec3d4711c0c95, 时代峰峻克鲁赛德, 461910991453999108, null, 1, 2020-04-28 15:09:21.415, 2020-04-28 15:09:21.415, 09c53d8e85934bbf8aeeec3d4711c0c98, 09c53d8e85934bbf8aeeec3d4711c0c98, 时代峰峻克鲁赛德, 461910991453999105]
### Reason analyze (If you can)
ShardingGeneratedKeyInsertValueParameterRewriter rewrite generateKey values had a descendingIterator

the params had a descending order of route result, cause th actual sql is wrong
why use descendingIterator here ? if use common iterator would cause some problems?
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
### Example codes for reproduce this issue (such as a github link).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tristaZero commented on issue #5366: batch insert route result is wrong
Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #5366:
URL: https://github.com/apache/shardingsphere/issues/5366#issuecomment-677436700
Hi @leego86 Sorry for my late response.
Looking at your debugging, It seems you located the cause, didn't you?
Is there any progress for this issue. Besides, your issue is related to #6895.
Considering the serious effect on the users, it is expected to figure them out entirely before the next release. Could you give us a hand?
Waiting for your reply.
Best,
Trista
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] kimmking commented on issue #5366: batch insert route result is wrong
Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #5366:
URL: https://github.com/apache/shardingsphere/issues/5366#issuecomment-620522301
duplicated with https://github.com/apache/shardingsphere/issues/4573
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] leego86 closed issue #5366: batch insert route result is wrong
Posted by GitBox <gi...@apache.org>.
leego86 closed issue #5366:
URL: https://github.com/apache/shardingsphere/issues/5366
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org