Skip to content

Commit 257e684

Browse files
authored
Valuer objects are evaluated before In expansion
Value() method of Valuer objects may change slices into non-slice objects or vice-versa. Therefore we must do the evaluation before the expansion.
1 parent d9bd385 commit 257e684

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bind.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ func In(query string, args ...interface{}) (string, []interface{}, error) {
110110
meta := make([]argMeta, len(args))
111111

112112
for i, arg := range args {
113+
if a, ok := arg.(driver.Valuer); ok {
114+
arg, _ = a.Value()
115+
}
113116
v := reflect.ValueOf(arg)
114117
t := reflectx.Deref(v.Type())
115118

0 commit comments

Comments
 (0)