Skip to content

Ensure error checking is performed #9207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions go/libraries/doltcore/sqle/statspro/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,25 +437,26 @@ func (sc *StatsController) updateTable(ctx *sql.Context, newStats *rootStats, ta
var err error
var prollyMap prolly.Map
var template stats.Statistic
if sc.sq.DoSync(ctx, func() (err error) {
err = sc.sq.DoSync(ctx, func() (e error) {
if strings.EqualFold(sqlIdx.ID(), "PRIMARY") {
idx, err = dTab.GetRowData(ctx)
idx, e = dTab.GetRowData(ctx)
} else {
idx, err = dTab.GetIndexRowData(ctx, sqlIdx.ID())
idx, e = dTab.GetIndexRowData(ctx, sqlIdx.ID())
}
if err == nil {
prollyMap, err = durable.ProllyMapFromIndex(idx)
if err != nil {
return err
if e == nil {
prollyMap, e = durable.ProllyMapFromIndex(idx)
if e != nil {
return e
}
}

_, template, err = sc.getTemplate(ctx, sqlTable, sqlIdx)
if err != nil {
return errors.Join(err, fmt.Errorf("stats collection failed to generate a statistic template: %s.%s.%s:%T", sqlDb.RevisionQualifiedName(), tableName, sqlIdx.ID(), sqlIdx))
_, template, e = sc.getTemplate(ctx, sqlTable, sqlIdx)
if e != nil {
return errors.Join(e, fmt.Errorf("stats collection failed to generate a statistic template: %s.%s.%s:%T", sqlDb.RevisionQualifiedName(), tableName, sqlIdx.ID(), sqlIdx))
}
return nil
}); err != nil {
})
if err != nil {
return err
} else if template.Fds == nil || template.Fds.Empty() {
return fmt.Errorf("failed to creat template for %s/%s/%s/%s", sqlDb.Revision(), sqlDb.AliasedName(), tableName, sqlIdx.ID())
Expand Down
Loading