@@ -70,7 +70,7 @@ func (b *baseBuiltinFunc) PbCode() tipb.ScalarFuncSig {
70
70
// metadata returns the metadata of a function.
71
71
// metadata means some functions contain extra inner fields which will not
72
72
// contain in `tipb.Expr.children` but must be pushed down to coprocessor
73
- func (b * baseBuiltinFunc ) metadata () proto.Message {
73
+ func (* baseBuiltinFunc ) metadata () proto.Message {
74
74
// We will not use a field to store them because of only
75
75
// a few functions contain implicit parameters
76
76
return nil
@@ -244,67 +244,67 @@ func (b *baseBuiltinFunc) getArgs() []Expression {
244
244
return b .args
245
245
}
246
246
247
- func (b * baseBuiltinFunc ) vecEvalInt (input * chunk.Chunk , result * chunk.Column ) error {
247
+ func (* baseBuiltinFunc ) vecEvalInt (* chunk.Chunk , * chunk.Column ) error {
248
248
return errors .Errorf ("baseBuiltinFunc.vecEvalInt() should never be called, please contact the TiDB team for help" )
249
249
}
250
250
251
- func (b * baseBuiltinFunc ) vecEvalReal (input * chunk.Chunk , result * chunk.Column ) error {
251
+ func (* baseBuiltinFunc ) vecEvalReal (* chunk.Chunk , * chunk.Column ) error {
252
252
return errors .Errorf ("baseBuiltinFunc.vecEvalReal() should never be called, please contact the TiDB team for help" )
253
253
}
254
254
255
- func (b * baseBuiltinFunc ) vecEvalString (input * chunk.Chunk , result * chunk.Column ) error {
255
+ func (* baseBuiltinFunc ) vecEvalString (* chunk.Chunk , * chunk.Column ) error {
256
256
return errors .Errorf ("baseBuiltinFunc.vecEvalString() should never be called, please contact the TiDB team for help" )
257
257
}
258
258
259
- func (b * baseBuiltinFunc ) vecEvalDecimal (input * chunk.Chunk , result * chunk.Column ) error {
259
+ func (* baseBuiltinFunc ) vecEvalDecimal (* chunk.Chunk , * chunk.Column ) error {
260
260
return errors .Errorf ("baseBuiltinFunc.vecEvalDecimal() should never be called, please contact the TiDB team for help" )
261
261
}
262
262
263
- func (b * baseBuiltinFunc ) vecEvalTime (input * chunk.Chunk , result * chunk.Column ) error {
263
+ func (* baseBuiltinFunc ) vecEvalTime (* chunk.Chunk , * chunk.Column ) error {
264
264
return errors .Errorf ("baseBuiltinFunc.vecEvalTime() should never be called, please contact the TiDB team for help" )
265
265
}
266
266
267
- func (b * baseBuiltinFunc ) vecEvalDuration (input * chunk.Chunk , result * chunk.Column ) error {
267
+ func (* baseBuiltinFunc ) vecEvalDuration (* chunk.Chunk , * chunk.Column ) error {
268
268
return errors .Errorf ("baseBuiltinFunc.vecEvalDuration() should never be called, please contact the TiDB team for help" )
269
269
}
270
270
271
- func (b * baseBuiltinFunc ) vecEvalJSON (input * chunk.Chunk , result * chunk.Column ) error {
271
+ func (* baseBuiltinFunc ) vecEvalJSON (* chunk.Chunk , * chunk.Column ) error {
272
272
return errors .Errorf ("baseBuiltinFunc.vecEvalJSON() should never be called, please contact the TiDB team for help" )
273
273
}
274
274
275
- func (b * baseBuiltinFunc ) evalInt (row chunk.Row ) (int64 , bool , error ) {
275
+ func (* baseBuiltinFunc ) evalInt (chunk.Row ) (int64 , bool , error ) {
276
276
return 0 , false , errors .Errorf ("baseBuiltinFunc.evalInt() should never be called, please contact the TiDB team for help" )
277
277
}
278
278
279
- func (b * baseBuiltinFunc ) evalReal (row chunk.Row ) (float64 , bool , error ) {
279
+ func (* baseBuiltinFunc ) evalReal (chunk.Row ) (float64 , bool , error ) {
280
280
return 0 , false , errors .Errorf ("baseBuiltinFunc.evalReal() should never be called, please contact the TiDB team for help" )
281
281
}
282
282
283
- func (b * baseBuiltinFunc ) evalString (row chunk.Row ) (string , bool , error ) {
283
+ func (* baseBuiltinFunc ) evalString (chunk.Row ) (string , bool , error ) {
284
284
return "" , false , errors .Errorf ("baseBuiltinFunc.evalString() should never be called, please contact the TiDB team for help" )
285
285
}
286
286
287
- func (b * baseBuiltinFunc ) evalDecimal (row chunk.Row ) (* types.MyDecimal , bool , error ) {
287
+ func (* baseBuiltinFunc ) evalDecimal (chunk.Row ) (* types.MyDecimal , bool , error ) {
288
288
return nil , false , errors .Errorf ("baseBuiltinFunc.evalDecimal() should never be called, please contact the TiDB team for help" )
289
289
}
290
290
291
- func (b * baseBuiltinFunc ) evalTime (row chunk.Row ) (types.Time , bool , error ) {
291
+ func (* baseBuiltinFunc ) evalTime (chunk.Row ) (types.Time , bool , error ) {
292
292
return types .ZeroTime , false , errors .Errorf ("baseBuiltinFunc.evalTime() should never be called, please contact the TiDB team for help" )
293
293
}
294
294
295
- func (b * baseBuiltinFunc ) evalDuration (row chunk.Row ) (types.Duration , bool , error ) {
295
+ func (* baseBuiltinFunc ) evalDuration (chunk.Row ) (types.Duration , bool , error ) {
296
296
return types.Duration {}, false , errors .Errorf ("baseBuiltinFunc.evalDuration() should never be called, please contact the TiDB team for help" )
297
297
}
298
298
299
- func (b * baseBuiltinFunc ) evalJSON (row chunk.Row ) (types.BinaryJSON , bool , error ) {
299
+ func (* baseBuiltinFunc ) evalJSON (chunk.Row ) (types.BinaryJSON , bool , error ) {
300
300
return types.BinaryJSON {}, false , errors .Errorf ("baseBuiltinFunc.evalJSON() should never be called, please contact the TiDB team for help" )
301
301
}
302
302
303
- func (b * baseBuiltinFunc ) vectorized () bool {
303
+ func (* baseBuiltinFunc ) vectorized () bool {
304
304
return false
305
305
}
306
306
307
- func (b * baseBuiltinFunc ) supportReverseEval () bool {
307
+ func (* baseBuiltinFunc ) supportReverseEval () bool {
308
308
return false
309
309
}
310
310
@@ -321,7 +321,7 @@ func (b *baseBuiltinFunc) isChildrenReversed() bool {
321
321
return b .childrenReversed
322
322
}
323
323
324
- func (b * baseBuiltinFunc ) reverseEval (sc * stmtctx.StatementContext , res types.Datum , rType types.RoundingType ) (types.Datum , error ) {
324
+ func (* baseBuiltinFunc ) reverseEval (* stmtctx.StatementContext , types.Datum , types.RoundingType ) (types.Datum , error ) {
325
325
return types.Datum {}, errors .Errorf ("baseBuiltinFunc.reverseEvalInt() should never be called, please contact the TiDB team for help" )
326
326
}
327
327
@@ -339,8 +339,7 @@ func (b *baseBuiltinFunc) isChildrenVectorized() bool {
339
339
}
340
340
341
341
func (b * baseBuiltinFunc ) getRetTp () * types.FieldType {
342
- switch b .tp .EvalType () {
343
- case types .ETString :
342
+ if b .tp .EvalType () == types .ETString {
344
343
if b .tp .GetFlen () >= mysql .MaxBlobWidth {
345
344
b .tp .SetType (mysql .TypeLongBlob )
346
345
} else if b .tp .GetFlen () >= 65536 {
@@ -386,7 +385,7 @@ func (b *baseBuiltinFunc) cloneFrom(from *baseBuiltinFunc) {
386
385
b .ctor = from .ctor
387
386
}
388
387
389
- func (b * baseBuiltinFunc ) Clone () builtinFunc {
388
+ func (* baseBuiltinFunc ) Clone () builtinFunc {
390
389
panic ("you should not call this method." )
391
390
}
392
391
0 commit comments