Fix test
This commit is contained in:
parent
ff568c74f2
commit
701f5e6f68
|
@ -474,7 +474,8 @@ func (db *mssql) GetColumns(queryer core.Queryer, ctx context.Context, tableName
|
||||||
cols := make(map[string]*schemas.Column)
|
cols := make(map[string]*schemas.Column)
|
||||||
colSeq := make([]string, 0)
|
colSeq := make([]string, 0)
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
var name, ctype, vdefault, collation string
|
var name, ctype, vdefault string
|
||||||
|
var collation *string
|
||||||
var maxLen, precision, scale int64
|
var maxLen, precision, scale int64
|
||||||
var nullable, isPK, defaultIsNull, isIncrement bool
|
var nullable, isPK, defaultIsNull, isIncrement bool
|
||||||
err = rows.Scan(&name, &ctype, &maxLen, &precision, &scale, &nullable, &defaultIsNull, &vdefault, &isPK, &isIncrement, &collation)
|
err = rows.Scan(&name, &ctype, &maxLen, &precision, &scale, &nullable, &defaultIsNull, &vdefault, &isPK, &isIncrement, &collation)
|
||||||
|
@ -499,7 +500,9 @@ func (db *mssql) GetColumns(queryer core.Queryer, ctx context.Context, tableName
|
||||||
} else {
|
} else {
|
||||||
col.Length = maxLen
|
col.Length = maxLen
|
||||||
}
|
}
|
||||||
col.Collation = collation
|
if collation != nil {
|
||||||
|
col.Collation = *collation
|
||||||
|
}
|
||||||
switch ct {
|
switch ct {
|
||||||
case "DATETIMEOFFSET":
|
case "DATETIMEOFFSET":
|
||||||
col.SQLType = schemas.SQLType{Name: schemas.TimeStampz, DefaultLength: 0, DefaultLength2: 0}
|
col.SQLType = schemas.SQLType{Name: schemas.TimeStampz, DefaultLength: 0, DefaultLength2: 0}
|
||||||
|
|
|
@ -426,9 +426,9 @@ func (db *mysql) GetColumns(queryer core.Queryer, ctx context.Context, tableName
|
||||||
col := new(schemas.Column)
|
col := new(schemas.Column)
|
||||||
col.Indexes = make(map[string]int)
|
col.Indexes = make(map[string]int)
|
||||||
|
|
||||||
var columnName, nullableStr, colType, colKey, extra, comment, collation string
|
var columnName, nullableStr, colType, colKey, extra, comment string
|
||||||
var alreadyQuoted, isUnsigned bool
|
var alreadyQuoted, isUnsigned bool
|
||||||
var colDefault, maxLength *string
|
var colDefault, maxLength, collation *string
|
||||||
err = rows.Scan(&columnName, &nullableStr, &colDefault, &colType, &colKey, &extra, &comment, &maxLength, &alreadyQuoted, &collation)
|
err = rows.Scan(&columnName, &nullableStr, &colDefault, &colType, &colKey, &extra, &comment, &maxLength, &alreadyQuoted, &collation)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
|
@ -445,7 +445,9 @@ func (db *mysql) GetColumns(queryer core.Queryer, ctx context.Context, tableName
|
||||||
} else {
|
} else {
|
||||||
col.DefaultIsEmpty = true
|
col.DefaultIsEmpty = true
|
||||||
}
|
}
|
||||||
col.Collation = collation
|
if collation != nil {
|
||||||
|
col.Collation = *collation
|
||||||
|
}
|
||||||
|
|
||||||
fields := strings.Fields(colType)
|
fields := strings.Fields(colType)
|
||||||
if len(fields) == 2 && fields[1] == "unsigned" {
|
if len(fields) == 2 && fields[1] == "unsigned" {
|
||||||
|
|
Loading…
Reference in New Issue