SET @start_global_value = @@global.optimizer_selectivity_sampling_limit;
SELECT @start_global_value;
@start_global_value
100
SET @start_session_value = @@session.optimizer_selectivity_sampling_limit;
SELECT @start_session_value;
@start_session_value
100
'#--------------------FN_DYNVARS_115_01-------------------------#'
SET @@global.optimizer_selectivity_sampling_limit = DEFAULT;
SELECT @@global.optimizer_selectivity_sampling_limit;
@@global.optimizer_selectivity_sampling_limit
100
SET @@session.optimizer_selectivity_sampling_limit = DEFAULT;
SELECT @@session.optimizer_selectivity_sampling_limit;
@@session.optimizer_selectivity_sampling_limit
100
'#--------------------FN_DYNVARS_115_02-------------------------#'
SET @@global.optimizer_selectivity_sampling_limit = DEFAULT;
SELECT @@global.optimizer_selectivity_sampling_limit = 100;
@@global.optimizer_selectivity_sampling_limit = 100
1
SET @@session.optimizer_selectivity_sampling_limit = DEFAULT;
SELECT @@session.optimizer_selectivity_sampling_limit = 100;
@@session.optimizer_selectivity_sampling_limit = 100
1
'#--------------------FN_DYNVARS_115_03-------------------------#'
SELECT @@global.optimizer_selectivity_sampling_limit;
@@global.optimizer_selectivity_sampling_limit
100
SET @@global.optimizer_selectivity_sampling_limit = 9;
Warnings:
Warning	1292	Truncated incorrect optimizer_selectivity_sampling_l value: '9'
SELECT @@global.optimizer_selectivity_sampling_limit;
@@global.optimizer_selectivity_sampling_limit
10
SET @@global.optimizer_selectivity_sampling_limit = 10;
SELECT @@global.optimizer_selectivity_sampling_limit;
@@global.optimizer_selectivity_sampling_limit
10
SET @@global.optimizer_selectivity_sampling_limit = 11;
SELECT @@global.optimizer_selectivity_sampling_limit;
@@global.optimizer_selectivity_sampling_limit
11
SET @@global.optimizer_selectivity_sampling_limit = 7777;
SELECT @@global.optimizer_selectivity_sampling_limit;
@@global.optimizer_selectivity_sampling_limit
7777
SET @@global.optimizer_selectivity_sampling_limit = 4294967294;
SELECT @@global.optimizer_selectivity_sampling_limit;
@@global.optimizer_selectivity_sampling_limit
4294967294
SET @@global.optimizer_selectivity_sampling_limit = 4294967295;
SELECT @@global.optimizer_selectivity_sampling_limit;
@@global.optimizer_selectivity_sampling_limit
4294967295
SET @@global.optimizer_selectivity_sampling_limit = 4294967296;
Warnings:
Warning	1292	Truncated incorrect optimizer_selectivity_sampling_l value: '4294967296'
SELECT @@global.optimizer_selectivity_sampling_limit;
@@global.optimizer_selectivity_sampling_limit
4294967295
'#--------------------FN_DYNVARS_115_04-------------------------#'
SELECT @@session.optimizer_selectivity_sampling_limit;
@@session.optimizer_selectivity_sampling_limit
100
SET @@session.optimizer_selectivity_sampling_limit = 9;
Warnings:
Warning	1292	Truncated incorrect optimizer_selectivity_sampling_l value: '9'
SELECT @@session.optimizer_selectivity_sampling_limit;
@@session.optimizer_selectivity_sampling_limit
10
SET @@session.optimizer_selectivity_sampling_limit = 10;
SELECT @@session.optimizer_selectivity_sampling_limit;
@@session.optimizer_selectivity_sampling_limit
10
SET @@session.optimizer_selectivity_sampling_limit = 11;
SELECT @@session.optimizer_selectivity_sampling_limit;
@@session.optimizer_selectivity_sampling_limit
11
SET @@session.optimizer_selectivity_sampling_limit = 7777;
SELECT @@session.optimizer_selectivity_sampling_limit;
@@session.optimizer_selectivity_sampling_limit
7777
SET @@session.optimizer_selectivity_sampling_limit = 4294967294;
SELECT @@session.optimizer_selectivity_sampling_limit;
@@session.optimizer_selectivity_sampling_limit
4294967294
SET @@session.optimizer_selectivity_sampling_limit = 4294967295;
SELECT @@session.optimizer_selectivity_sampling_limit;
@@session.optimizer_selectivity_sampling_limit
4294967295
SET @@session.optimizer_selectivity_sampling_limit = 4294967296;
Warnings:
Warning	1292	Truncated incorrect optimizer_selectivity_sampling_l value: '4294967296'
SELECT @@session.optimizer_selectivity_sampling_limit;
@@session.optimizer_selectivity_sampling_limit
4294967295
'#------------------FN_DYNVARS_115_05-----------------------#'
SET @@global.optimizer_selectivity_sampling_limit = ON;
ERROR 42000: Incorrect argument type to variable 'optimizer_selectivity_sampling_limit'
SET @@global.optimizer_selectivity_sampling_limit = OFF;
ERROR 42000: Incorrect argument type to variable 'optimizer_selectivity_sampling_limit'
SET @@session.optimizer_selectivity_sampling_limit = 65530.34;
ERROR 42000: Incorrect argument type to variable 'optimizer_selectivity_sampling_limit'
SET @@session.optimizer_selectivity_sampling_limit = test;
ERROR 42000: Incorrect argument type to variable 'optimizer_selectivity_sampling_limit'
'#------------------FN_DYNVARS_115_06-----------------------#'
SELECT @@global.optimizer_selectivity_sampling_limit = VARIABLE_VALUE 
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
WHERE VARIABLE_NAME='optimizer_selectivity_sampling_limit';
@@global.optimizer_selectivity_sampling_limit = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_115_07-----------------------#'
SELECT @@session.optimizer_selectivity_sampling_limit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
WHERE VARIABLE_NAME='optimizer_selectivity_sampling_limit';
@@session.optimizer_selectivity_sampling_limit = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_115_08----------------------#'
SET @@optimizer_selectivity_sampling_limit = 10;
SET @@global.optimizer_selectivity_sampling_limit = 30;
SELECT @@optimizer_selectivity_sampling_limit = @@global.optimizer_selectivity_sampling_limit;
@@optimizer_selectivity_sampling_limit = @@global.optimizer_selectivity_sampling_limit
0
'#---------------------FN_DYNVARS_115_09----------------------#'
SET @@optimizer_selectivity_sampling_limit = 20;
SELECT @@optimizer_selectivity_sampling_limit = @@local.optimizer_selectivity_sampling_limit;
@@optimizer_selectivity_sampling_limit = @@local.optimizer_selectivity_sampling_limit
1
SELECT @@local.optimizer_selectivity_sampling_limit = @@session.optimizer_selectivity_sampling_limit;
@@local.optimizer_selectivity_sampling_limit = @@session.optimizer_selectivity_sampling_limit
1
SET @@global.optimizer_selectivity_sampling_limit = @start_global_value;
SELECT @@global.optimizer_selectivity_sampling_limit;
@@global.optimizer_selectivity_sampling_limit
100
SET @@session.optimizer_selectivity_sampling_limit = @start_session_value;
SELECT @@session.optimizer_selectivity_sampling_limit;
@@session.optimizer_selectivity_sampling_limit
100
