compatible with TDSQL-C Mysql

This commit is contained in:
ning 2023-04-27 10:45:41 +08:00
parent 199a23e385
commit bca9331182
2 changed files with 2 additions and 14 deletions

View File

@ -425,18 +425,6 @@ func AlertNumbers(ctx *ctx.Context, bgids []int64) (map[int64]int64, error) {
return ret, nil
}
func AlertCurEventGetAll(ctx *ctx.Context, cluster string) ([]*AlertCurEvent, error) {
session := DB(ctx).Model(&AlertCurEvent{})
if cluster != "" {
session = session.Where("cluster = ?", cluster)
}
var lst []*AlertCurEvent
err := session.Find(&lst).Error
return lst, err
}
func AlertCurEventGetByIds(ctx *ctx.Context, ids []int64) ([]*AlertCurEvent, error) {
var lst []*AlertCurEvent

View File

@ -130,7 +130,7 @@ func AlertingEngineGetsInstances(ctx *ctx.Context, where string, args ...interfa
func AlertingEngineHeartbeatWithCluster(ctx *ctx.Context, instance, cluster string, datasourceId int64) error {
var total int64
err := DB(ctx).Model(new(AlertingEngines)).Where("instance=? and cluster = ? and datasource_id=?", instance, cluster, datasourceId).Count(&total).Error
err := DB(ctx).Model(new(AlertingEngines)).Where("instance=? and `cluster` = ? and datasource_id=?", instance, cluster, datasourceId).Count(&total).Error
if err != nil {
return err
}
@ -146,7 +146,7 @@ func AlertingEngineHeartbeatWithCluster(ctx *ctx.Context, instance, cluster stri
} else {
// updates
fields := map[string]interface{}{"clock": time.Now().Unix()}
err = DB(ctx).Model(new(AlertingEngines)).Where("instance=? and cluster = ? and datasource_id=?", instance, cluster, datasourceId).Updates(fields).Error
err = DB(ctx).Model(new(AlertingEngines)).Where("instance=? and `cluster` = ? and datasource_id=?", instance, cluster, datasourceId).Updates(fields).Error
}
return err