Skip to content

Commit

Permalink
fix: fetch result from correct resultset (#19810)
Browse files Browse the repository at this point in the history
fetch the target column from corrent resultset

Approved by: @aptend
  • Loading branch information
xzxiong authored Nov 7, 2024
1 parent 0ec2b30 commit 37c7354
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/util/metric/mometric/cron_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 37c7354

Please sign in to comment.