Skip to content

test:on duplicate update#7401

Closed
zzuts wants to merge 3 commits intogo-gorm:masterfrom
zzuts:master
Closed

test:on duplicate update#7401
zzuts wants to merge 3 commits intogo-gorm:masterfrom
zzuts:master

Conversation

@zzuts
Copy link
Copy Markdown

@zzuts zzuts commented Mar 26, 2025

  • Tested

What did this pull request do?

关于on duplicate key update 后scan 的bug 测试样例

User Case Description

如果on duplicate key update 执行的是 price = price+ 0 这样无改动的语句时,后面再执行Scan。会把sql中所有记录扫出来,Debug()一下,发现执行的是SELECT * FROMproductsWHEREproducts.deleted_at IS NULL

@zzuts zzuts mentioned this pull request Mar 26, 2025
@jinzhu
Copy link
Copy Markdown
Member

jinzhu commented Aug 2, 2025

后面的 Scan 和前面的 Create 没有从属关系的,是两次 SQL 生成

@jinzhu jinzhu closed this Aug 2, 2025
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.

2 participants