提交 60865397 编写于 作者: dengyihao's avatar dengyihao

fix demo.go

上级 4d619b3b
...@@ -241,7 +241,7 @@ func taskInit(db *sql.DB, dbname string, srcdbname string, metatable string, exp ...@@ -241,7 +241,7 @@ func taskInit(db *sql.DB, dbname string, srcdbname string, metatable string, exp
for _, f := range fields { for _, f := range fields {
count := 0 count := 0
{ {
checkSql := fmt.Sprintf("select * from %s.%s where dbname = \"%s\" and tablename = \"%s\" and colname = \"%s\"", dbname, metatable, dbname, tbname, f) checkSql := fmt.Sprintf("select * from %s.%s where dbname = \"%s\" and tablename = \"%s\" and colname = \"%s\"", dbname, metatable, srcdbname, tbname, f)
checkRow, err := db.Query(checkSql) checkRow, err := db.Query(checkSql)
if err != nil { if err != nil {
checkErr(err, checkSql) checkErr(err, checkSql)
...@@ -382,7 +382,7 @@ func (d *demo) Init() { ...@@ -382,7 +382,7 @@ func (d *demo) Init() {
threshold int threshold int
) )
checkSql := fmt.Sprintf("select * from %s.%s where dbname = \"%s\" and tablename = \"%s\" and colname = \"%s\"", d.dbname, d.metaTable, d.dbname, tbname, f) checkSql := fmt.Sprintf("select * from %s.%s where dbname = \"%s\" and tablename = \"%s\" and colname = \"%s\"", d.dbname, d.metaTable, d.srcdbname, tbname, f)
checkRow, err := d.db.Query(checkSql) checkRow, err := d.db.Query(checkSql)
if err != nil { if err != nil {
checkErr(err, checkSql) checkErr(err, checkSql)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册