Skip to content

Commit

Permalink
sql: fix merge skew in sql.(*createStatsResumer).Resume
Browse files Browse the repository at this point in the history
Move the definition of evalCtx down to match the backports of cockroachdb#123926.

Informs: cockroachdb#123821

Release note: None
  • Loading branch information
michae2 committed May 13, 2024
1 parent 0b25bdb commit 921731b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/sql/create_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,6 @@ func (r *createStatsResumer) Resume(ctx context.Context, execCtx interface{}) er
}

r.tableID = details.Table.ID
evalCtx := jobsPlanner.ExtendedEvalContext()

if err := jobsPlanner.ExecCfg().InternalDB.Txn(ctx, func(ctx context.Context, txn isql.Txn) error {
// We create a third "inner planner" associated with this txn in order to
Expand Down Expand Up @@ -720,6 +719,9 @@ func (r *createStatsResumer) Resume(ctx context.Context, execCtx interface{}) er
}); err != nil {
return err
}

evalCtx := jobsPlanner.ExtendedEvalContext()

// Record this statistics creation in the event log.
if !createStatsPostEvents.Get(&evalCtx.Settings.SV) {
return nil
Expand Down

0 comments on commit 921731b

Please sign in to comment.