bug fixed

This commit is contained in:
Lunny Xiao 2014-09-05 11:13:23 +08:00
parent 061a9f8b2e
commit c350aa3288
1 changed files with 6 additions and 1 deletions

View File

@ -412,7 +412,12 @@ func (engine *Engine) DumpAll(w io.Writer) error {
temp += fmt.Sprintf(", '%s'", d.(string)) temp += fmt.Sprintf(", '%s'", d.(string))
} }
} else if col.SQLType.IsNumeric() { } else if col.SQLType.IsNumeric() {
temp += fmt.Sprintf(", %s", string(d.([]byte))) switch reflect.TypeOf(d).Kind() {
case reflect.Slice:
temp += fmt.Sprintf(", %s", string(d.([]byte)))
default:
temp += fmt.Sprintf(", %v", d)
}
} else { } else {
s := fmt.Sprintf("%v", d) s := fmt.Sprintf("%v", d)
if strings.Contains(s, ":") || strings.Contains(s, "-") { if strings.Contains(s, ":") || strings.Contains(s, "-") {