Skip to content

Commit fde3a79

Browse files
committed
Use unfoldablefunc to simplification
1 parent 6ea2ec8 commit fde3a79

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

expression/scalar_function.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,8 @@ func (sf *ScalarFunction) IsCorrelated() bool {
167167

168168
// ConstItem implements Expression interface.
169169
func (sf *ScalarFunction) ConstItem() bool {
170-
if _, ok := DeferredFunctions[sf.FuncName.L]; ok {
171-
return false
172-
}
173-
if sf.FuncName.L == ast.GetParam {
170+
// Note: some unfoldable functions are deterministic, we use unFoldableFunctions here for simplification.
171+
if _, ok := unFoldableFunctions[sf.FuncName.L]; ok {
174172
return false
175173
}
176174
for _, arg := range sf.GetArgs() {

0 commit comments

Comments
 (0)