From 0f675167d04a6241480493955d963a153948ec7c Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Thu, 5 Jan 2017 21:10:42 -0500 Subject: [PATCH] False condition on empty IN --- statement.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/statement.go b/statement.go index 2989114f..58b556dc 100644 --- a/statement.go +++ b/statement.go @@ -196,7 +196,9 @@ func (statement *Statement) Or(query interface{}, args ...interface{}) *Statemen // In generate "Where column IN (?) " statment func (statement *Statement) In(column string, args ...interface{}) *Statement { if len(args) == 0 { - return statement + // use a false condition, since there isn't an easy way to have + // an empty list in SQL + return statement.And("0=1") } in := builder.In(column, args...)