From 0f2d186efbad052aae5ae838e5e445d1374fdd33 Mon Sep 17 00:00:00 2001 From: Neil Macneale IV Date: Mon, 12 May 2025 12:57:11 -0700 Subject: [PATCH 1/2] Ensure error checking is performed when generating statistics template --- go/libraries/doltcore/sqle/statspro/worker.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/go/libraries/doltcore/sqle/statspro/worker.go b/go/libraries/doltcore/sqle/statspro/worker.go index 2685a010edb..5220d4cd538 100644 --- a/go/libraries/doltcore/sqle/statspro/worker.go +++ b/go/libraries/doltcore/sqle/statspro/worker.go @@ -443,10 +443,9 @@ func (sc *StatsController) updateTable(ctx *sql.Context, newStats *rootStats, ta continue } var idx durable.Index - var err error var prollyMap prolly.Map var template stats.Statistic - if sc.execWithOptionalRateLimit(ctx, bypassRateLimit, func() (err error) { + if err := sc.execWithOptionalRateLimit(ctx, bypassRateLimit, func() (err error) { if strings.EqualFold(sqlIdx.ID(), "PRIMARY") { idx, err = dTab.GetRowData(ctx) } else { From d86cffbfdb6814eb5db46f3f48ab6d122fbc98ae Mon Sep 17 00:00:00 2001 From: Neil Macneale IV Date: Tue, 24 Jun 2025 11:38:33 -0700 Subject: [PATCH 2/2] Now with more error checking --- go/libraries/doltcore/sqle/statspro/worker.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/go/libraries/doltcore/sqle/statspro/worker.go b/go/libraries/doltcore/sqle/statspro/worker.go index 5220d4cd538..37d9cd1f2e2 100644 --- a/go/libraries/doltcore/sqle/statspro/worker.go +++ b/go/libraries/doltcore/sqle/statspro/worker.go @@ -451,11 +451,13 @@ func (sc *StatsController) updateTable(ctx *sql.Context, newStats *rootStats, ta } else { idx, err = dTab.GetIndexRowData(ctx, sqlIdx.ID()) } - if err == nil { - prollyMap, err = durable.ProllyMapFromIndex(idx) - if err != nil { - return err - } + if err != nil { + return err + } + + prollyMap, err = durable.ProllyMapFromIndex(idx) + if err != nil { + return err } _, template, err = sc.getTemplate(ctx, sqlTable, sqlIdx)