File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import (
29
29
"github.com/pingcap/tidb/pkg/planner/util/optimizetrace"
30
30
"github.com/pingcap/tidb/pkg/sessionctx/variable"
31
31
"github.com/pingcap/tidb/pkg/statistics"
32
+ "github.com/pingcap/tidb/pkg/util/intest"
32
33
"github.com/pingcap/tidb/pkg/util/paging"
33
34
)
34
35
@@ -87,6 +88,7 @@ func (p *PhysicalProjection) GetCost(count float64) float64 {
87
88
88
89
// GetPlanCostVer1 calculates the cost of the plan if it has not been calculated yet and returns the cost.
89
90
func (p * PhysicalProjection ) GetPlanCostVer1 (taskType property.TaskType , option * optimizetrace.PlanCostOption ) (float64 , error ) {
91
+ intest .Assert (p .SCtx ().GetSessionVars ().CostModelVersion != 0 )
90
92
costFlag := option .CostFlag
91
93
if p .PlanCostInit && ! hasCostFlag (costFlag , costusage .CostFlagRecalculate ) {
92
94
return p .PlanCost , nil
Original file line number Diff line number Diff line change @@ -2186,9 +2186,16 @@ func NewSessionVars(hctx HookContext) *SessionVars {
2186
2186
TiFlashComputeDispatchPolicy : tiflashcompute .DispatchPolicyConsistentHash ,
2187
2187
ResourceGroupName : resourcegroup .DefaultResourceGroupName ,
2188
2188
DefaultCollationForUTF8MB4 : mysql .DefaultCollationName ,
2189
+ << << << < HEAD
2189
2190
GroupConcatMaxLen : DefGroupConcatMaxLen ,
2190
2191
EnableRedactLog : DefTiDBRedactLog ,
2191
2192
EnableWindowFunction : DefEnableWindowFunction ,
2193
+ == == == =
2194
+ GroupConcatMaxLen : vardef .DefGroupConcatMaxLen ,
2195
+ EnableRedactLog : vardef .DefTiDBRedactLog ,
2196
+ EnableWindowFunction : vardef .DefEnableWindowFunction ,
2197
+ CostModelVersion : vardef .DefTiDBCostModelVer ,
2198
+ >> >> >> > 1 ef4c269cd7 (planner : set the default of the tidb_cost_model_version correctly (#61608 ))
2192
2199
}
2193
2200
vars .status .Store (uint32 (mysql .ServerStatusAutocommit ))
2194
2201
vars .StmtCtx .ResourceGroupName = resourcegroup .DefaultResourceGroupName
Original file line number Diff line number Diff line change @@ -668,9 +668,14 @@ func newContext() *Context {
668
668
vars .StmtCtx .MemTracker .AttachTo (vars .MemTracker )
669
669
vars .StmtCtx .DiskTracker .AttachTo (vars .DiskTracker )
670
670
vars .GlobalVarsAccessor = variable .NewMockGlobalAccessor ()
671
+ << << << < HEAD
671
672
vars .EnablePaging = variable .DefTiDBEnablePaging
672
673
vars .MinPagingSize = variable .DefMinPagingSize
673
674
vars .CostModelVersion = variable .DefTiDBCostModelVer
675
+ == == == =
676
+ vars .EnablePaging = vardef .DefTiDBEnablePaging
677
+ vars .MinPagingSize = vardef .DefMinPagingSize
678
+ >> >> >> > 1 ef4c269cd7 (planner : set the default of the tidb_cost_model_version correctly (#61608 ))
674
679
vars .EnableChunkRPC = true
675
680
vars .DivPrecisionIncrement = variable .DefDivPrecisionIncrement
676
681
if err := sctx .GetSessionVars ().SetSystemVar (variable .MaxAllowedPacket , "67108864" ); err != nil {
You can’t perform that action at this time.
0 commit comments