diff --git a/expression/expr_to_pb_test.go b/expression/expr_to_pb_test.go index 6776a843a3a60..134a7b076aeea 100644 --- a/expression/expr_to_pb_test.go +++ b/expression/expr_to_pb_test.go @@ -988,6 +988,11 @@ func TestExprPushDownToFlash(t *testing.T) { require.NoError(t, err) exprs = append(exprs, function) + // quarter: supported + function, err = NewFunction(mock.NewContext(), ast.Quarter, types.NewFieldType(mysql.TypeLonglong), datetimeColumn) + require.NoError(t, err) + exprs = append(exprs, function) + pushed, remained = PushDownExprs(sc, exprs, client, kv.TiFlash) require.Len(t, pushed, len(exprs)) require.Len(t, remained, 0) diff --git a/expression/expression.go b/expression/expression.go index ac0f813269fff..c67705b03b57b 100644 --- a/expression/expression.go +++ b/expression/expression.go @@ -1039,7 +1039,7 @@ func scalarExprSupportedByFlash(function *ScalarFunction) bool { ast.Plus, ast.Minus, ast.Div, ast.Mul, ast.Abs, ast.Mod, ast.If, ast.Ifnull, ast.Case, ast.Concat, ast.ConcatWS, - ast.Date, ast.Year, ast.Month, ast.Day, + ast.Date, ast.Year, ast.Month, ast.Day, ast.Quarter, ast.DateDiff, ast.TimestampDiff, ast.DateFormat, ast.FromUnixTime, ast.Sqrt, ast.Log, ast.Log2, ast.Log10, ast.Ln, ast.Exp, ast.Pow, ast.Sign,