Skip to content

Commit

Permalink
cherry pick pingcap#33523 to release-6.0
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
UBarney authored and ti-srebot committed Mar 29, 2022
1 parent 6f28ac4 commit 7d75c3e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions expression/builtin_encryption_vec.go
Expand Up @@ -567,6 +567,7 @@ func (b *builtinCompressSig) vecEvalString(input *chunk.Chunk, result *chunk.Col
// According to doc: Empty strings are stored as empty strings.
if len(strBytes) == 0 {
result.AppendString("")
continue
}

compressed, err := deflate(strBytes)
Expand Down
13 changes: 13 additions & 0 deletions expression/integration_test.go
Expand Up @@ -7078,3 +7078,16 @@ func TestIssue32488(t *testing.T) {
tk.MustQuery("select binary upper(a), lower(a) from t order by upper(a);").Check([][]interface{}{{"İ i"}, {"Ʞ ʞ"}})
tk.MustQuery("select distinct upper(a), lower(a) from t order by upper(a);").Check([][]interface{}{{"İ i"}, {"Ʞ ʞ"}})
}

func TestIssue33397(t *testing.T) {
store, clean := testkit.CreateMockStore(t)
defer clean()

tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("create table t(a varchar(32)) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;")
tk.MustExec("insert into t values(''), ('');")
tk.MustExec("set @@tidb_enable_vectorized_expression = true;")
result := tk.MustQuery("select compress(a) from t").Rows()
require.Equal(t, [][]interface{}{{""}, {""}}, result)
}

0 comments on commit 7d75c3e

Please sign in to comment.