mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge.
Fixed a wrong result from mysqld--help.test.
This commit is contained in:
@ -1058,7 +1058,7 @@ old-passwords FALSE
|
|||||||
old-style-user-limits FALSE
|
old-style-user-limits FALSE
|
||||||
optimizer-prune-level 1
|
optimizer-prune-level 1
|
||||||
optimizer-search-depth 62
|
optimizer-search-depth 62
|
||||||
optimizer-selectivity-sampling-limit 5000
|
optimizer-selectivity-sampling-limit 100
|
||||||
optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on
|
optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on
|
||||||
optimizer-use-condition-selectivity 1
|
optimizer-use-condition-selectivity 1
|
||||||
performance-schema FALSE
|
performance-schema FALSE
|
||||||
|
@ -10,6 +10,5 @@ there should be *no* long test name listed below:
|
|||||||
select distinct variable_name as `there should be *no* variables listed below:` from t2
|
select distinct variable_name as `there should be *no* variables listed below:` from t2
|
||||||
left join t1 on variable_name=test_name where test_name is null;
|
left join t1 on variable_name=test_name where test_name is null;
|
||||||
there should be *no* variables listed below:
|
there should be *no* variables listed below:
|
||||||
optimizer_selectivity_sampling_limit
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
drop table t2;
|
drop table t2;
|
||||||
|
@ -0,0 +1,141 @@
|
|||||||
|
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
|
@ -28,6 +28,12 @@ SELECT @@session.optimizer_use_condition_selectivity = 1;
|
|||||||
SELECT @@global.optimizer_use_condition_selectivity;
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
@@global.optimizer_use_condition_selectivity
|
@@global.optimizer_use_condition_selectivity
|
||||||
1
|
1
|
||||||
|
SET @@global.optimizer_use_condition_selectivity = 0;
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Truncated incorrect optimizer_use_condition_selectiv value: '0'
|
||||||
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
|
@@global.optimizer_use_condition_selectivity
|
||||||
|
1
|
||||||
SET @@global.optimizer_use_condition_selectivity = 1;
|
SET @@global.optimizer_use_condition_selectivity = 1;
|
||||||
SELECT @@global.optimizer_use_condition_selectivity;
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
@@global.optimizer_use_condition_selectivity
|
@@global.optimizer_use_condition_selectivity
|
||||||
@ -44,10 +50,26 @@ SET @@global.optimizer_use_condition_selectivity = 4;
|
|||||||
SELECT @@global.optimizer_use_condition_selectivity;
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
@@global.optimizer_use_condition_selectivity
|
@@global.optimizer_use_condition_selectivity
|
||||||
4
|
4
|
||||||
|
SET @@global.optimizer_use_condition_selectivity = 5;
|
||||||
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
|
@@global.optimizer_use_condition_selectivity
|
||||||
|
5
|
||||||
|
SET @@global.optimizer_use_condition_selectivity = 6;
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Truncated incorrect optimizer_use_condition_selectiv value: '6'
|
||||||
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
|
@@global.optimizer_use_condition_selectivity
|
||||||
|
5
|
||||||
'#--------------------FN_DYNVARS_115_04-------------------------#'
|
'#--------------------FN_DYNVARS_115_04-------------------------#'
|
||||||
SELECT @@session.optimizer_use_condition_selectivity;
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
@@session.optimizer_use_condition_selectivity
|
@@session.optimizer_use_condition_selectivity
|
||||||
1
|
1
|
||||||
|
SET @@session.optimizer_use_condition_selectivity = 0;
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Truncated incorrect optimizer_use_condition_selectiv value: '0'
|
||||||
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
|
@@session.optimizer_use_condition_selectivity
|
||||||
|
1
|
||||||
SET @@session.optimizer_use_condition_selectivity = 1;
|
SET @@session.optimizer_use_condition_selectivity = 1;
|
||||||
SELECT @@session.optimizer_use_condition_selectivity;
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
@@session.optimizer_use_condition_selectivity
|
@@session.optimizer_use_condition_selectivity
|
||||||
@ -64,6 +86,16 @@ SET @@session.optimizer_use_condition_selectivity = 4;
|
|||||||
SELECT @@session.optimizer_use_condition_selectivity;
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
@@session.optimizer_use_condition_selectivity
|
@@session.optimizer_use_condition_selectivity
|
||||||
4
|
4
|
||||||
|
SET @@session.optimizer_use_condition_selectivity = 5;
|
||||||
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
|
@@session.optimizer_use_condition_selectivity
|
||||||
|
5
|
||||||
|
SET @@session.optimizer_use_condition_selectivity = 6;
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Truncated incorrect optimizer_use_condition_selectiv value: '6'
|
||||||
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
|
@@session.optimizer_use_condition_selectivity
|
||||||
|
5
|
||||||
'#------------------FN_DYNVARS_115_05-----------------------#'
|
'#------------------FN_DYNVARS_115_05-----------------------#'
|
||||||
SET @@global.optimizer_use_condition_selectivity = ON;
|
SET @@global.optimizer_use_condition_selectivity = ON;
|
||||||
ERROR 42000: Incorrect argument type to variable 'optimizer_use_condition_selectivity'
|
ERROR 42000: Incorrect argument type to variable 'optimizer_use_condition_selectivity'
|
||||||
|
@ -0,0 +1,154 @@
|
|||||||
|
|
||||||
|
--source include/load_sysvars.inc
|
||||||
|
|
||||||
|
#################################################################
|
||||||
|
# START OF optimizer_selectivity_sampling_limit TESTS #
|
||||||
|
#################################################################
|
||||||
|
|
||||||
|
|
||||||
|
#############################################################
|
||||||
|
# Save initial value #
|
||||||
|
#############################################################
|
||||||
|
|
||||||
|
SET @start_global_value = @@global.optimizer_selectivity_sampling_limit;
|
||||||
|
SELECT @start_global_value;
|
||||||
|
SET @start_session_value = @@session.optimizer_selectivity_sampling_limit;
|
||||||
|
SELECT @start_session_value;
|
||||||
|
|
||||||
|
|
||||||
|
--echo '#--------------------FN_DYNVARS_115_01-------------------------#'
|
||||||
|
#########################################################################
|
||||||
|
# Display the DEFAULT value of optimizer_selectivity_sampling_limit #
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = DEFAULT;
|
||||||
|
SELECT @@global.optimizer_selectivity_sampling_limit;
|
||||||
|
|
||||||
|
SET @@session.optimizer_selectivity_sampling_limit = DEFAULT;
|
||||||
|
SELECT @@session.optimizer_selectivity_sampling_limit;
|
||||||
|
|
||||||
|
|
||||||
|
--echo '#--------------------FN_DYNVARS_115_02-------------------------#'
|
||||||
|
#########################################################################
|
||||||
|
# Check the DEFAULT value of optimizer_selectivity_sampling_limit #
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = DEFAULT;
|
||||||
|
SELECT @@global.optimizer_selectivity_sampling_limit = 100;
|
||||||
|
|
||||||
|
SET @@session.optimizer_selectivity_sampling_limit = DEFAULT;
|
||||||
|
SELECT @@session.optimizer_selectivity_sampling_limit = 100;
|
||||||
|
|
||||||
|
|
||||||
|
--echo '#--------------------FN_DYNVARS_115_03-------------------------#'
|
||||||
|
#############################################################################################
|
||||||
|
# Change the value of optimizer_selectivity_sampling_limit to a valid value for GLOBAL Scope #
|
||||||
|
#############################################################################################
|
||||||
|
|
||||||
|
SELECT @@global.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = 9;
|
||||||
|
SELECT @@global.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = 10;
|
||||||
|
SELECT @@global.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = 11;
|
||||||
|
SELECT @@global.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = 7777;
|
||||||
|
SELECT @@global.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = 4294967294;
|
||||||
|
SELECT @@global.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = 4294967295;
|
||||||
|
SELECT @@global.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = 4294967296;
|
||||||
|
SELECT @@global.optimizer_selectivity_sampling_limit;
|
||||||
|
|
||||||
|
|
||||||
|
--echo '#--------------------FN_DYNVARS_115_04-------------------------#'
|
||||||
|
#############################################################################################
|
||||||
|
# Change the value of optimizer_selectivity_sampling_limit to a valid value for SESSION Scope#
|
||||||
|
#############################################################################################
|
||||||
|
|
||||||
|
SELECT @@session.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@session.optimizer_selectivity_sampling_limit = 9;
|
||||||
|
SELECT @@session.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@session.optimizer_selectivity_sampling_limit = 10;
|
||||||
|
SELECT @@session.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@session.optimizer_selectivity_sampling_limit = 11;
|
||||||
|
SELECT @@session.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@session.optimizer_selectivity_sampling_limit = 7777;
|
||||||
|
SELECT @@session.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@session.optimizer_selectivity_sampling_limit = 4294967294;
|
||||||
|
SELECT @@session.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@session.optimizer_selectivity_sampling_limit = 4294967295;
|
||||||
|
SELECT @@session.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@session.optimizer_selectivity_sampling_limit = 4294967296;
|
||||||
|
SELECT @@session.optimizer_selectivity_sampling_limit;
|
||||||
|
|
||||||
|
|
||||||
|
--echo '#------------------FN_DYNVARS_115_05-----------------------#'
|
||||||
|
###############################################################################
|
||||||
|
# Change the value of optimizer_selectivity_sampling_limit to an invalid value #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
--Error ER_WRONG_TYPE_FOR_VAR
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = ON;
|
||||||
|
--Error ER_WRONG_TYPE_FOR_VAR
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = OFF;
|
||||||
|
--Error ER_WRONG_TYPE_FOR_VAR
|
||||||
|
SET @@session.optimizer_selectivity_sampling_limit = 65530.34;
|
||||||
|
--Error ER_WRONG_TYPE_FOR_VAR
|
||||||
|
SET @@session.optimizer_selectivity_sampling_limit = test;
|
||||||
|
|
||||||
|
--echo '#------------------FN_DYNVARS_115_06-----------------------#'
|
||||||
|
####################################################################
|
||||||
|
# Check if the value in GLOBAL Table matches value in variable #
|
||||||
|
####################################################################
|
||||||
|
|
||||||
|
|
||||||
|
SELECT @@global.optimizer_selectivity_sampling_limit = VARIABLE_VALUE
|
||||||
|
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||||
|
WHERE VARIABLE_NAME='optimizer_selectivity_sampling_limit';
|
||||||
|
|
||||||
|
--echo '#------------------FN_DYNVARS_115_07-----------------------#'
|
||||||
|
####################################################################
|
||||||
|
# Check if the value in SESSION Table matches value in variable #
|
||||||
|
####################################################################
|
||||||
|
|
||||||
|
SELECT @@session.optimizer_selectivity_sampling_limit = VARIABLE_VALUE
|
||||||
|
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
||||||
|
WHERE VARIABLE_NAME='optimizer_selectivity_sampling_limit';
|
||||||
|
|
||||||
|
|
||||||
|
--echo '#---------------------FN_DYNVARS_115_08----------------------#'
|
||||||
|
###############################################################################
|
||||||
|
# Check if global and session variable are independent of each other #
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
SET @@optimizer_selectivity_sampling_limit = 10;
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = 30;
|
||||||
|
SELECT @@optimizer_selectivity_sampling_limit = @@global.optimizer_selectivity_sampling_limit;
|
||||||
|
|
||||||
|
|
||||||
|
--echo '#---------------------FN_DYNVARS_115_09----------------------#'
|
||||||
|
###############################################################################
|
||||||
|
# Check if accessing variable with SESSION,LOCAL and without SCOPE points #
|
||||||
|
# to same session variable #
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
SET @@optimizer_selectivity_sampling_limit = 20;
|
||||||
|
SELECT @@optimizer_selectivity_sampling_limit = @@local.optimizer_selectivity_sampling_limit;
|
||||||
|
SELECT @@local.optimizer_selectivity_sampling_limit = @@session.optimizer_selectivity_sampling_limit;
|
||||||
|
|
||||||
|
|
||||||
|
####################################
|
||||||
|
# Restore initial value #
|
||||||
|
####################################
|
||||||
|
|
||||||
|
SET @@global.optimizer_selectivity_sampling_limit = @start_global_value;
|
||||||
|
SELECT @@global.optimizer_selectivity_sampling_limit;
|
||||||
|
SET @@session.optimizer_selectivity_sampling_limit = @start_session_value;
|
||||||
|
SELECT @@session.optimizer_selectivity_sampling_limit;
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# END OF optimizer_selectivity_sampling_limit TESTS #
|
||||||
|
########################################################################
|
||||||
|
|
@ -45,6 +45,8 @@ SELECT @@session.optimizer_use_condition_selectivity = 1;
|
|||||||
# Change the value of optimizer_use_condition_selectivity to a valid value for GLOBAL Scope #
|
# Change the value of optimizer_use_condition_selectivity to a valid value for GLOBAL Scope #
|
||||||
#############################################################################################
|
#############################################################################################
|
||||||
|
|
||||||
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
|
SET @@global.optimizer_use_condition_selectivity = 0;
|
||||||
SELECT @@global.optimizer_use_condition_selectivity;
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
SET @@global.optimizer_use_condition_selectivity = 1;
|
SET @@global.optimizer_use_condition_selectivity = 1;
|
||||||
SELECT @@global.optimizer_use_condition_selectivity;
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
@ -54,6 +56,10 @@ SET @@global.optimizer_use_condition_selectivity = 3;
|
|||||||
SELECT @@global.optimizer_use_condition_selectivity;
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
SET @@global.optimizer_use_condition_selectivity = 4;
|
SET @@global.optimizer_use_condition_selectivity = 4;
|
||||||
SELECT @@global.optimizer_use_condition_selectivity;
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
|
SET @@global.optimizer_use_condition_selectivity = 5;
|
||||||
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
|
SET @@global.optimizer_use_condition_selectivity = 6;
|
||||||
|
SELECT @@global.optimizer_use_condition_selectivity;
|
||||||
|
|
||||||
|
|
||||||
--echo '#--------------------FN_DYNVARS_115_04-------------------------#'
|
--echo '#--------------------FN_DYNVARS_115_04-------------------------#'
|
||||||
@ -61,6 +67,8 @@ SELECT @@global.optimizer_use_condition_selectivity;
|
|||||||
# Change the value of optimizer_use_condition_selectivity to a valid value for SESSION Scope#
|
# Change the value of optimizer_use_condition_selectivity to a valid value for SESSION Scope#
|
||||||
#############################################################################################
|
#############################################################################################
|
||||||
|
|
||||||
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
|
SET @@session.optimizer_use_condition_selectivity = 0;
|
||||||
SELECT @@session.optimizer_use_condition_selectivity;
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
SET @@session.optimizer_use_condition_selectivity = 1;
|
SET @@session.optimizer_use_condition_selectivity = 1;
|
||||||
SELECT @@session.optimizer_use_condition_selectivity;
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
@ -70,6 +78,10 @@ SET @@session.optimizer_use_condition_selectivity = 3;
|
|||||||
SELECT @@session.optimizer_use_condition_selectivity;
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
SET @@session.optimizer_use_condition_selectivity = 4;
|
SET @@session.optimizer_use_condition_selectivity = 4;
|
||||||
SELECT @@session.optimizer_use_condition_selectivity;
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
|
SET @@session.optimizer_use_condition_selectivity = 5;
|
||||||
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
|
SET @@session.optimizer_use_condition_selectivity = 6;
|
||||||
|
SELECT @@session.optimizer_use_condition_selectivity;
|
||||||
|
|
||||||
|
|
||||||
--echo '#------------------FN_DYNVARS_115_05-----------------------#'
|
--echo '#------------------FN_DYNVARS_115_05-----------------------#'
|
||||||
|
@ -1052,7 +1052,7 @@ void store_key_image_to_rec(Field *field, uchar *ptr, uint len);
|
|||||||
extern String null_string;
|
extern String null_string;
|
||||||
|
|
||||||
/* check this number of rows (default value) */
|
/* check this number of rows (default value) */
|
||||||
#define SELECTIVITY_SAMPLING_LIMIT 5000
|
#define SELECTIVITY_SAMPLING_LIMIT 100
|
||||||
/* but no more then this part of table (10%) */
|
/* but no more then this part of table (10%) */
|
||||||
#define SELECTIVITY_SAMPLING_SHARE 0.10
|
#define SELECTIVITY_SAMPLING_SHARE 0.10
|
||||||
/* do not check if we are going check less then this number of records */
|
/* do not check if we are going check less then this number of records */
|
||||||
|
Reference in New Issue
Block a user