-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: fix mysql through "select last_insert_id" get auto-increment failure #4310
bugfix: fix mysql through "select last_insert_id" get auto-increment failure #4310
Conversation
此时再调用genKeys.next()就会报错 指的是哪? |
This pull request fixes 1 alert when merging 2ec2098 into 11d3478 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging 2d0437c into 11d3478 - view on LGTM.com fixed alerts:
|
rm-datasource/src/main/java/io/seata/rm/datasource/exec/mysql/MySQLInsertExecutor.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/exec/mysql/MySQLInsertExecutor.java
Outdated
Show resolved
Hide resolved
This pull request fixes 1 alert when merging 84972bc into 11d3478 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging 18f10ef into 11d3478 - view on LGTM.com fixed alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request fixes 1 alert when merging cc89dea into 2c6e647 - view on LGTM.com fixed alerts:
|
OK,等下下班回去改一下 |
Codecov Report
@@ Coverage Diff @@
## develop #4310 +/- ##
==========================================
Coverage 48.52% 48.52%
- Complexity 3798 3799 +1
==========================================
Files 725 725
Lines 24306 24310 +4
Branches 2984 2986 +2
==========================================
+ Hits 11795 11797 +2
- Misses 11261 11262 +1
- Partials 1250 1251 +1
|
This pull request fixes 1 alert when merging cf0a421 into 2c6e647 - view on LGTM.com fixed alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
mysql通过statementProxy.getGeneratedKeys()获取自增主键失败时进入catch逻辑中使用“SELECT LAST_INSERT_ID()”继续获取。当updateCount<=1时会在final逻辑中关闭rsFirstId,由于rsFirstId和genKeys引用的是同一个对象,所以genKeys也关闭了,此时再调用genKeys.next()就会报错:java.sql.SQLException: Operation not allowed after ResultSet closed
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews