sysvar tidb_read_staleness does not have a type #32763
Labels
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
type/enhancement
The issue or PR belongs to an enhancement.
Enhancement
From code inspection:
tidb/sessionctx/variable/sysvar.go
Lines 307 to 309 in 1268bf0
It looks like the intention is that the value specified should be an integer, but the default for a system variable is
TypeStr
. If we change it toTypeInt
, then we can set a minimum/maximum value and validation will automatically be performed to make sure it actually is an int (with MySQL-compatible error codes automatically returned)This will improve this code:
tidb/sessionctx/variable/varsutil.go
Lines 474 to 484 in 1268bf0
Since the error returned by ParseInt will not be reached.
The text was updated successfully, but these errors were encountered: