fix batch insert []interface{*struct, ...} be panic

This commit is contained in:
joelBai 2020-01-06 02:44:41 +00:00
parent 4eab4b6751
commit d96dfed30e
1 changed files with 7 additions and 1 deletions

View File

@ -126,7 +126,13 @@ func (session *Session) innerInsertMulti(rowsSlicePtr interface{}) (int64, error
for i := 0; i < size; i++ {
v := sliceValue.Index(i)
vv := reflect.Indirect(v)
var vv reflect.Value
switch v.Kind() {
case reflect.Interface:
vv = reflect.Indirect(v.Elem())
default:
vv = reflect.Indirect(v)
}
elemValue := v.Interface()
var colPlaces []string