forked from mirror/gorm
nil point transfer '<nil>' not transfer NULL #3604
This commit is contained in:
parent
08ecef8e0b
commit
d825554307
|
@ -48,8 +48,6 @@ func ExplainSQL(sql string, numericPlaceholder *regexp.Regexp, escaper string, a
|
||||||
} else {
|
} else {
|
||||||
vars[idx] = "NULL"
|
vars[idx] = "NULL"
|
||||||
}
|
}
|
||||||
case fmt.Stringer:
|
|
||||||
vars[idx] = escaper + strings.Replace(fmt.Sprintf("%v", v), escaper, "\\"+escaper, -1) + escaper
|
|
||||||
case driver.Valuer:
|
case driver.Valuer:
|
||||||
reflectValue := reflect.ValueOf(v)
|
reflectValue := reflect.ValueOf(v)
|
||||||
if v != nil && reflectValue.IsValid() && ((reflectValue.Kind() == reflect.Ptr && !reflectValue.IsNil()) || reflectValue.Kind() != reflect.Ptr) {
|
if v != nil && reflectValue.IsValid() && ((reflectValue.Kind() == reflect.Ptr && !reflectValue.IsNil()) || reflectValue.Kind() != reflect.Ptr) {
|
||||||
|
|
Loading…
Reference in New Issue