This commit is contained in:
Lunny Xiao 2021-07-28 20:53:23 +08:00
parent 4d98d00146
commit 6f1318a388
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 0 additions and 33 deletions

View File

@ -14,7 +14,6 @@ import (
"strings" "strings"
"xorm.io/xorm/core" "xorm.io/xorm/core"
"xorm.io/xorm/internal/convert"
"xorm.io/xorm/schemas" "xorm.io/xorm/schemas"
) )
@ -713,35 +712,3 @@ func (p *odbcDriver) GenScanResult(colType string) (interface{}, error) {
return &r, nil return &r, nil
} }
} }
func (b *odbcDriver) Scan(ctx *ScanContext, rows *core.Rows, types []*sql.ColumnType, vv ...interface{}) error {
var scanResults = make([]interface{}, 0, len(types))
var replaces = make([]bool, 0, len(types))
var err error
for i, v := range vv {
var replaced bool
var scanResult interface{}
if types[i].DatabaseTypeName() == "NVARCHAR" {
scanResult = &sql.RawBytes{}
replaced = true
} else {
scanResult = v
}
scanResults = append(scanResults, scanResult)
replaces = append(replaces, replaced)
}
if err = rows.Scan(scanResults...); err != nil {
return err
}
for i, replaced := range replaces {
if replaced {
if err = convert.Assign(vv[i], scanResults[i], ctx.DBLocation, ctx.UserLocation); err != nil {
return err
}
}
}
return nil
}