Skip to content

Commit fa98d68

Browse files
committed
dv.InterfaceData已过时,修改为dv.IsNil()
1 parent c9f2845 commit fa98d68

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v1.7.7
2+
- dv.InterfaceData已过时,修改为dv.IsNil()
3+
- 完善文档,注释
4+
15
v1.7.6
26
- 感谢 @lerity[issue](https://gitee.com/chunanyong/zorm/issues/I9HPXQ),处理sql中from格式化换行的正则Bug
37
- 完善文档,注释

structFieldInfo.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,8 @@ func sqlRowsValues(ctx context.Context, config *DataSourceConfig, valueOf *refle
528528
}
529529
}
530530
dv := driverValue.Index(i)
531-
if dv.IsValid() && dv.InterfaceData()[0] == 0 { // 该字段的数据库值是null,取默认值
531+
// if dv.IsValid() && dv.InterfaceData()[0] == 0 {
532+
if dv.IsValid() && dv.IsNil() { // 该字段的数据库值是null,取默认值
532533
values[i] = new(interface{})
533534
continue
534535
} else if converOK { // 如果是需要转换的字段

0 commit comments

Comments
 (0)