Skip to content

Commit

Permalink
session: set EnableWindowFunction for all SessionVars (pingcap#55991) (
Browse files Browse the repository at this point in the history
  • Loading branch information
winoros authored Sep 11, 2024
1 parent b8cfb3e commit f9c1dd1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions sessionctx/variable/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1960,6 +1960,7 @@ func NewSessionVars(hctx HookContext) *SessionVars {
mppVersion: kv.MppVersionUnspecified,
EnableLateMaterialization: DefTiDBOptEnableLateMaterialization,
TiFlashComputeDispatchPolicy: tiflashcompute.DispatchPolicyConsistentHash,
EnableWindowFunction: DefEnableWindowFunction,
}
vars.KVVars = tikvstore.NewVariables(&vars.Killed)
vars.Concurrency = Concurrency{
Expand Down
11 changes: 11 additions & 0 deletions sessionctx/variable/sysvar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1238,3 +1238,14 @@ func TestTiDBEnableRowLevelChecksum(t *testing.T) {
require.NoError(t, err)
require.Equal(t, Off, val)
}

func TestEnableWindowFunction(t *testing.T) {
vars := NewSessionVars(nil)
require.Equal(t, vars.EnableWindowFunction, DefEnableWindowFunction)
require.NoError(t, vars.SetSystemVar(TiDBEnableWindowFunction, "on"))
require.Equal(t, vars.EnableWindowFunction, true)
require.NoError(t, vars.SetSystemVar(TiDBEnableWindowFunction, "0"))
require.Equal(t, vars.EnableWindowFunction, false)
require.NoError(t, vars.SetSystemVar(TiDBEnableWindowFunction, "1"))
require.Equal(t, vars.EnableWindowFunction, true)
}

0 comments on commit f9c1dd1

Please sign in to comment.