mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#28234 - global/session scope - documentation vs implementation
Several system variables did not behave like system variables should do. When trying to SET them or use them in SELECT, they were reported as "unknown system variable". But they appeared in SHOW VARIABLES. This has been fixed by removing the "fixed_vars" array of variables and integrating the variables into the normal system variables chain. All of these variables do now behave as read-only global-only variables. Trying to SET them tells they are read-only, trying to SELECT the session value tells they are global only. Selecting the global value works. It delivers the same value as SHOW VARIABLES.
This commit is contained in:
@ -1011,3 +1011,342 @@ SET GLOBAL log_output = 0;
|
||||
ERROR 42000: Variable 'log_output' can't be set to the value of '0'
|
||||
|
||||
# -- End of Bug#34820.
|
||||
|
||||
#
|
||||
SHOW VARIABLES like 'ft_max_word_len';
|
||||
Variable_name Value
|
||||
ft_max_word_len 84
|
||||
SELECT @@session.ft_max_word_len;
|
||||
ERROR HY000: Variable 'ft_max_word_len' is a GLOBAL variable
|
||||
SELECT @@global.ft_max_word_len;
|
||||
@@global.ft_max_word_len
|
||||
84
|
||||
SET @@session.ft_max_word_len= 7;
|
||||
ERROR HY000: Variable 'ft_max_word_len' is a read only variable
|
||||
SET @@global.ft_max_word_len= 7;
|
||||
ERROR HY000: Variable 'ft_max_word_len' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'ft_min_word_len';
|
||||
Variable_name Value
|
||||
ft_min_word_len 4
|
||||
SELECT @@session.ft_min_word_len;
|
||||
ERROR HY000: Variable 'ft_min_word_len' is a GLOBAL variable
|
||||
SELECT @@global.ft_min_word_len;
|
||||
@@global.ft_min_word_len
|
||||
4
|
||||
SET @@session.ft_min_word_len= 7;
|
||||
ERROR HY000: Variable 'ft_min_word_len' is a read only variable
|
||||
SET @@global.ft_min_word_len= 7;
|
||||
ERROR HY000: Variable 'ft_min_word_len' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'ft_query_expansion_limit';
|
||||
Variable_name Value
|
||||
ft_query_expansion_limit 20
|
||||
SELECT @@session.ft_query_expansion_limit;
|
||||
ERROR HY000: Variable 'ft_query_expansion_limit' is a GLOBAL variable
|
||||
SELECT @@global.ft_query_expansion_limit;
|
||||
@@global.ft_query_expansion_limit
|
||||
20
|
||||
SET @@session.ft_query_expansion_limit= 7;
|
||||
ERROR HY000: Variable 'ft_query_expansion_limit' is a read only variable
|
||||
SET @@global.ft_query_expansion_limit= 7;
|
||||
ERROR HY000: Variable 'ft_query_expansion_limit' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'ft_stopword_file';
|
||||
Variable_name Value
|
||||
ft_stopword_file (built-in)
|
||||
SELECT @@session.ft_stopword_file;
|
||||
ERROR HY000: Variable 'ft_stopword_file' is a GLOBAL variable
|
||||
SELECT @@global.ft_stopword_file;
|
||||
@@global.ft_stopword_file
|
||||
(built-in)
|
||||
SET @@session.ft_stopword_file= 'x';
|
||||
ERROR HY000: Variable 'ft_stopword_file' is a read only variable
|
||||
SET @@global.ft_stopword_file= 'x';
|
||||
ERROR HY000: Variable 'ft_stopword_file' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'back_log';
|
||||
Variable_name Value
|
||||
back_log 50
|
||||
SELECT @@session.back_log;
|
||||
ERROR HY000: Variable 'back_log' is a GLOBAL variable
|
||||
SELECT @@global.back_log;
|
||||
@@global.back_log
|
||||
50
|
||||
SET @@session.back_log= 7;
|
||||
ERROR HY000: Variable 'back_log' is a read only variable
|
||||
SET @@global.back_log= 7;
|
||||
ERROR HY000: Variable 'back_log' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'large_files_support';
|
||||
Variable_name Value
|
||||
large_files_support #
|
||||
SELECT @@session.large_files_support;
|
||||
ERROR HY000: Variable 'large_files_support' is a GLOBAL variable
|
||||
SELECT @@global.large_files_support;
|
||||
@@global.large_files_support
|
||||
#
|
||||
SET @@session.large_files_support= true;
|
||||
ERROR HY000: Variable 'large_files_support' is a read only variable
|
||||
SET @@global.large_files_support= true;
|
||||
ERROR HY000: Variable 'large_files_support' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'character_sets_dir';
|
||||
Variable_name Value
|
||||
character_sets_dir #
|
||||
SELECT @@session.character_sets_dir;
|
||||
ERROR HY000: Variable 'character_sets_dir' is a GLOBAL variable
|
||||
SELECT @@global.character_sets_dir;
|
||||
@@global.character_sets_dir
|
||||
#
|
||||
SET @@session.character_sets_dir= 'x';
|
||||
ERROR HY000: Variable 'character_sets_dir' is a read only variable
|
||||
SET @@global.character_sets_dir= 'x';
|
||||
ERROR HY000: Variable 'character_sets_dir' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'init_file';
|
||||
Variable_name Value
|
||||
init_file #
|
||||
SELECT @@session.init_file;
|
||||
ERROR HY000: Variable 'init_file' is a GLOBAL variable
|
||||
SELECT @@global.init_file;
|
||||
@@global.init_file
|
||||
#
|
||||
SET @@session.init_file= 'x';
|
||||
ERROR HY000: Variable 'init_file' is a read only variable
|
||||
SET @@global.init_file= 'x';
|
||||
ERROR HY000: Variable 'init_file' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'language';
|
||||
Variable_name Value
|
||||
language #
|
||||
SELECT @@session.language;
|
||||
ERROR HY000: Variable 'language' is a GLOBAL variable
|
||||
SELECT @@global.language;
|
||||
@@global.language
|
||||
#
|
||||
SET @@session.language= 'x';
|
||||
ERROR HY000: Variable 'language' is a read only variable
|
||||
SET @@global.language= 'x';
|
||||
ERROR HY000: Variable 'language' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'large_page_size';
|
||||
Variable_name Value
|
||||
large_page_size #
|
||||
SELECT @@session.large_page_size;
|
||||
ERROR HY000: Variable 'large_page_size' is a GLOBAL variable
|
||||
SELECT @@global.large_page_size;
|
||||
@@global.large_page_size
|
||||
#
|
||||
SET @@session.large_page_size= 7;
|
||||
ERROR HY000: Variable 'large_page_size' is a read only variable
|
||||
SET @@global.large_page_size= 7;
|
||||
ERROR HY000: Variable 'large_page_size' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'large_pages';
|
||||
Variable_name Value
|
||||
large_pages #
|
||||
SELECT @@session.large_pages;
|
||||
ERROR HY000: Variable 'large_pages' is a GLOBAL variable
|
||||
SELECT @@global.large_pages;
|
||||
@@global.large_pages
|
||||
#
|
||||
SET @@session.large_pages= true;
|
||||
ERROR HY000: Variable 'large_pages' is a read only variable
|
||||
SET @@global.large_pages= true;
|
||||
ERROR HY000: Variable 'large_pages' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'log_bin';
|
||||
Variable_name Value
|
||||
log_bin OFF
|
||||
SELECT @@session.log_bin;
|
||||
ERROR HY000: Variable 'log_bin' is a GLOBAL variable
|
||||
SELECT @@global.log_bin;
|
||||
@@global.log_bin
|
||||
0
|
||||
SET @@session.log_bin= true;
|
||||
ERROR HY000: Variable 'log_bin' is a read only variable
|
||||
SET @@global.log_bin= true;
|
||||
ERROR HY000: Variable 'log_bin' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'log_error';
|
||||
Variable_name Value
|
||||
log_error #
|
||||
SELECT @@session.log_error;
|
||||
ERROR HY000: Variable 'log_error' is a GLOBAL variable
|
||||
SELECT @@global.log_error;
|
||||
@@global.log_error
|
||||
#
|
||||
SET @@session.log_error= 'x';
|
||||
ERROR HY000: Variable 'log_error' is a read only variable
|
||||
SET @@global.log_error= 'x';
|
||||
ERROR HY000: Variable 'log_error' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'lower_case_file_system';
|
||||
Variable_name Value
|
||||
lower_case_file_system #
|
||||
SELECT @@session.lower_case_file_system;
|
||||
ERROR HY000: Variable 'lower_case_file_system' is a GLOBAL variable
|
||||
SELECT @@global.lower_case_file_system;
|
||||
@@global.lower_case_file_system
|
||||
#
|
||||
SET @@session.lower_case_file_system= true;
|
||||
ERROR HY000: Variable 'lower_case_file_system' is a read only variable
|
||||
SET @@global.lower_case_file_system= true;
|
||||
ERROR HY000: Variable 'lower_case_file_system' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'lower_case_table_names';
|
||||
Variable_name Value
|
||||
lower_case_table_names #
|
||||
SELECT @@session.lower_case_table_names;
|
||||
ERROR HY000: Variable 'lower_case_table_names' is a GLOBAL variable
|
||||
SELECT @@global.lower_case_table_names;
|
||||
@@global.lower_case_table_names
|
||||
#
|
||||
SET @@session.lower_case_table_names= 7;
|
||||
ERROR HY000: Variable 'lower_case_table_names' is a read only variable
|
||||
SET @@global.lower_case_table_names= 7;
|
||||
ERROR HY000: Variable 'lower_case_table_names' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'myisam_recover_options';
|
||||
Variable_name Value
|
||||
myisam_recover_options OFF
|
||||
SELECT @@session.myisam_recover_options;
|
||||
ERROR HY000: Variable 'myisam_recover_options' is a GLOBAL variable
|
||||
SELECT @@global.myisam_recover_options;
|
||||
@@global.myisam_recover_options
|
||||
OFF
|
||||
SET @@session.myisam_recover_options= 'x';
|
||||
ERROR HY000: Variable 'myisam_recover_options' is a read only variable
|
||||
SET @@global.myisam_recover_options= 'x';
|
||||
ERROR HY000: Variable 'myisam_recover_options' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'open_files_limit';
|
||||
Variable_name Value
|
||||
open_files_limit #
|
||||
SELECT @@session.open_files_limit;
|
||||
ERROR HY000: Variable 'open_files_limit' is a GLOBAL variable
|
||||
SELECT @@global.open_files_limit;
|
||||
@@global.open_files_limit
|
||||
#
|
||||
SET @@session.open_files_limit= 7;
|
||||
ERROR HY000: Variable 'open_files_limit' is a read only variable
|
||||
SET @@global.open_files_limit= 7;
|
||||
ERROR HY000: Variable 'open_files_limit' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'pid_file';
|
||||
Variable_name Value
|
||||
pid_file #
|
||||
SELECT @@session.pid_file;
|
||||
ERROR HY000: Variable 'pid_file' is a GLOBAL variable
|
||||
SELECT @@global.pid_file;
|
||||
@@global.pid_file
|
||||
#
|
||||
SET @@session.pid_file= 'x';
|
||||
ERROR HY000: Variable 'pid_file' is a read only variable
|
||||
SET @@global.pid_file= 'x';
|
||||
ERROR HY000: Variable 'pid_file' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'plugin_dir';
|
||||
Variable_name Value
|
||||
plugin_dir #
|
||||
SELECT @@session.plugin_dir;
|
||||
ERROR HY000: Variable 'plugin_dir' is a GLOBAL variable
|
||||
SELECT @@global.plugin_dir;
|
||||
@@global.plugin_dir
|
||||
#
|
||||
SET @@session.plugin_dir= 'x';
|
||||
ERROR HY000: Variable 'plugin_dir' is a read only variable
|
||||
SET @@global.plugin_dir= 'x';
|
||||
ERROR HY000: Variable 'plugin_dir' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'port';
|
||||
Variable_name Value
|
||||
port #
|
||||
SELECT @@session.port;
|
||||
ERROR HY000: Variable 'port' is a GLOBAL variable
|
||||
SELECT @@global.port;
|
||||
@@global.port
|
||||
#
|
||||
SET @@session.port= 7;
|
||||
ERROR HY000: Variable 'port' is a read only variable
|
||||
SET @@global.port= 7;
|
||||
ERROR HY000: Variable 'port' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'protocol_version';
|
||||
Variable_name Value
|
||||
protocol_version 10
|
||||
SELECT @@session.protocol_version;
|
||||
ERROR HY000: Variable 'protocol_version' is a GLOBAL variable
|
||||
SELECT @@global.protocol_version;
|
||||
@@global.protocol_version
|
||||
10
|
||||
SET @@session.protocol_version= 7;
|
||||
ERROR HY000: Variable 'protocol_version' is a read only variable
|
||||
SET @@global.protocol_version= 7;
|
||||
ERROR HY000: Variable 'protocol_version' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'skip_external_locking';
|
||||
Variable_name Value
|
||||
skip_external_locking ON
|
||||
SELECT @@session.skip_external_locking;
|
||||
ERROR HY000: Variable 'skip_external_locking' is a GLOBAL variable
|
||||
SELECT @@global.skip_external_locking;
|
||||
@@global.skip_external_locking
|
||||
1
|
||||
SET @@session.skip_external_locking= true;
|
||||
ERROR HY000: Variable 'skip_external_locking' is a read only variable
|
||||
SET @@global.skip_external_locking= true;
|
||||
ERROR HY000: Variable 'skip_external_locking' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'skip_networking';
|
||||
Variable_name Value
|
||||
skip_networking OFF
|
||||
SELECT @@session.skip_networking;
|
||||
ERROR HY000: Variable 'skip_networking' is a GLOBAL variable
|
||||
SELECT @@global.skip_networking;
|
||||
@@global.skip_networking
|
||||
0
|
||||
SET @@session.skip_networking= true;
|
||||
ERROR HY000: Variable 'skip_networking' is a read only variable
|
||||
SET @@global.skip_networking= true;
|
||||
ERROR HY000: Variable 'skip_networking' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'skip_show_database';
|
||||
Variable_name Value
|
||||
skip_show_database OFF
|
||||
SELECT @@session.skip_show_database;
|
||||
ERROR HY000: Variable 'skip_show_database' is a GLOBAL variable
|
||||
SELECT @@global.skip_show_database;
|
||||
@@global.skip_show_database
|
||||
0
|
||||
SET @@session.skip_show_database= true;
|
||||
ERROR HY000: Variable 'skip_show_database' is a read only variable
|
||||
SET @@global.skip_show_database= true;
|
||||
ERROR HY000: Variable 'skip_show_database' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'socket';
|
||||
Variable_name Value
|
||||
socket #
|
||||
SELECT @@session.socket;
|
||||
ERROR HY000: Variable 'socket' is a GLOBAL variable
|
||||
SELECT @@global.socket;
|
||||
@@global.socket
|
||||
#
|
||||
SET @@session.socket= 'x';
|
||||
ERROR HY000: Variable 'socket' is a read only variable
|
||||
SET @@global.socket= 'x';
|
||||
ERROR HY000: Variable 'socket' is a read only variable
|
||||
#
|
||||
SHOW VARIABLES like 'thread_stack';
|
||||
Variable_name Value
|
||||
thread_stack #
|
||||
SELECT @@session.thread_stack;
|
||||
ERROR HY000: Variable 'thread_stack' is a GLOBAL variable
|
||||
SELECT @@global.thread_stack;
|
||||
@@global.thread_stack
|
||||
#
|
||||
SET @@session.thread_stack= 7;
|
||||
ERROR HY000: Variable 'thread_stack' is a read only variable
|
||||
SET @@global.thread_stack= 7;
|
||||
ERROR HY000: Variable 'thread_stack' is a read only variable
|
||||
|
Reference in New Issue
Block a user