Repository: pingcap/tidb
File: pkg/planner/util/fixcontrol/get.go (Go)

Code before:
	// Fix43817 controls whether to allow optimizer to evaluate non-correlated sub-queries in the optimization phase.
	// If it is not allowed, the optimizer will return a particular error when encountering non-correlated sub-queries.
	// This fix-control is mainly for Index Advisor.
	Fix43817 uint64 = 43817
	// Fix44262 controls whether to allow to use dynamic-mode to access partitioning tables without global-stats (#44262).
	Fix44262 uint64 = 44262
	// Fix44389 controls whether to consider non-point ranges of some CNF item when building ranges.
	Fix44389 uint64 = 44389
	// Fix44830 controls whether to allow to cache Batch/PointGet from some complex scenarios.
	// See #44830 for more details.
	Fix44830 uint64 = 44830
	// Fix44823 controls the maximum number of parameters for a query that can be cached in the Plan Cache.
	Fix44823 uint64 = 44823
	// Fix44855 controls whether to use a more accurate upper bound when estimating row count of index
	// range scan under inner side of index join.
	Fix44855 uint64 = 44855
	// Fix45132 controls whether to use access range row count to determine access path on the Skyline pruning.
	Fix45132 uint64 = 45132
	// Fix45822 controls whether to eliminate apply operator.
	Fix45822 uint64 = 45822
	// Fix45798 controls whether to cache plans that access generated columns.
	Fix45798 uint64 = 45798
	// Fix46177 controls whether to explore enforced plans for DataSource if it has already found an unenforced plan.
	Fix46177 uint64 = 46177
	// Fix47400 controls whether to allow a rowEst below 1
	// NOTE: This fix control has been deprecated
	Fix47400 uint64 = 47400
	// Fix49736 controls whether to force the optimizer to use plan cache even if there is risky optimization.
	// This fix-control is test-only.
	Fix49736 uint64 = 49736
	// Fix52869 controls whether to disable the limitation that index merge path won't be generated automatically when
	// there exist other single-index access paths that do range scan.
	Fix52869 uint64 = 52869
	// Fix54337 controls whether to apply or not range intersection for index access.
	Fix54337 uint64 = 54337
	// Fix56318 controls whether to do HeavyFunctionOptimize. The HeavyFunctionOptimize eliminate the usage of
	// the function in TopN operators
	Fix56318 uint64 = 56318
)

// GetStr fetches the given key from the fix control map as a string type.
func GetStr(fixControlMap map[uint64]string, key uint64) (value string, exists bool) {
	if fixControlMap == nil {
		return "", false
	}
	rawValue, ok := fixControlMap[key]
	if !ok {
		return "", false
	}
	return rawValue, true
}

Review comment (suggestion):
```suggestion
	// Deprecated: This fix control has been deprecated.
```

This format would help the LSP recognize that this variable is deprecated.

Code after:
	// Fix43817 controls whether to allow optimizer to evaluate non-correlated sub-queries in the optimization phase.
	// If it is not allowed, the optimizer will return a particular error when encountering non-correlated sub-queries.
	// This fix-control is mainly for Index Advisor.
	Fix43817 uint64 = 43817
	// Fix44262 controls whether to allow to use dynamic-mode to access partitioning tables without global-stats (#44262).
	Fix44262 uint64 = 44262
	// Fix44389 controls whether to consider non-point ranges of some CNF item when building ranges.
	Fix44389 uint64 = 44389
	// Fix44830 controls whether to allow to cache Batch/PointGet from some complex scenarios.
	// See #44830 for more details.
	Fix44830 uint64 = 44830
	// Fix44823 controls the maximum number of parameters for a query that can be cached in the Plan Cache.
	Fix44823 uint64 = 44823
	// Fix44855 controls whether to use a more accurate upper bound when estimating row count of index
	// range scan under inner side of index join.
	Fix44855 uint64 = 44855
	// Fix45132 controls whether to use access range row count to determine access path on the Skyline pruning.
	Fix45132 uint64 = 45132
	// Fix45822 controls whether to eliminate apply operator.
	Fix45822 uint64 = 45822
	// Fix45798 controls whether to cache plans that access generated columns.
	Fix45798 uint64 = 45798
	// Fix46177 controls whether to explore enforced plans for DataSource if it has already found an unenforced plan.
	Fix46177 uint64 = 46177
	// Fix47400 controls whether to allow a rowEst below 1
	// Deprecated: This fix control has been deprecated
	Fix47400 uint64 = 47400
	// Fix49736 controls whether to force the optimizer to use plan cache even if there is risky optimization.
	// This fix-control is test-only.
	Fix49736 uint64 = 49736
	// Fix52869 controls whether to disable the limitation that index merge path won't be generated automatically when
	// there exist other single-index access paths that do range scan.
	Fix52869 uint64 = 52869
	// Fix54337 controls whether to apply or not range intersection for index access.
	Fix54337 uint64 = 54337
	// Fix56318 controls whether to do HeavyFunctionOptimize. The HeavyFunctionOptimize eliminate the usage of
	// the function in TopN operators
	Fix56318 uint64 = 56318
)

// GetStr fetches the given key from the fix control map as a string type.
func GetStr(fixControlMap map[uint64]string, key uint64) (value string, exists bool) {
	if fixControlMap == nil {
		return "", false
	}
	rawValue, ok := fixControlMap[key]
	if !ok {
		return "", false
	}
	return rawValue, true
}