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

feature : support batch update and delete with multiple sql #2112

Merged
merged 67 commits into from
Apr 14, 2020

Conversation

wangwei-ying
Copy link
Contributor

@wangwei-ying wangwei-ying commented Dec 30, 2019

Ⅰ. Describe what this PR did

support batch update and delete with multiple sql , not support insert multiple sql

update account_tbl set money = money - ? where user_id = ?;;update account_tbl set money = money - ? where user_id = ?

Ⅱ. Does this pull request fix one issue?

#1784

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

had add some simple test cases;

Ⅳ. Describe how to verify it

use seata-simples verify it

Ⅴ. Special notes for reviews

in MulitExecutor , it handler UpdateExecutor and DeleteExecutor images build,
and merge them.

@codecov-io
Copy link

codecov-io commented Dec 30, 2019

Codecov Report

Merging #2112 into develop will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #2112   +/-   ##
==========================================
  Coverage      51.48%   51.48%           
  Complexity      2803     2803           
==========================================
  Files            553      553           
  Lines          17685    17685           
  Branches        2088     2088           
==========================================
  Hits            9105     9105           
  Misses          7727     7727           
  Partials         853      853           

@zjinlei zjinlei added this to the 1.1.0 milestone Jan 3, 2020
@wangwei-ying
Copy link
Contributor Author

@zjinlei done

@zjinlei
Copy link
Contributor

zjinlei commented Jan 10, 2020

please resolve conflict
and add your git association information on the next commit

yingww added 3 commits January 10, 2020 15:19
…mulit-sql

# Conflicts:
#	rm-datasource/src/main/java/io/seata/rm/datasource/exec/ExecuteTemplate.java
#	rm-datasource/src/main/java/io/seata/rm/datasource/sql/SQLVisitorFactory.java
#	rm-datasource/src/test/java/io/seata/rm/datasource/sql/SQLVisitorFactoryTest.java
Copy link
Contributor

@zjinlei zjinlei left a comment

Choose a reason for hiding this comment

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

LGTM
预期只支持单更新多语句或者单删除多语句,pr超出了预期,不过也增加了代码复杂度,后期维护成本增加。

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. Test passed.

update seata.`account_tbl` set money = money - ? where user_id = ?;update seata.`account_tbl` set money = money - ? where user_id = ?;

@l81893521 l81893521 self-requested a review April 7, 2020 14:04
@jsbxyyx
Copy link
Member

jsbxyyx commented Apr 10, 2020

update test1 set id = ? where id = ?; update test1 set id = ? where id = ?;
?, ? = 1, 1
?, ? = 2, 2

Exception: Parameter index out of range (1 > number of parameters, which is 0)

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
Member

@jsbxyyx jsbxyyx left a comment

Choose a reason for hiding this comment

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

LGTM

@jsbxyyx jsbxyyx merged commit 86b03bd into apache:develop Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants