Skip to content

Commit

Permalink
expression: clone repertoire when clone the scalar function (#30602)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongjiwei authored Dec 10, 2021
1 parent aa002f2 commit 03b6a8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions expression/scalar_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ func (sf *ScalarFunction) Clone() Expression {
}
c.SetCharsetAndCollation(sf.CharsetAndCollation())
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

0 comments on commit 03b6a8e

Please sign in to comment.