Skip to content

Commit

Permalink
Merge #124088
Browse files Browse the repository at this point in the history
124088: sql: fix merge skew in sql.(*createStatsResumer).Resume r=yuzefovich a=michae2

Move the definition of evalCtx down to match the backports of #123926.

Informs: #123821

Release note: None

Co-authored-by: Michael Erickson <michae2@cockroachlabs.com>
  • Loading branch information
craig[bot] and michae2 committed May 13, 2024
2 parents ae79a73 + 921731b commit 42e3772
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 42e3772

Please sign in to comment.