mirror of
https://github.com/MariaDB/server.git
synced 2025-05-31 08:42:45 +03:00
"set optimizer_switch to e or d causes invalid memory writes/valgrind warnings": due to prefix support, the argument "e" was overwritten with its full value "engine_condition_pushdown", which caused a buffer overrun. This was wrong usage of find_type(); other wrong usages are fixed here too. Please start reading with the comment of typelib.c.
74 lines
4.4 KiB
Plaintext
74 lines
4.4 KiB
Plaintext
SET @start_global_value = @@global.optimizer_switch;
|
|
SELECT @start_global_value;
|
|
@start_global_value
|
|
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
|
select @@global.optimizer_switch;
|
|
@@global.optimizer_switch
|
|
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
|
select @@session.optimizer_switch;
|
|
@@session.optimizer_switch
|
|
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
|
show global variables like 'optimizer_switch';
|
|
Variable_name Value
|
|
optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
|
show session variables like 'optimizer_switch';
|
|
Variable_name Value
|
|
optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
|
select * from information_schema.global_variables where variable_name='optimizer_switch';
|
|
VARIABLE_NAME VARIABLE_VALUE
|
|
OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
|
select * from information_schema.session_variables where variable_name='optimizer_switch';
|
|
VARIABLE_NAME VARIABLE_VALUE
|
|
OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|
|
set global optimizer_switch=10;
|
|
set session optimizer_switch=5;
|
|
select @@global.optimizer_switch;
|
|
@@global.optimizer_switch
|
|
index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,engine_condition_pushdown=off
|
|
select @@session.optimizer_switch;
|
|
@@session.optimizer_switch
|
|
index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off
|
|
set global optimizer_switch="index_merge_sort_union=on";
|
|
set session optimizer_switch="index_merge=off";
|
|
select @@global.optimizer_switch;
|
|
@@global.optimizer_switch
|
|
index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
|
select @@session.optimizer_switch;
|
|
@@session.optimizer_switch
|
|
index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off
|
|
show global variables like 'optimizer_switch';
|
|
Variable_name Value
|
|
optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
|
show session variables like 'optimizer_switch';
|
|
Variable_name Value
|
|
optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off
|
|
select * from information_schema.global_variables where variable_name='optimizer_switch';
|
|
VARIABLE_NAME VARIABLE_VALUE
|
|
OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
|
select * from information_schema.session_variables where variable_name='optimizer_switch';
|
|
VARIABLE_NAME VARIABLE_VALUE
|
|
OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off
|
|
set session optimizer_switch="default";
|
|
select @@session.optimizer_switch;
|
|
@@session.optimizer_switch
|
|
index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
|
|
set global optimizer_switch=1.1;
|
|
ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
|
|
set global optimizer_switch=1e1;
|
|
ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
|
|
set session optimizer_switch="index_merge";
|
|
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge'
|
|
set session optimizer_switch="foobar";
|
|
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'foobar'
|
|
#
|
|
# Bug#59894 set optimizer_switch to e or d causes invalid
|
|
# memory writes/valgrind warnings
|
|
|
|
set global optimizer_switch = 'd';
|
|
set global optimizer_switch = 'e';
|
|
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'e'
|
|
SET @@global.optimizer_switch = @start_global_value;
|
|
SELECT @@global.optimizer_switch;
|
|
@@global.optimizer_switch
|
|
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
|