Skip to content

Commit 9422d43

Browse files
committed
sql: fix incorrect min timestamp error check
Release note: None
1 parent 2acb58f commit 9422d43

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/sql/conn_executor.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3884,8 +3884,6 @@ func (ex *connExecutor) GetPCRReaderTimestamp() hlc.Timestamp {
38843884
return hlc.Timestamp{}
38853885
}
38863886

3887-
var minTSErr = kvpb.NewMinTimestampBoundUnsatisfiableError(hlc.Timestamp{}, hlc.Timestamp{})
3888-
38893887
// resetEvalCtx initializes the fields of evalCtx that can change
38903888
// during a session (i.e. the fields not set by initEvalCtx).
38913889
//
@@ -3924,7 +3922,8 @@ func (ex *connExecutor) resetEvalCtx(evalCtx *extendedEvalContext, txn *kv.Txn,
39243922

39253923
// See resetPlanner for more context on setting the maximum timestamp for
39263924
// AOST read retries.
3927-
if err := ex.state.mu.autoRetryReason; err != nil && errors.Is(err, minTSErr) {
3925+
var minTSErr *kvpb.MinTimestampBoundUnsatisfiableError
3926+
if err := ex.state.mu.autoRetryReason; err != nil && errors.HasType(err, minTSErr) {
39283927
evalCtx.AsOfSystemTime.MaxTimestampBound = ex.extraTxnState.descCollection.GetMaxTimestampBound()
39293928
} else if newTxn {
39303929
evalCtx.AsOfSystemTime = nil

0 commit comments

Comments
 (0)