(ctx BuildContext, args []Expression)
| 621 | } |
| 622 | |
| 623 | func (c *castAsArrayFunctionClass) getFunction(ctx BuildContext, args []Expression) (sig builtinFunc, err error) { |
| 624 | if err := c.verifyArgs(ctx.GetEvalCtx(), args); err != nil { |
| 625 | return nil, err |
| 626 | } |
| 627 | arrayType := c.tp.ArrayType() |
| 628 | switch arrayType.GetType() { |
| 629 | case mysql.TypeYear, mysql.TypeJSON, mysql.TypeFloat, mysql.TypeNewDecimal: |
| 630 | return nil, ErrNotSupportedYet.GenWithStackByArgs(fmt.Sprintf("CAST-ing data to array of %s", arrayType.String())) |
| 631 | } |
| 632 | if arrayType.EvalType() == types.ETString && arrayType.GetCharset() != charset.CharsetUTF8MB4 && arrayType.GetCharset() != charset.CharsetBin { |
| 633 | return nil, ErrNotSupportedYet.GenWithStackByArgs("specifying charset for multi-valued index") |
| 634 | } |
| 635 | if arrayType.EvalType() == types.ETString && arrayType.GetFlen() == types.UnspecifiedLength { |
| 636 | return nil, ErrNotSupportedYet.GenWithStackByArgs("CAST-ing data to array of char/binary BLOBs with unspecified length") |
| 637 | } |
| 638 | |
| 639 | bf, err := newBaseBuiltinFunc(ctx, c.funcName, args, c.tp) |
| 640 | if err != nil { |
| 641 | return nil, err |
| 642 | } |
| 643 | sig = &castJSONAsArrayFunctionSig{bf} |
| 644 | return sig, nil |
| 645 | } |
| 646 | |
| 647 | type castJSONAsArrayFunctionSig struct { |
| 648 | baseBuiltinFunc |
nothing calls this directly
no test coverage detected