go-gorm / playground

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

Test regression in db.Not with v1.25.5 #695

Open tsuba3 opened 6 months ago

tsuba3 commented 6 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.