@@ -646,7 +646,7 @@ func TestCastFuncSig(t *testing.T) {
646
646
tp := types .NewFieldType (mysql .TypeVarString )
647
647
tp .SetCharset (charset .CharsetBin )
648
648
args := []Expression {c .before }
649
- stringFunc , err := newBaseBuiltinFunc (ctx , "" , args , tp )
649
+ stringFunc , err := newBaseBuiltinCastFunc4String (ctx , "" , args , tp , false )
650
650
require .NoError (t , err )
651
651
switch i {
652
652
case 0 :
@@ -732,7 +732,7 @@ func TestCastFuncSig(t *testing.T) {
732
732
tp := types .NewFieldType (mysql .TypeVarString )
733
733
tp .SetFlen (c .flen )
734
734
tp .SetCharset (charset .CharsetBin )
735
- stringFunc , err := newBaseBuiltinFunc (ctx , "" , args , tp )
735
+ stringFunc , err := newBaseBuiltinCastFunc4String (ctx , "" , args , tp , false )
736
736
require .NoError (t , err )
737
737
switch i {
738
738
case 0 :
@@ -1083,7 +1083,7 @@ func TestCastFuncSig(t *testing.T) {
1083
1083
// null case
1084
1084
args := []Expression {& Column {RetType : types .NewFieldType (mysql .TypeDouble ), Index : 0 }}
1085
1085
row := chunk .MutRowFromDatums ([]types.Datum {types .NewDatum (nil )})
1086
- bf , err := newBaseBuiltinFunc (ctx , "" , args , types .NewFieldType (mysql .TypeVarString ))
1086
+ bf , err := newBaseBuiltinCastFunc4String (ctx , "" , args , types .NewFieldType (mysql .TypeVarString ), false )
1087
1087
require .NoError (t , err )
1088
1088
sig = & builtinCastRealAsStringSig {bf }
1089
1089
sRes , isNull , err := sig .evalString (row .ToRow ())
@@ -1677,10 +1677,8 @@ func TestCastArrayFunc(t *testing.T) {
1677
1677
},
1678
1678
}
1679
1679
for _ , tt := range tbl {
1680
- f , err := BuildCastFunctionWithCheck (ctx , datumsToConstants (types .MakeDatums (types .CreateBinaryJSON (tt .input )))[0 ], tt .tp )
1681
- if tt .buildFuncSuccess {
1682
- require .NoError (t , err , tt .input )
1683
- } else {
1680
+ f , err := BuildCastFunctionWithCheck (ctx , datumsToConstants (types .MakeDatums (types .CreateBinaryJSON (tt .input )))[0 ], tt .tp , false )
1681
+ if ! tt .buildFuncSuccess {
1684
1682
require .Error (t , err , tt .input )
1685
1683
continue
1686
1684
}
0 commit comments