Add dameng support #2007

Merged
lunny merged 59 commits from lunny/dm into master 2021-08-24 05:46:09 +00:00
2 changed files with 10 additions and 1 deletions
Showing only changes of commit f1f1b1d92f - Show all commits

View File

@ -1145,7 +1145,13 @@ func (d *damengDriver) Scan(ctx *ScanContext, rows *core.Rows, types []*sql.Colu
if replaced {
switch t := scanResults[i].(type) {
case *dmClobScanner:
if err := convert.Assign(vv[i], t.data, ctx.DBLocation, ctx.UserLocation); err != nil {
var d interface{}
if t.valid {
d = t.data
} else {
d = nil
}
if err := convert.Assign(vv[i], d, ctx.DBLocation, ctx.UserLocation); err != nil {
return err
}
default:

View File

@ -524,6 +524,9 @@ func (session *Session) convertBeanField(col *schemas.Column, fieldValue *reflec
if !ok {
return fmt.Errorf("cannot convert %#v as bytes", scanResult)
}
if data == nil {
return nil
}
return structConvert.FromDB(data)
}
}