cloudcommon: db: more readable log on sql error

This commit is contained in:
Yousong Zhou
2018-09-18 03:53:22 +00:00
parent 0620ebe7a4
commit 284ebcfaab
+1 -2
View File
@@ -25,7 +25,6 @@ func CheckSync(autoSync bool) bool {
tableSpec := modelMan.TableSpec()
sqls := tableSpec.SyncSQL()
for _, sql := range sqls {
// fmt.Printf("%s\n", sql)
allSqls = append(allSqls, sql)
}
}
@@ -63,7 +62,7 @@ func commitSqlDIffs(sqls []string) error {
log.Infof("Exec %s", sql)
_, err := db.Exec(sql)
if err != nil {
log.Errorf("Exec sql %s failed %s", sql, err)
log.Errorf("Exec sql failed %s\n%s", sql, err)
return err
}
}