fix MSSQL bug on org (#3405)

This commit is contained in:
Lunny Xiao 2018-01-27 09:20:59 -06:00 committed by Lauris BH
parent a0c397df08
commit 97fe773491
28 changed files with 1011 additions and 164 deletions

View file

@ -5,6 +5,7 @@
package xorm
import (
"database/sql"
"errors"
"reflect"
"strconv"
@ -79,6 +80,13 @@ func (session *Session) nocacheGet(beanKind reflect.Kind, table *core.Table, bea
return false, nil
}
switch bean.(type) {
case sql.NullInt64, sql.NullBool, sql.NullFloat64, sql.NullString:
return true, rows.Scan(&bean)
case *sql.NullInt64, *sql.NullBool, *sql.NullFloat64, *sql.NullString:
return true, rows.Scan(bean)
}
switch beanKind {
case reflect.Struct:
fields, err := rows.Columns()