expression: create a new context in ColumnInfos2ColumnsAndNames to ignore truncate error (#52468)

close pingcap/tidb#52366
This commit is contained in:
王超
2024-04-11 16:09:29 +08:00
committed by GitHub
parent da0de56204
commit 2debbed41d
3 changed files with 81 additions and 17 deletions

View File

@ -931,13 +931,6 @@ func (e *CheckTableExec) Next(ctx context.Context, _ *chunk.Chunk) error {
}
defer func() { e.done = true }()
// See the comment of `ColumnInfos2ColumnsAndNames`. It's fixing #42341
originalTypeFlags := e.Ctx().GetSessionVars().StmtCtx.TypeFlags()
defer func() {
e.Ctx().GetSessionVars().StmtCtx.SetTypeFlags(originalTypeFlags)
}()
e.Ctx().GetSessionVars().StmtCtx.SetTypeFlags(originalTypeFlags.WithIgnoreTruncateErr(true))
idxNames := make([]string, 0, len(e.indexInfos))
for _, idx := range e.indexInfos {
if idx.MVIndex {