fix: dm Database Clob field conversion error (#2405)

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2405
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zzdboy <28206697@qq.com>
Co-committed-by: zzdboy <28206697@qq.com>
This commit is contained in:
zzdboy 2024-02-04 09:06:47 +00:00 committed by Lunny Xiao
parent e884f059a4
commit 5301cc0ae9
1 changed files with 7 additions and 0 deletions

View File

@ -831,6 +831,13 @@ func (d *dmClobScanner) Scan(data interface{}) error {
d.data = string(t) d.data = string(t)
d.valid = true d.valid = true
return nil return nil
case string:
if len(t) <= 0 {
return nil
}
d.data = string(t)
d.valid = true
return nil
default: default:
return fmt.Errorf("cannot convert %T as dmClobScanner", data) return fmt.Errorf("cannot convert %T as dmClobScanner", data)
} }