go-gorm / playground

GORM Playground (Please Create PR for this project to report issues)
MIT License
91 stars 698 forks source link

Test regression in db.Not with latest gorm #696

Open tsuba3 opened 9 months ago

tsuba3 commented 9 months ago

Explain your user case and expected results

The behavior of the db.Not method when used with multiple Where conditions has changed unexpectedly. Prior to v1.25.6, the query db.Not(db.Where("a=1").Where("b=1")) would correctly translate to SQL as NOT (a=1 AND b=1). However, after the specified commit, the same query started translating to (NOT a=1 AND NOT b=1), which is a significant alteration in the logic.