Skip to content

Commit

Permalink
test: add test case for unsupported collation
Browse files Browse the repository at this point in the history
Signed-off-by: Lakshya Singh <[email protected]>
  • Loading branch information
king-11 committed Nov 2, 2021
1 parent 82ecf9b commit 9e83dec
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions go/vt/vtgate/evalengine/arithmetic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,19 @@ func TestNullsafeCompareCollate(t *testing.T) {
collation: 0,
err: vterrors.New(vtrpcpb.Code_UNKNOWN, "types are not comparable: VARCHAR vs VARCHAR"),
},
{
v1: "abcd",
v2: "abcd",
collation: 1111,
err: vterrors.New(vtrpcpb.Code_UNKNOWN, "comparison using collation 1111 isn't possible"),
},
{
v1: "abcd",
v2: "abcd",
// unsupported collation gb18030_bin
collation: 249,
err: vterrors.New(vtrpcpb.Code_UNKNOWN, "comparison using collation 249 isn't possible"),
},
}
for _, tcase := range tcases {
got, err := NullsafeCompare(TestValue(querypb.Type_VARCHAR, tcase.v1), TestValue(querypb.Type_VARCHAR, tcase.v2), tcase.collation)
Expand Down

0 comments on commit 9e83dec

Please sign in to comment.