Skip to content

Commit

Permalink
Merge branch 'release-5.3' into release-5.3-d83ee8cfdad4
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored Feb 17, 2022
2 parents d97e226 + 88470ec commit 78dc9b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions expression/scalar_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ func (sf *ScalarFunction) Clone() Expression {
}
c.SetCharsetAndCollation(sf.CharsetAndCollation(sf.GetCtx()))
c.SetCoercibility(sf.Coercibility())
c.SetRepertoire(sf.Repertoire())
return c
}

Expand Down
2 changes: 2 additions & 0 deletions expression/scalar_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ func TestScalarFunction(t *testing.T) {
require.True(t, ok)
require.Equal(t, "values", newSf.FuncName.O)
require.Equal(t, mysql.TypeLonglong, newSf.RetType.Tp)
require.Equal(t, sf.Coercibility(), newSf.Coercibility())
require.Equal(t, sf.Repertoire(), newSf.Repertoire())
_, ok = newSf.Function.(*builtinValuesIntSig)
require.True(t, ok)
}
Expand Down
10 changes: 4 additions & 6 deletions util/logutil/slow_query_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@ var _pool = buffer.NewPool()

func newSlowQueryLogger(cfg *LogConfig) (*zap.Logger, *log.ZapProperties, error) {

// copy global config and override slow query log file
// if slow query log filename is empty, slow query log will behave the same as global log
// copy the global log config to slow log config
// if the filename of slow log config is empty, slow log will behave the same as global log.
sqConfig := cfg.Config
// level of the global log config doesn't affect the slow query logger which determines whether to
// log by execution duration.
sqConfig.Level = LogConfig{}.Level
if len(cfg.SlowQueryFile) != 0 {
sqConfig.File = log.FileLogConfig{
MaxSize: cfg.File.MaxSize,
Filename: cfg.SlowQueryFile,
}
sqConfig.File = cfg.File
sqConfig.File.Filename = cfg.SlowQueryFile
}

// create the slow query logger
Expand Down

0 comments on commit 78dc9b6

Please sign in to comment.