问一下作者,是出于什么考虑,查询时,当数值型为空的时候,用他的默认值0 #2451

Open
opened 2024-04-25 05:19:09 +00:00 by 4color · 2 comments
Contributor

convert/interface.go

而不是返回null

` case *sql.NullInt32:
return vv.Int32, nil
case *sql.NullInt64:
return vv.Int64, nil
case *sql.NullFloat64:
return vv.Float64, nil

`

convert/interface.go 而不是返回null ` case *sql.NullInt32: return vv.Int32, nil case *sql.NullInt64: return vv.Int64, nil case *sql.NullFloat64: return vv.Float64, nil `
Owner

What's the problem?

What's the problem?
Author
Contributor

我的意思是,我想要的是真实的值。
原来字段是null的,就返回null,而不是默认给个0

我的意思是,我想要的是真实的值。 原来字段是null的,就返回null,而不是默认给个0
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#2451
No description provided.