> More comments on test cases:
...
> I don’t know the purpose of all these checks which are replicated from
> one test case to another. It looks like some incompetent (to put it
> mildly) person first wrote them, and then everyone else copies that
> stuff whenever he needs to implement a variable test.
>
> What I would expect to see in a sys_var.*_basic test is verifying
> the variable type, and default/min/max values. Instead most tests do
> some acrobatics with I_S and different syntax to access the variable.
I absolutely agree with all these comments and obviously I have cut some corners when copied/pasted/modified it.
What do you think about the following? The variable is global-only, read-only. Check the default, check the read-only-ness, check that global only. For 5.5 too.
# A sys_vars suite test from innodb_adaptive_hash_index_partitions.
> More comments on test cases:
...
> I don’t know the purpose of all these checks which are replicated from
> one test case to another. It looks like some incompetent (to put it
> mildly) person first wrote them, and then everyone else copies that
> stuff whenever he needs to implement a variable test.
>
> What I would expect to see in a sys_var.*_basic test is verifying
> the variable type, and default/min/max values. Instead most tests do
> some acrobatics with I_S and different syntax to access the variable.
I absolutely agree with all these comments and obviously I have cut some corners when copied/ pasted/ modified it.
What do you think about the following? The variable is global-only, read-only. Check the default, check the read-only-ness, check that global only. For 5.5 too.
# A sys_vars suite test from innodb_ adaptive_ hash_index_ partitions.
--source include/ have_innodb. inc
SELECT @@GLOBAL. innodb_ adaptive_ hash_index_ partitions;
--error ER_INCORRECT_ GLOBAL_ LOCAL_VAR innodb_ adaptive_ hash_index_ partitions= 1;
SET @@GLOBAL.
--error ER_INCORRECT_ GLOBAL_ LOCAL_VAR innodb_ adaptive_ hash_index_ partitions;
SELECT @@LOCAL.
--error ER_INCORRECT_ GLOBAL_ LOCAL_VAR innodb_ adaptive_ hash_index_ partitions;
SELECT @@SESSION.