Merge branch 'master' into master

This commit is contained in:
Lunny Xiao 2017-01-20 19:28:01 +08:00 committed by GitHub
commit 94ab92bd80
1 changed files with 12 additions and 0 deletions

View File

@ -488,6 +488,18 @@ func (engine *Engine) dumpTables(tables []*core.Table, w io.Writer, tp ...core.D
switch reflect.TypeOf(d).Kind() { switch reflect.TypeOf(d).Kind() {
case reflect.Slice: case reflect.Slice:
temp += fmt.Sprintf(", %s", string(d.([]byte))) temp += fmt.Sprintf(", %s", string(d.([]byte)))
case reflect.Int16, reflect.Int8, reflect.Int32, reflect.Int64, reflect.Int:
if col.SQLType.Name == core.Bool {
temp += fmt.Sprintf(", %v", strconv.FormatBool(reflect.ValueOf(d).Int() > 0))
} else {
temp += fmt.Sprintf(", %v", d)
}
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
if col.SQLType.Name == core.Bool {
temp += fmt.Sprintf(", %v", strconv.FormatBool(reflect.ValueOf(d).Uint() > 0))
} else {
temp += fmt.Sprintf(", %v", d)
}
default: default:
temp += fmt.Sprintf(", %v", d) temp += fmt.Sprintf(", %v", d)
} }