Skip to content

Commit 56c0371

Browse files
committed
Allow nil ctx parameter in globalStatusVariables::SetGlobal
1 parent f950002 commit 56c0371

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sql/variables/status_variables.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ func (g *globalStatusVariables) GetGlobal(name string) (sql.StatusVariable, inte
7575

7676
// SetGlobal implements sql.StatusVariableRegistry
7777
func (g *globalStatusVariables) SetGlobal(name string, val interface{}) error {
78-
// TODO: Add context parameter
79-
ctx := sql.NewEmptyContext()
8078
v, ok := g.varVals[name]
8179
if !ok || v.Variable().GetScope() == sql.StatusVariableScope_Session {
8280
return sql.ErrUnknownStatusVariable.New(name)
@@ -86,7 +84,8 @@ func (g *globalStatusVariables) SetGlobal(name string, val interface{}) error {
8684
// non-uint64 status variables. This should really use the type of the status variable as
8785
// type to convert to, but because those are systemInt without the correct bounds configured,
8886
// that conversion will fail with an out of bounds error.
89-
convVal, _, err := types.Uint64.Convert(ctx, val)
87+
// NOTE: A nil context is passed in here. A context is only needed for adaptive encoding, which shouldn't be possible here.
88+
convVal, _, err := types.Uint64.Convert(nil, val)
9089
if err != nil {
9190
return err
9291
}

0 commit comments

Comments
 (0)