diff --git a/internal/statements/values.go b/internal/statements/values.go index fb69f16e..f5c33dd0 100644 --- a/internal/statements/values.go +++ b/internal/statements/values.go @@ -237,9 +237,6 @@ func (statement *Statement) Value2Interface(col *schemas.Column, fieldValue refl return val, nil } default: - if fieldValue.Interface() == nil && statement.dialect.URI().DBType == schemas.YDB { - return (*string)(nil), nil - } return fieldValue.Interface(), nil } } diff --git a/tests/ydbtest/types_null_test.go b/tests/ydbtest/types_null_test.go index 9560899b..1b296ebc 100644 --- a/tests/ydbtest/types_null_test.go +++ b/tests/ydbtest/types_null_test.go @@ -18,7 +18,6 @@ type NullStruct struct { Age sql.NullInt64 Height sql.NullFloat64 IsMan sql.NullBool `xorm:"null"` - Nil driver.Valuer 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}, IsMan: sql.NullBool{Bool: true, Valid: true}, CustomStruct: CustomStruct{int64(i), int64(i + 1), int64(i + 2)}, - Nil: nil, } items = append(items, item) }