tidb icon indicating copy to clipboard operation
tidb copied to clipboard

Complete correctness for system variables

Open spongedu opened this issue 8 years ago • 6 comments

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:

  1. Find out the specific limitation in MySQL system variable reference
  2. Add related validation in method ValidateSetSystemVar in sessionctx/variable/varsutil.go
  3. Add related tests in executor/set_test.go

Notes:

  1. Details about MySQL system variables can be found here
  2. #7196 be be referd as an example.
  3. System variables with ScopeNone scope need not be checked because they can't be changed dynamically.

spongedu avatar Jul 30 '18 15:07 spongedu

@shenli @zz-jason I think this issue can be marked as for-new-contributors ?

spongedu avatar Jul 30 '18 15:07 spongedu

sure!

zz-jason avatar Jul 30 '18 16:07 zz-jason

#7196 deal with:

  • [x] sql_select_limit
  • [x] max_connect_errors
  • [x] table_definition_cache
  • [x] tmp_table_size
  • [x] connect_timeout

spongedu avatar Jul 31 '18 03:07 spongedu

Is there any other system variables need to add? @spongedu

laidahe avatar Jul 31 '18 12:07 laidahe

@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

spongedu avatar Jul 31 '18 13:07 spongedu

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.

morgo avatar Mar 25 '22 15:03 morgo