升级1.25.9后,还存在先求数量再更新生成的sql异常情况,案例请看问题二 https://github.com/go-gorm/playground/issues/708 最终生成的sql为 UPDATE "test" SET "a"='222' FROM "test" WHERE a ='111' ERROR: table name "test" specified more than once (SQLSTATE 42712)
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: a631807682
https://gorm.io/docs/method_chaining.html#New-Session-Methods
Comment From: Hareis
请问一下你是怎么解决的 @a631807682
Comment From: 943885179
使用 db = db.Session(&bgorm.Session{}) 在执行count()或者其他查询操作前,设置session就可以了
暧昧…无言以对 @.***
------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2024年4月10日(星期三) 中午12:45 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [go-gorm/gorm] postgres use gorm v1.25.9 生成的update语句有误 (Issue #6929)
请问一下你是怎么解决的 @a631807682
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>