From 37c7354ee1f25dedb875b7b57a17b3f7b5497409 Mon Sep 17 00:00:00 2001 From: Jackson Date: Thu, 7 Nov 2024 10:16:53 +0800 Subject: [PATCH] fix: fetch result from correct resultset (#19810) fetch the target column from corrent resultset Approved by: @aptend --- pkg/util/metric/mometric/cron_task.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/util/metric/mometric/cron_task.go b/pkg/util/metric/mometric/cron_task.go index 1714c337c292..d863412c9458 100644 --- a/pkg/util/metric/mometric/cron_task.go +++ b/pkg/util/metric/mometric/cron_task.go @@ -413,12 +413,12 @@ func checkNewAccountSize(ctx context.Context, logger *log.MOLogger, sqlExecutor continue } - if result.RowCount() == 0 { + if showRet.RowCount() == 0 { logger.Warn("failed to fetch new account size, not exist.") continue } - sizeMB, err = result.GetFloat64(ctx, 0, sizeIdx) + sizeMB, err = showRet.GetFloat64(ctx, 0, sizeIdx) if err != nil { logger.Error("failed to fetch new account size", zap.Error(err), zap.String("account", account)) continue @@ -427,7 +427,7 @@ func checkNewAccountSize(ctx context.Context, logger *log.MOLogger, sqlExecutor if snapshotSizeIdx == math.MaxUint64 { snapshotSizeMB = 0.0 } else { - snapshotSizeMB, err = result.GetFloat64(ctx, 0, snapshotSizeIdx) + snapshotSizeMB, err = showRet.GetFloat64(ctx, 0, snapshotSizeIdx) if err != nil { logger.Error("failed to fetch new account size", zap.Error(err), zap.String("account", account)) continue