diff --git a/table/temptable/infoschema.go b/table/temptable/infoschema.go index 952610db566aa..f2de5cf8b5dfe 100644 --- a/table/temptable/infoschema.go +++ b/table/temptable/infoschema.go @@ -41,9 +41,9 @@ func AttachLocalTemporaryTableInfoSchema(sctx sessionctx.Context, is infoschema. // DetachLocalTemporaryTableInfoSchema detach local temporary table information schema from is func DetachLocalTemporaryTableInfoSchema(is infoschema.InfoSchema) infoschema.InfoSchema { if attachedInfoSchema, ok := is.(*infoschema.SessionExtendedInfoSchema); ok { - newIs := *attachedInfoSchema + newIs := attachedInfoSchema newIs.LocalTemporaryTables = nil - return &newIs + return newIs } return is