Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleFall committed Jun 27, 2022
1 parent 67fa348 commit 119a05d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions expression/expression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ func TestEvaluateExprWithNullNoChangeRetType(t *testing.T) {
tblInfo := newTestTableBuilder("").add("col_str", mysql.TypeString, 0).build()
schema := tableInfoToSchemaForTest(tblInfo)

castStrAsJson := BuildCastFunction(ctx, schema.Columns[0], types.NewFieldType(mysql.TypeJSON))
castStrAsJSON := BuildCastFunction(ctx, schema.Columns[0], types.NewFieldType(mysql.TypeJSON))
jsonConstant := &Constant{Value: types.NewDatum("123"), RetType: types.NewFieldType(mysql.TypeJSON)}

// initially has ParseToJSONFlag
flagInCast := castStrAsJson.(*ScalarFunction).RetType.GetFlag()
flagInCast := castStrAsJSON.(*ScalarFunction).RetType.GetFlag()
require.True(t, mysql.HasParseToJSONFlag(flagInCast))

// cast's ParseToJSONFlag removed by `DisableParseJSONFlag4Expr`
eq, err := newFunctionForTest(ctx, ast.EQ, jsonConstant, castStrAsJson)
eq, err := newFunctionForTest(ctx, ast.EQ, jsonConstant, castStrAsJSON)
require.NoError(t, err)
flagInCast = eq.(*ScalarFunction).GetArgs()[1].(*ScalarFunction).RetType.GetFlag()
require.False(t, mysql.HasParseToJSONFlag(flagInCast))
Expand Down

0 comments on commit 119a05d

Please sign in to comment.