Commit 194f501 1 parent d9f0476 commit 194f501 Copy full SHA for 194f501
File tree 3 files changed +12
-4
lines changed
3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1186,10 +1186,6 @@ func createSessionFunc(store kv.Storage) pools.Factory {
1186
1186
if err != nil {
1187
1187
return nil , errors .Trace (err )
1188
1188
}
1189
- err = se .sessionVars .SetSystemVar (variable .TiDBEnableWindowFunction , variable .BoolToOnOff (variable .DefEnableWindowFunction ))
1190
- if err != nil {
1191
- return nil , errors .Trace (err )
1192
- }
1193
1189
err = se .sessionVars .SetSystemVar (variable .TiDBConstraintCheckInPlacePessimistic , variable .On )
1194
1190
if err != nil {
1195
1191
return nil , errors .Trace (err )
Original file line number Diff line number Diff line change @@ -2213,6 +2213,7 @@ func NewSessionVars(hctx HookContext) *SessionVars {
2213
2213
DefaultCollationForUTF8MB4 : mysql .DefaultCollationName ,
2214
2214
GroupConcatMaxLen : DefGroupConcatMaxLen ,
2215
2215
EnableRedactLog : DefTiDBRedactLog ,
2216
+ EnableWindowFunction : DefEnableWindowFunction ,
2216
2217
}
2217
2218
vars .status .Store (uint32 (mysql .ServerStatusAutocommit ))
2218
2219
vars .StmtCtx .ResourceGroupName = resourcegroup .DefaultResourceGroupName
Original file line number Diff line number Diff line change @@ -1742,6 +1742,17 @@ func TestTiDBSchemaCacheSize(t *testing.T) {
1742
1742
require .Error (t , err )
1743
1743
}
1744
1744
1745
+ func TestEnableWindowFunction (t * testing.T ) {
1746
+ vars := NewSessionVars (nil )
1747
+ require .Equal (t , vars .EnableWindowFunction , DefEnableWindowFunction )
1748
+ require .NoError (t , vars .SetSystemVar (TiDBEnableWindowFunction , "on" ))
1749
+ require .Equal (t , vars .EnableWindowFunction , true )
1750
+ require .NoError (t , vars .SetSystemVar (TiDBEnableWindowFunction , "0" ))
1751
+ require .Equal (t , vars .EnableWindowFunction , false )
1752
+ require .NoError (t , vars .SetSystemVar (TiDBEnableWindowFunction , "1" ))
1753
+ require .Equal (t , vars .EnableWindowFunction , true )
1754
+ }
1755
+
1745
1756
func TestTiDBAutoAnalyzeConcurrencyValidation (t * testing.T ) {
1746
1757
vars := NewSessionVars (nil )
1747
1758
You can’t perform that action at this time.
0 commit comments