mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-20 11:22:31 -05:00
fix migration datetime bug
This commit is contained in:
@@ -183,23 +183,25 @@ func equalRows(old, new sql.Row, sch sql.Schema) (bool, error) {
|
||||
// special case time comparison to account
|
||||
// for precision changes between formats
|
||||
if _, ok := old[i].(time.Time); ok {
|
||||
if old[i], err = sql.Int64.Convert(old[i]); err != nil {
|
||||
var o, n interface{}
|
||||
if o, err = sql.Int64.Convert(old[i]); err != nil {
|
||||
return false, err
|
||||
}
|
||||
if new[i], err = sql.Int64.Convert(new[i]); err != nil {
|
||||
if n, err = sql.Int64.Convert(new[i]); err != nil {
|
||||
return false, err
|
||||
}
|
||||
if cmp, err = sql.Int64.Compare(o, n); err != nil {
|
||||
return false, err
|
||||
}
|
||||
cmp, err = sql.Int64.Compare(old[i], new[i])
|
||||
} else {
|
||||
cmp, err = sch[i].Type.Compare(old[i], new[i])
|
||||
if cmp, err = sch[i].Type.Compare(old[i], new[i]); err != nil {
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return false, err
|
||||
} else if cmp != 0 {
|
||||
if cmp != 0 {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user