diff --git a/expression/expr_to_pb_test.go b/expression/expr_to_pb_test.go index af1e0471260d1..03d80a14d018f 100644 --- a/expression/expr_to_pb_test.go +++ b/expression/expr_to_pb_test.go @@ -1178,6 +1178,12 @@ func TestExprPushDownToFlash(t *testing.T) { require.NoError(t, err) exprs = append(exprs, function) + // CastTimeAsDuration + function, err = NewFunction(mock.NewContext(), ast.Cast, types.NewFieldType(mysql.TypeDuration), datetimeColumn) + require.NoError(t, err) + require.Equal(t, tipb.ScalarFuncSig_CastTimeAsDuration, function.(*ScalarFunction).Function.PbCode()) + exprs = append(exprs, function) + pushed, remained = PushDownExprs(sc, exprs, client, kv.TiFlash) require.Len(t, pushed, len(exprs)) require.Len(t, remained, 0) @@ -1185,11 +1191,6 @@ func TestExprPushDownToFlash(t *testing.T) { pushed, remained = PushDownExprsWithExtraInfo(sc, exprs, client, kv.TiFlash, true) require.Len(t, pushed, len(exprs)) require.Len(t, remained, 0) - - // CastTimeAsDuration - function, err = NewFunction(mock.NewContext(), ast.Cast, types.NewFieldType(mysql.TypeDatetime), durationColumn) - require.NoError(t, err) - exprs = append(exprs, function) } func TestExprOnlyPushDownToFlash(t *testing.T) {