From 9e83decb866f7c2e528cfeded6d60eb590eaa86a Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Thu, 28 Oct 2021 17:57:34 +0530 Subject: [PATCH] test: add test case for unsupported collation Signed-off-by: Lakshya Singh --- go/vt/vtgate/evalengine/arithmetic_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/go/vt/vtgate/evalengine/arithmetic_test.go b/go/vt/vtgate/evalengine/arithmetic_test.go index a2df2c8ac58..5fca60d4054 100644 --- a/go/vt/vtgate/evalengine/arithmetic_test.go +++ b/go/vt/vtgate/evalengine/arithmetic_test.go @@ -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)