Skip to content
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

optimize: insert check pkvalue support. #2607

Merged
merged 13 commits into from
Jun 5, 2020
Merged

optimize: insert check pkvalue support. #2607

merged 13 commits into from
Jun 5, 2020

Conversation

jsbxyyx
Copy link
Member

@jsbxyyx jsbxyyx commented Apr 24, 2020

Ⅰ. Describe what this PR did

optimize insert executor check pkvalues.
preparedstatement mode:
support multi sequeunce, default, sql method.

Ⅱ. Does this pull request fix one issue?

fixes: #2485

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-io
Copy link

codecov-io commented Apr 24, 2020

Codecov Report

Merging #2607 into develop will increase coverage by 0.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2607      +/-   ##
=============================================
+ Coverage      50.81%   50.83%   +0.01%     
- Complexity      2813     2847      +34     
=============================================
  Files            558      558              
  Lines          17927    17952      +25     
  Branches        2124     2133       +9     
=============================================
+ Hits            9110     9126      +16     
- Misses          7952     7956       +4     
- Partials         865      870       +5     
Impacted Files Coverage Δ Complexity Δ
...va/io/seata/rm/datasource/exec/InsertExecutor.java 62.37% <66.66%> (-0.91%) 78.00 <48.00> (+33.00) ⬇️
...torage/file/store/FileTransactionStoreManager.java 57.41% <0.00%> (+0.64%) 29.00% <0.00%> (+1.00%)

@jsbxyyx
Copy link
Member Author

jsbxyyx commented Apr 24, 2020

// support
preparedStatement:
mysql:
insert into test1(id, name) values(null, ?)
insert into test1(id, name) values(null, ?), (null, ?)
insert into test1(id, name) values(10000, ?)
insert into test1(id, name) values(10000, ?), (10001, ?)
insert into test1(id, name) values(floor(now() + 1), ?)
insert into test1(id, name) values(floor(now() + 1), ?), (floor(now() + 2), ?)
oracle:
insert into test1(id, name) values(test1_seq.nextval, ?)
insert into test1(id, name) values(10000, ?)
insert into test1(id, name) values(floor(dbms_random.value(900,1000)), ?)
postgresql:
insert into test1(id, name) values(nextval('test1_seq'), ?)
insert into test1(id, name) values(nextval('test1_seq'), ?), (nextval('test1_seq'), ?)
insert into test1(id, name) values(10000, ?)
insert into test1(id, name) values(10000, ?), (10001, ?)
insert into test1(id, name) values(floor(random()*1000), ?)
insert into test1(id, name) values(floor(random()*1000), ?), (floor(random()*1000), ?)
insert into test1(id, name) values(default, ?)
insert into test1(id, name) values(default, ?), (default, ?)

statement:
mysql:
insert into test1(id, name) values(null, 'xx')
insert into test1(id, name) values(10002, 'xx')
insert into test1(id, name) values(10002, 'xx'), (10003, 'xx1')
oracle:
insert into test1(id, name) values(test1_seq.nextval, 'xx')
insert into test1(id, name) values(10002, 'xx')
postgresql:
insert into test1(id, name) values(nextval('test1_seq'), 'xx')
insert into test1(id, name) values(10002, 'xx')
insert into test1(id, name) values(10002, 'xx'), (10003, 'xx1')
insert into test1(id, name) values(default, 'xx')

// not support
statement:
mysql:
insert into test1(id, name) values(now(), 'xx')
oracle:
insert into test1(id, name) values(floor(dbms_random.value(900,1000)), 'xx')
postgresql:
insert into test1(id, name) values(floor(random()*1000), 'xx')

@jsbxyyx jsbxyyx closed this Apr 24, 2020
@jsbxyyx jsbxyyx reopened this Apr 24, 2020
@zjinlei zjinlei added this to the 1.3.0 milestone May 1, 2020
@l81893521 l81893521 added the module/rm-datasource rm-datasource module label May 20, 2020
…e_insert_pkvalue_support

# Conflicts:
#	rm-datasource/src/main/java/io/seata/rm/datasource/exec/InsertExecutor.java
#	rm-datasource/src/test/java/io/seata/rm/datasource/exec/MySQLInsertExecutorTest.java
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2020

Codecov Report

Merging #2607 into develop will increase coverage by 0.03%.
The diff coverage is 80.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2607      +/-   ##
=============================================
+ Coverage      50.47%   50.50%   +0.03%     
- Complexity      2889     2921      +32     
=============================================
  Files            572      572              
  Lines          18591    18610      +19     
  Branches        2231     2240       +9     
=============================================
+ Hits            9383     9399      +16     
  Misses          8285     8285              
- Partials         923      926       +3     
Impacted Files Coverage Δ Complexity Δ
...o/seata/rm/datasource/exec/BaseInsertExecutor.java 67.56% <80.00%> (+0.90%) 68.00 <48.00> (+33.00)
...in/java/io/seata/server/session/GlobalSession.java 84.16% <0.00%> (+0.45%) 72.00% <0.00%> (+1.00%)
...o/seata/server/coordinator/DefaultCoordinator.java 55.15% <0.00%> (+0.51%) 29.00% <0.00%> (ø%)

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@l81893521 l81893521 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@l81893521 l81893521 merged commit e13c5c9 into apache:develop Jun 5, 2020
@jsbxyyx jsbxyyx deleted the optimize_insert_pkvalue_support branch June 5, 2020 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/rm-datasource rm-datasource module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hikari数据源发生not support sql : (REPLACE(uuid(), '-', ''),?)
6 participants