Complete correctness for system variables
In #7117 we add a framework to validate input when set system variables, but not all system variables are checked in that pr because there are too much of them. We should complete these checks step by step.
What to do:
- Find out the specific limitation in MySQL system variable reference
- Add related validation in method
ValidateSetSystemVarinsessionctx/variable/varsutil.go - Add related tests in
executor/set_test.go
Notes:
- Details about MySQL system variables can be found here
- #7196 be be referd as an example.
- System variables with
ScopeNonescope need not be checked because they can't be changed dynamically.
@shenli @zz-jason I think this issue can be marked as for-new-contributors ?
sure!
#7196 deal with:
- [x] sql_select_limit
- [x] max_connect_errors
- [x] table_definition_cache
- [x] tmp_table_size
- [x] connect_timeout
Is there any other system variables need to add? @spongedu
@laidahe you can take a look at https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html and #7196 , and find the remaining system variables in sessionctx/variable/sysvar.go
I am going close this issue since we have better handling for this in system variables now.
There are still problems such as https://github.com/pingcap/tidb/pull/28842 -- but we usually fix them as discovered, and for new system variables introduced we review the MinValue/MaxValue closely.