Skip to content

Commit

Permalink
sql: fix makeFixedTimestampInternalExecRunner to use correct Internal…
Browse files Browse the repository at this point in the history
… Executor

This is part of the effort to deprecate `ieFactory.NewInternalExecutor()`.
The internal executor should be bound to the outer txn, if there's one.

Release note: None
  • Loading branch information
ZhouXing19 committed Nov 9, 2022
1 parent ee4fdb7 commit 0b468c0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/sql/backfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,10 @@ func (sc *SchemaChanger) makeFixedTimestampInternalExecRunner(
readAsOf hlc.Timestamp,
) descs.HistoricalInternalExecTxnRunner {
return descs.NewHistoricalInternalExecTxnRunner(readAsOf, func(ctx context.Context, retryable descs.InternalExecFn) error {
return sc.fixedTimestampTxn(ctx, readAsOf, func(
ctx context.Context, txn *kv.Txn, descriptors *descs.Collection,
return sc.fixedTimestampTxnWithExecutor(ctx, readAsOf, func(
ctx context.Context, txn *kv.Txn, _ *sessiondata.SessionData, descriptors *descs.Collection, ie sqlutil.InternalExecutor,
) error {
// We need to re-create the evalCtx since the txn may retry.
ie := sc.ieFactory.NewInternalExecutor(NewFakeSessionData(sc.execCfg.SV()))
return retryable(ctx, txn, ie, nil /* descriptors */)
return retryable(ctx, txn, ie, descriptors)
})
})
}
Expand Down

0 comments on commit 0b468c0

Please sign in to comment.