Skip to content

Commit

Permalink
log stats load errors as warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
max-hoffman committed Feb 16, 2024
1 parent 732127d commit 9649a5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go/cmd/dolt/commands/engine/sqlengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package engine

import (
"context"
"fmt"
"os"
"runtime"
"strconv"
Expand Down Expand Up @@ -192,7 +193,7 @@ func NewSqlEngine(
// configuring stats depends on sessionBuilder
// sessionBuilder needs ref to statsProv
if err = statsPro.Configure(ctx, sqlEngine.NewDefaultContext, bThreads, pro, dbs); err != nil {
return nil, err
fmt.Fprintln(cli.CliErr, err)
}

// Load MySQL Db information
Expand Down
5 changes: 5 additions & 0 deletions go/libraries/doltcore/sqle/stats/stats_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ func (p *Provider) Load(ctx *sql.Context, dbs []dsess.SqlDatabase) error {
} else if err != nil {
return err
}
if cnt, err := m.Count(); err != nil {
return err
} else if cnt == 0 {
return nil
}
stats, err := loadStats(ctx, db, m)
if errors.Is(err, dtables.ErrIncompatibleVersion) {
ctx.Warn(0, err.Error())
Expand Down

0 comments on commit 9649a5b

Please sign in to comment.