You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
developer-r2tech
changed the title
orm: issue The SQL is wrong when using "WhereNotIn", if an empty parameter is passed
gdb: issue The SQL is wrong when using "WhereNotIn", if an empty parameter is passed
May 30, 2024
@developer-r2tech It is designed as this, if condition parameters are empty for Where* function, ORM will use 0=1 condition to warn you the given condition is empty. It does not filter the empty condition automatically as it might lead unexpected business issue. More refer to https://goframe.org/pages/viewpage.action?pageId=7301832
Go version
go version go1.21.9 linux/amd64
GoFrame version
2.7.1
Can this bug be reproduced with the latest release?
Option Yes
What did you do?
var ids []int
dao.User.Ctx(ctx).WhereNotIn("id", ids).Count()
What did you see happen?
SELECT COUNT(1) FROM
user
WHERE 0=1What did you expect to see?
SELECT COUNT(1) FROM
user
WHERE 1=1The text was updated successfully, but these errors were encountered: