In(..) clause with empty collection has no affect #516
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#516
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If I do something like
engine.In("my_column", []int64{}).Find(&results)
, every row of the corresponding table will be returned (just likeengine.Find(&results)
). I would instead expect no rows to be returned, since a SQL query with an emptyIN
clause, such asSELECT * FROM foo WHERE col in (SELECT 0 WHERE 0=1)
returns no rows.If this is a bug, I would be happy to fix it.
Yes, I know this. Keep it no condition or a false condition for empty
In
which one is better?I personally prefer false condition; I think that is the behavior that most users would expect.
agree with @ethantkoenig , false condition make sense.
the 2nd parameter of
In
(the array) may be generated by program code, in this case, if keep current behavior, I have to write code like below:but if make it false condition, client side code could be simplified to exclude
if
&else
.