90 lines
2.6 KiB
Go
90 lines
2.6 KiB
Go
// Copyright 2024 PingCAP, Inc.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
// Code generated by plan_clone_generator; DO NOT EDIT IT DIRECTLY.
|
|
|
|
package core
|
|
|
|
import (
|
|
"github.com/pingcap/tidb/pkg/planner/core/base"
|
|
"github.com/pingcap/tidb/pkg/planner/util"
|
|
)
|
|
|
|
// CloneForPlanCache implements the base.Plan interface.
|
|
func (op *Update) CloneForPlanCache(newCtx base.PlanContext) (base.Plan, bool) {
|
|
cloned := new(Update)
|
|
*cloned = *op
|
|
cloned.SimpleSchemaProducer = *op.SimpleSchemaProducer.CloneSelfForPlanCache(newCtx)
|
|
cloned.OrderedList = util.CloneAssignments(op.OrderedList)
|
|
if op.SelectPlan != nil {
|
|
SelectPlan, ok := op.SelectPlan.CloneForPlanCache(newCtx)
|
|
if !ok {
|
|
return nil, false
|
|
}
|
|
cloned.SelectPlan = SelectPlan.(base.PhysicalPlan)
|
|
}
|
|
if op.FKChecks != nil {
|
|
return nil, false
|
|
}
|
|
if op.FKCascades != nil {
|
|
return nil, false
|
|
}
|
|
return cloned, true
|
|
}
|
|
|
|
// CloneForPlanCache implements the base.Plan interface.
|
|
func (op *Delete) CloneForPlanCache(newCtx base.PlanContext) (base.Plan, bool) {
|
|
cloned := new(Delete)
|
|
*cloned = *op
|
|
cloned.SimpleSchemaProducer = *op.SimpleSchemaProducer.CloneSelfForPlanCache(newCtx)
|
|
if op.SelectPlan != nil {
|
|
SelectPlan, ok := op.SelectPlan.CloneForPlanCache(newCtx)
|
|
if !ok {
|
|
return nil, false
|
|
}
|
|
cloned.SelectPlan = SelectPlan.(base.PhysicalPlan)
|
|
}
|
|
if op.FKChecks != nil {
|
|
return nil, false
|
|
}
|
|
if op.FKCascades != nil {
|
|
return nil, false
|
|
}
|
|
return cloned, true
|
|
}
|
|
|
|
// CloneForPlanCache implements the base.Plan interface.
|
|
func (op *Insert) CloneForPlanCache(newCtx base.PlanContext) (base.Plan, bool) {
|
|
cloned := new(Insert)
|
|
*cloned = *op
|
|
cloned.SimpleSchemaProducer = *op.SimpleSchemaProducer.CloneSelfForPlanCache(newCtx)
|
|
cloned.Lists = cloneExpression2DForPlanCache(op.Lists)
|
|
cloned.OnDuplicate = util.CloneAssignments(op.OnDuplicate)
|
|
cloned.GenCols = op.GenCols.cloneForPlanCache()
|
|
if op.SelectPlan != nil {
|
|
SelectPlan, ok := op.SelectPlan.CloneForPlanCache(newCtx)
|
|
if !ok {
|
|
return nil, false
|
|
}
|
|
cloned.SelectPlan = SelectPlan.(base.PhysicalPlan)
|
|
}
|
|
if op.FKChecks != nil {
|
|
return nil, false
|
|
}
|
|
if op.FKCascades != nil {
|
|
return nil, false
|
|
}
|
|
return cloned, true
|
|
}
|