(fix) fix convert `null` value

This commit is contained in:
datbeohbbh 2023-09-24 08:56:15 +07:00
parent 95083deaa6
commit d8fdeb1483
2 changed files with 0 additions and 5 deletions

View File

@ -237,9 +237,6 @@ func (statement *Statement) Value2Interface(col *schemas.Column, fieldValue refl
return val, nil return val, nil
} }
default: default:
if fieldValue.Interface() == nil && statement.dialect.URI().DBType == schemas.YDB {
return (*string)(nil), nil
}
return fieldValue.Interface(), nil return fieldValue.Interface(), nil
} }
} }

View File

@ -18,7 +18,6 @@ type NullStruct struct {
Age sql.NullInt64 Age sql.NullInt64
Height sql.NullFloat64 Height sql.NullFloat64
IsMan sql.NullBool `xorm:"null"` IsMan sql.NullBool `xorm:"null"`
Nil driver.Valuer
CustomStruct CustomStruct `xorm:"VARCHAR null"` CustomStruct CustomStruct `xorm:"VARCHAR null"`
} }
@ -90,7 +89,6 @@ func TestNullStructInsert(t *testing.T) {
Height: sql.NullFloat64{Float64: 1.5 + 1.1*float64(i), Valid: true}, Height: sql.NullFloat64{Float64: 1.5 + 1.1*float64(i), Valid: true},
IsMan: sql.NullBool{Bool: true, Valid: true}, IsMan: sql.NullBool{Bool: true, Valid: true},
CustomStruct: CustomStruct{int64(i), int64(i + 1), int64(i + 2)}, CustomStruct: CustomStruct{int64(i), int64(i + 1), int64(i + 2)},
Nil: nil,
} }
items = append(items, item) items = append(items, item)
} }