From e40243059dacd34f1f3d5fde55d3d1ea299be4ef Mon Sep 17 00:00:00 2001 From: Ewan Chou Date: Thu, 23 Mar 2017 20:49:24 +0800 Subject: [PATCH] table: log more detail on incorrect utf8 value. (#2916) --- table/column.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/table/column.go b/table/column.go index ebe04016ed5e7..4c2dea33362a6 100644 --- a/table/column.go +++ b/table/column.go @@ -130,6 +130,8 @@ func CastValue(ctx context.Context, val types.Datum, col *model.ColumnInfo) (cas str := casted.GetString() for i, r := range str { if r == utf8.RuneError { + log.Errorf("[%d] incorrect utf8 value: %x for column %s", + ctx.GetSessionVars().ConnectionID, []byte(str), col.Name) // Truncate to valid utf8 string. casted = types.NewStringDatum(str[:i]) err = sc.HandleTruncate(ErrTruncateWrongValue)