forked from mirror/gorm
Add error if exists after parse raw query results, fix #1398
This commit is contained in:
parent
5730b92954
commit
66d5b42ee9
|
@ -310,6 +310,10 @@ func (scope *Scope) handleManyToManyPreload(field *Field, conditions []interface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := rows.Err(); err != nil {
|
||||||
|
scope.Err(err)
|
||||||
|
}
|
||||||
|
|
||||||
// assign find results
|
// assign find results
|
||||||
var (
|
var (
|
||||||
indirectScopeValue = scope.IndirectValue()
|
indirectScopeValue = scope.IndirectValue()
|
||||||
|
|
4
scope.go
4
scope.go
|
@ -930,6 +930,10 @@ func (scope *Scope) pluck(column string, value interface{}) *Scope {
|
||||||
scope.Err(rows.Scan(elem))
|
scope.Err(rows.Scan(elem))
|
||||||
dest.Set(reflect.Append(dest, reflect.ValueOf(elem).Elem()))
|
dest.Set(reflect.Append(dest, reflect.ValueOf(elem).Elem()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := rows.Err(); err != nil {
|
||||||
|
scope.Err(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return scope
|
return scope
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue