Skip to content

Commit

Permalink
clarify the cast(... as char array) error message
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Keao <[email protected]>
  • Loading branch information
YangKeao committed May 13, 2024
1 parent 601e21c commit f829768
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/expression/builtin_cast.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ func (c *castAsArrayFunctionClass) getFunction(ctx BuildContext, args []Expressi
return nil, ErrNotSupportedYet.GenWithStackByArgs("specifying charset for multi-valued index")
}
if arrayType.EvalType() == types.ETString && arrayType.GetFlen() == types.UnspecifiedLength {
return nil, ErrNotSupportedYet.GenWithStackByArgs("CAST-ing data to array of char/binary BLOBs")
return nil, ErrNotSupportedYet.GenWithStackByArgs("CAST-ing data to array of char/binary BLOBs with unspecified length")
}

bf, err := newBaseBuiltinFunc(ctx, c.funcName, args, c.tp)
Expand Down
4 changes: 2 additions & 2 deletions tests/integrationtest/r/expression/multi_valued_index.result
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Error 1235 (42000): This version of TiDB doesn't yet support 'Use of CAST( .. AS
create table t(j json, gc json as (cast(j->'$[*]' as unsigned array)));
Error 1235 (42000): This version of TiDB doesn't yet support 'Use of CAST( .. AS .. ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in general expressions'
create table t1(j json, key i1((cast(j->"$" as char array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'CAST-ing data to array of char/binary BLOBs'
Error 1235 (42000): This version of TiDB doesn't yet support 'CAST-ing data to array of char/binary BLOBs with unspecified length'
create table t1(j json, key i1((cast(j->"$" as binary array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'CAST-ing data to array of char/binary BLOBs'
Error 1235 (42000): This version of TiDB doesn't yet support 'CAST-ing data to array of char/binary BLOBs with unspecified length'
create table t1(j json, key i1((cast(j->"$" as float array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'CAST-ing data to array of float BINARY'
create table t1(j json, key i1((cast(j->"$" as decimal(4,2) array))));
Expand Down

0 comments on commit f829768

Please sign in to comment.