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: duplicate image row for update join #5004

Conversation

renliangyu857
Copy link
Contributor

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

Ⅱ. 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

@renliangyu857
Copy link
Contributor Author

lQLPJxbKJB2JZavNAZ_NAiqwwdAd88mKW6UDTEEVyEBAAA_554_415
这个pr是解决update join的bug,如上图前镜像是根据条件查的,后镜像是根据主键查的,查inner join是笛卡尔积就出现主键一样的数据了。现在是要求前后镜像的行数一样,阻止更新主键,会报前后镜像行数不匹配的错误。
解决方案:通过group by pkNameList区分

@funky-eyes funky-eyes added this to the 1.6.0 milestone Oct 19, 2022
@funky-eyes funky-eyes added module/rm-datasource rm-datasource module type: bug Category issues or prs related to bug. labels Oct 19, 2022
@funky-eyes funky-eyes changed the title Bugfix:duplicate image row for update join bugfix:duplicate image row for update join Oct 19, 2022
@funky-eyes funky-eyes changed the title bugfix:duplicate image row for update join bugfix: duplicate image row for update join Oct 19, 2022
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

@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2022

Codecov Report

Merging #5004 (6662dd8) into develop (f56b02c) will increase coverage by 0.01%.
The diff coverage is 81.81%.

❗ Current head 6662dd8 differs from pull request most recent head 3828078. Consider uploading reports for the commit 3828078 to get more accurate results

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #5004      +/-   ##
=============================================
+ Coverage      48.81%   48.82%   +0.01%     
  Complexity      4079     4079              
=============================================
  Files            733      733              
  Lines          25951    25962      +11     
  Branches        3199     3201       +2     
=============================================
+ Hits           12669    12677       +8     
- Misses         11933    11936       +3     
  Partials        1349     1349              
Impacted Files Coverage Δ
...ta/rm/datasource/exec/AbstractDMLBaseExecutor.java 57.14% <ø> (ø)
...datasource/exec/mysql/MySQLUpdateJoinExecutor.java 86.08% <81.81%> (-0.46%) ⬇️
...erver/storage/file/session/FileSessionManager.java 47.77% <0.00%> (-0.64%) ⬇️
...er/src/main/java/io/seata/server/ServerRunner.java 50.00% <0.00%> (ø)

@funky-eyes
Copy link
Contributor

funky-eyes commented Oct 20, 2022

按照 http://dev.cs.ovgu.de/db/sybase9/help/dbugen9/00000284.htm 规范来说,groupby pk是不符合规范的,但是groupby所有查询列的做法可能在前镜像查询的时候造成负担(前镜像的where条件不一定命中索引)
月会将进行如下讨论,抉择一个方案落实
优先1,如果能查到mode是什么,1,2都做,mode作为选择开关
1.保持当前pr group by pk做法
2.groupby 查询列
3.代码层面去重 不推荐,可以做到list的去重

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

@funky-eyes funky-eyes merged commit 9e6a3b5 into apache:develop Oct 25, 2022
@luky116
Copy link

luky116 commented Nov 23, 2024

seata-go: apache/incubator-seata-go#703

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 multilingual type: bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants