Skip to content

Commit

Permalink
expression: fix incorrect unit test from #37036 (#37115)
Browse files Browse the repository at this point in the history
close #37116
  • Loading branch information
SeaRise authored Aug 19, 2022
1 parent 8511b9b commit 7d401c5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions expression/expr_to_pb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1178,18 +1178,19 @@ 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)

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) {
Expand Down

0 comments on commit 7d401c5

Please sign in to comment.