Skip to content

Commit f04f48c

Browse files
committed
sql: propagate TestingKnobs.ForceProductionValues to remote nodes
This commit fixes an oversight in how we handle `eval.Context.TestingKnobs.ForceProductionValues`. Namely, previously we forgot to propagate this information from the gateway to remote nodes, so the latter would not respect this knob. This is now fixed. Release note: None
1 parent 442e522 commit f04f48c

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

pkg/sql/distsql/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ func (ds *ServerImpl) setupFlow(
354354
}
355355
evalCtx.SetStmtTimestamp(timeutil.Unix(0 /* sec */, req.EvalContext.StmtTimestampNanos))
356356
evalCtx.SetTxnTimestamp(timeutil.Unix(0 /* sec */, req.EvalContext.TxnTimestampNanos))
357+
evalCtx.TestingKnobs.ForceProductionValues = req.EvalContext.TestingKnobsForceProductionValues
357358
}
358359

359360
// Create the FlowCtx for the flow.

pkg/sql/execinfrapb/api.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ func MakeEvalContext(evalCtx *eval.Context) EvalContext {
4848
sessionDataProto := evalCtx.SessionData().SessionData
4949
sessiondata.MarshalNonLocal(evalCtx.SessionData(), &sessionDataProto)
5050
return EvalContext{
51-
SessionData: sessionDataProto,
52-
StmtTimestampNanos: evalCtx.StmtTimestamp.UnixNano(),
53-
TxnTimestampNanos: evalCtx.TxnTimestamp.UnixNano(),
51+
SessionData: sessionDataProto,
52+
StmtTimestampNanos: evalCtx.StmtTimestamp.UnixNano(),
53+
TxnTimestampNanos: evalCtx.TxnTimestamp.UnixNano(),
54+
TestingKnobsForceProductionValues: evalCtx.TestingKnobs.ForceProductionValues,
5455
}
5556
}
5657

pkg/sql/execinfrapb/api.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ message EvalContext {
8585
optional int64 txn_timestamp_nanos = 2 [(gogoproto.nullable) = false];
8686
reserved 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14;
8787
optional sessiondatapb.SessionData session_data = 15 [(gogoproto.nullable) = false];
88+
optional bool testing_knobs_force_production_values = 16 [(gogoproto.nullable) = false];
8889
}
8990

9091
message SimpleResponse {

0 commit comments

Comments
 (0)