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()
lastTime,ok:=lastRowDict[tbname]
if!ok{
lastTime=time.Now()
}
fori,f:=rangefields{
col:=fmt.Sprintf("%s %s %s",stbname,tbname,f)
count:=0
{
col:=fmt.Sprintf("%s %s",tbname,f)
var(
tstime.Time
dbnamestring
...
...
@@ -381,7 +349,6 @@ func (d *demo) Init() {
checkintervalint
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)