> === added file 'Percona-Server/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_partitions_basic.test'
> --- Percona-Server/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_partitions_basic.test 1970-01-01 00:00:00 +0000
> +++ Percona-Server/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_partitions_basic.test 2013-08-26 13:16:30 +0000
> @@ -0,0 +1,32 @@
> +# A sys_vars suite test from innodb_adaptive_hash_index_partitions. Adapted from
> +# innodb_buffer_pool_instances_basic.test.
> +
> +--source include/have_innodb.inc
> +
> +SELECT COUNT(@@GLOBAL.innodb_adaptive_hash_index_partitions) AS should_be_1;
> +
I’m not sure what the above check is supposed to verify. Apparently that
the variable exists and is not NULL. But if that’s the case, the test
would fail anyway.
Just checking the default value would make sense. But it’s not checked
anywhere in the test.
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.
Please also consider backporting it to 5.5 as I mentioned in the 5.5 MP.
More comments on test cases:
> === added file 'Percona- Server/ mysql-test/ suite/sys_ vars/t/ innodb_ adaptive_ hash_index_ partitions_ basic.test' Server/ mysql-test/ suite/sys_ vars/t/ innodb_ adaptive_ hash_index_ partitions_ basic.test 1970-01-01 00:00:00 +0000 Server/ mysql-test/ suite/sys_ vars/t/ innodb_ adaptive_ hash_index_ partitions_ basic.test 2013-08-26 13:16:30 +0000 adaptive_ hash_index_ partitions. Adapted from buffer_ pool_instances_ basic.test. have_innodb. inc @GLOBAL. innodb_ adaptive_ hash_index_ partitions) AS should_be_1;
> --- Percona-
> +++ Percona-
> @@ -0,0 +1,32 @@
> +# A sys_vars suite test from innodb_
> +# innodb_
> +
> +--source include/
> +
> +SELECT COUNT(@
> +
I’m not sure what the above check is supposed to verify. Apparently that
the variable exists and is not NULL. But if that’s the case, the test
would fail anyway.
Just checking the default value would make sense. But it’s not checked
anywhere in the test.
> +--error ER_INCORRECT_ GLOBAL_ LOCAL_VAR innodb_ adaptive_ hash_index_ partitions= 1; @GLOBAL. innodb_ adaptive_ hash_index_ partitions) AS should_be_1;
> +SET @@GLOBAL.
> +
> +SELECT COUNT(@
> +
The same check again?
> +SELECT COUNT(VARIABLE_ VALUE) AS should_be_1 SCHEMA. GLOBAL_ VARIABLES NAME='innodb_ adaptive_ hash_index_ partitions' ; innodb_ adaptive_ hash_index_ partitions = VARIABLE_VALUE AS should_be_1 SCHEMA. GLOBAL_ VARIABLES NAME='innodb_ adaptive_ hash_index_ partitions' ; adaptive_ hash_index_ partitions = @@GLOBAL. innodb_ adaptive_ hash_index_ partitions AS should_be_1; @innodb_ adaptive_ hash_index_ partitions) AS should_be_1; GLOBAL_ LOCAL_VAR @LOCAL. innodb_ adaptive_ hash_index_ partitions) ; GLOBAL_ LOCAL_VAR @SESSION. innodb_ adaptive_ hash_index_ partitions) ; adaptive_ hash_index_ partitions = @@SESSION. innodb_ adaptive_ hash_index_ partitions;
> +FROM INFORMATION_
> +WHERE VARIABLE_
> +
> +SELECT @@GLOBAL.
> +FROM INFORMATION_
> +WHERE VARIABLE_
> +
> +SELECT @@innodb_
> +
> +SELECT COUNT(@
> +
> +--Error ER_INCORRECT_
> +SELECT COUNT(@
> +
> +--Error ER_INCORRECT_
> +SELECT COUNT(@
> +
> +--Error ER_BAD_FIELD_ERROR
> +SELECT innodb_
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.
Please also consider backporting it to 5.5 as I mentioned in the 5.5 MP.