diff --git a/go/cmd/dolt/commands/engine/sqlengine.go b/go/cmd/dolt/commands/engine/sqlengine.go index 103f082fc69..5584efef4c5 100644 --- a/go/cmd/dolt/commands/engine/sqlengine.go +++ b/go/cmd/dolt/commands/engine/sqlengine.go @@ -16,6 +16,7 @@ package engine import ( "context" + "fmt" "os" "runtime" "strconv" @@ -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 diff --git a/go/libraries/doltcore/sqle/stats/stats_provider.go b/go/libraries/doltcore/sqle/stats/stats_provider.go index f49b5ad9041..55d408b3ed4 100644 --- a/go/libraries/doltcore/sqle/stats/stats_provider.go +++ b/go/libraries/doltcore/sqle/stats/stats_provider.go @@ -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())