From 6bd08b318a1a788192edcc68368636ad9682cbfe Mon Sep 17 00:00:00 2001 From: ti-srebot <66930949+ti-srebot@users.noreply.github.com> Date: Thu, 3 Sep 2020 23:08:20 +0800 Subject: [PATCH] expression: fix unmatched column lengths errors ca ... (#19754) (#19758) --- expression/builtin_compare_vec.go | 2 ++ util/chunk/column.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/expression/builtin_compare_vec.go b/expression/builtin_compare_vec.go index c1c8cc18c0c48..439143706bf45 100644 --- a/expression/builtin_compare_vec.go +++ b/expression/builtin_compare_vec.go @@ -254,6 +254,7 @@ func (b *builtinLeastStringSig) vecEvalString(input *chunk.Chunk, result *chunk. src := result arg := buf1 dst := buf2 + dst.ReserveString(n) for j := 1; j < len(b.args); j++ { if err := b.args[j].VecEvalString(b.ctx, input, arg); err != nil { return err @@ -793,6 +794,7 @@ func (b *builtinGreatestStringSig) vecEvalString(input *chunk.Chunk, result *chu src := result arg := buf1 dst := buf2 + dst.ReserveString(n) for j := 1; j < len(b.args); j++ { if err := b.args[j].VecEvalString(b.ctx, input, arg); err != nil { return err diff --git a/util/chunk/column.go b/util/chunk/column.go index 4089389872318..fd51fb2bb056b 100644 --- a/util/chunk/column.go +++ b/util/chunk/column.go @@ -703,7 +703,7 @@ func (c *Column) MergeNulls(cols ...*Column) { } for _, col := range cols { if c.length != col.length { - panic("should ensure all columns have the same length") + panic(fmt.Sprintf("should ensure all columns have the same length, expect %v, but got %v", c.length, col.length)) } } for _, col := range cols {