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 10, 2024
1 parent 305cf42 commit 1097ba8
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 @@ -1727,6 +1727,7 @@ func NewSessionVars(hctx HookContext) *SessionVars {
EnableReuseCheck: DefTiDBEnableReusechunk,
preUseChunkAlloc: DefTiDBUseAlloc,
ChunkPool: ReuseChunkPool{Alloc: nil},
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 @@ -1092,3 +1092,14 @@ func TestSetJobScheduleWindow(t *testing.T) {
require.NoError(t, err)
require.Equal(t, "16:11 +0800", 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 1097ba8

Please sign in to comment.