Fix randomize for mysql nil bytes
This commit is contained in:
parent
9102327b1c
commit
5ab8c628ed
1 changed files with 3 additions and 1 deletions
|
@ -338,7 +338,9 @@ func randomizeField(s *Seed, field reflect.Value, fieldType string, canBeNull bo
|
|||
value = getStructRandValue(s, typ)
|
||||
}
|
||||
} else {
|
||||
if isNull {
|
||||
// only get zero values for non byte slices
|
||||
// to stop mysql from being a jerk
|
||||
if isNull && kind != reflect.Slice {
|
||||
value = getVariableZeroValue(s, kind)
|
||||
} else {
|
||||
value = getVariableRandValue(s, kind, typ)
|
||||
|
|
Loading…
Add table
Reference in a new issue