-
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: InsertExecutor afterImage #1512
Conversation
rm-datasource/src/test/java/io/seata/rm/datasource/exec/BatchInsertExecutorTest.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/exec/InsertExecutor.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/exec/InsertExecutor.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/exec/InsertExecutor.java
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/exec/InsertExecutor.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/exec/InsertExecutor.java
Outdated
Show resolved
Hide resolved
test/src/test/java/io/seata/core/rpc/netty/v1/ProtocolV1CodecTest.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## develop #1512 +/- ##
=============================================
+ Coverage 46.28% 46.44% +0.16%
- Complexity 1696 1713 +17
=============================================
Files 348 350 +2
Lines 12697 12829 +132
Branches 1551 1616 +65
=============================================
+ Hits 5877 5959 +82
- Misses 6170 6224 +54
+ Partials 650 646 -4
Continue to review full report at Codecov.
|
rm-datasource/src/main/java/io/seata/rm/datasource/exec/InsertExecutor.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/exec/InsertExecutor.java
Outdated
Show resolved
Hide resolved
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
// pk auto generated while column exists and value is null | ||
if (pkValues.size() > 0 && pkValues.get(0) instanceof Null) { | ||
else if (pkValues.size() > 0 && pkValues.get(0) instanceof Null) { |
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.
pkValues.size() > 0 && pkValues.stream().allMatch(pkValue -> pkValue instanceof Null)
easy to understand
rm-datasource/src/main/java/io/seata/rm/datasource/exec/InsertExecutor.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/exec/InsertExecutor.java
Outdated
Show resolved
Hide resolved
|
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.
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.
check all case's result OK
Ⅰ. Describe what this PR did
fix InsertExecutor afterImage
Ⅱ. Does this pull request fix one issue?
fixes #1500 #1430 #1516 #1470
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
mysql
create table test(
id int primary key auto_increment,
name varchar(45),
name2 varchar(45)
)
insert into test(id, name, name2) values (?, ?, ?)
insert into test(id, name, name2) values(null, ?, ?)
insert into test(id, name, name2) values(null, '11', '111')
insert into test(id, name, name2) values(null, ?, ?), (?, ?, ?)
parameters: ['11', '111', null, '22', '222']
insert into test values(null, ?, ?)
insert into test values(?, ?, ?)
insert into test(name, name2) values(?, ?)
insert into test(name, name3) values('11', '111')
mysql not support
excludes specify Statement.RETURN_GENERATED_KEYS case
oracle
create table test(
id int primary key,
name varchar(45),
name2 varchar(45)
)
create sequence test_seq;
insert into test(id, name, name2) values(test_seq.nextval, ?, ?)
insert into test values(test_seq.nextval, ?, ?)
oracle not support
Ⅴ. Special notes for reviews