subsql:=fmt.Sprintf("select last_row(ts) from %s.%s group by tbname",d.srcdbname,stbname)
subRows,err:=d.db.Query(subsql)
iferr!=nil{
checkErr(err,subsql)
}
forsubRows.Next(){
vartbnamestring
subRows.Scan(&lastTime,&tbname)
}
subRows.Close()
}
}
fori,f:=rangefields{
fori,f:=rangefields{
col:=fmt.Sprintf("%s %s %s",stbname,tbname,f)
col:=fmt.Sprintf("%s %s",tbname,f)
count:=0
{
var(
var(
tstime.Time
tstime.Time
dbnamestring
dbnamestring
...
@@ -381,7 +349,6 @@ func (d *demo) Init() {
...
@@ -381,7 +349,6 @@ func (d *demo) Init() {
checkintervalint
checkintervalint
thresholdint
thresholdint
)
)
checkSql:=fmt.Sprintf("select * from %s.%s where dbname = \"%s\" and tablename = \"%s\" and colname = \"%s\"",d.dbname,d.metaTable,d.srcdbname,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)