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

bugfix: fix can not get update columns with database name #3402

Merged
merged 6 commits into from
Feb 6, 2021

Conversation

sustly
Copy link
Contributor

@sustly sustly commented Dec 24, 2020

Ⅰ. Describe what this PR did

buildAfterImageSQL时,如果数据库链接是全称getUpdateColumns获取不到更新字段。
如果数据库链接,如update seata.test.info,其中seata为库名字,test是表名,如果更新语句为: update seata.test set seata.test.info = "test" where seata.test.id = 1,则getUpdateColumns返回值是一个空的list.
支持了更新如果是库名+表名+字段的sql

Ⅱ. Does this pull request fix one issue?

fixes #3395

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

没有

Ⅳ. Describe how to verify it

1.4.1版本写库名,测试不通过,获取不了更新字段
image
fixes bug后,测试通过
image

Ⅴ. Special notes for reviews

没有

@codecov-io
Copy link

codecov-io commented Dec 24, 2020

Codecov Report

Merging #3402 (0dadb41) into develop (8397e90) will decrease coverage by 0.00%.
The diff coverage is 16.66%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3402      +/-   ##
=============================================
- Coverage      51.67%   51.67%   -0.01%     
+ Complexity      3357     3355       -2     
=============================================
  Files            618      618              
  Lines          20344    20350       +6     
  Branches        2543     2547       +4     
=============================================
+ Hits           10513    10516       +3     
- Misses          8781     8783       +2     
- Partials        1050     1051       +1     
Impacted Files Coverage Δ Complexity Δ
...sqlparser/druid/oracle/OracleUpdateRecognizer.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...r/druid/postgresql/PostgresqlUpdateRecognizer.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...a/sqlparser/druid/mysql/MySQLUpdateRecognizer.java 93.33% <50.00%> (+0.31%) 15.00 <0.00> (+1.00)
...o/seata/server/coordinator/DefaultCoordinator.java 54.63% <0.00%> (-0.52%) 28.00% <0.00%> (-1.00%)
...in/java/io/seata/server/session/GlobalSession.java 83.63% <0.00%> (-0.46%) 71.00% <0.00%> (-1.00%)
...n/src/main/java/io/seata/common/util/IdWorker.java 83.33% <0.00%> (+6.25%) 12.00% <0.00%> (+1.00%)

@slievrly slievrly self-requested a review December 24, 2020 04:03
@sustly
Copy link
Contributor Author

sustly commented Dec 31, 2020

Can my pull request be merged?If not, please fix this bug.

@slievrly
Copy link
Member

slievrly commented Jan 2, 2021

Can my pull request be merged?If not, please fix this bug.

did Oracle and PostgresQL do actual testing?

@sustly
Copy link
Contributor Author

sustly commented Jan 4, 2021

Can my pull request be merged?If not, please fix this bug.

did Oracle and PostgresQL do actual testing?
I do not have Oracle and PostgresQL environment.

@sustly
Copy link
Contributor Author

sustly commented Jan 5, 2021

Can my pull request be merged?If not, please fix this bug.

did Oracle and PostgresQL do actual testing?
I do not have Oracle and PostgresQL environment.
But in the test I did not find any problems

@funky-eyes funky-eyes added module/rm-datasource rm-datasource module type: bug Category issues or prs related to bug. labels Jan 6, 2021
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. Mysql And Oracle test passed, pgsql do not have this problem. You can remove the code in pgsql or not.

Copy link
Contributor

@funky-eyes funky-eyes 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 changed the title bugfix: fixes SQL with database name bugfix: fix can not get update columns with database name Feb 6, 2021
@l81893521 l81893521 merged commit 88c7dad into apache:develop Feb 6, 2021
@slievrly slievrly added this to the 1.5.0 milestone Feb 21, 2021
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 type: bug Category issues or prs related to bug.
Projects
None yet
5 participants