Commit f8018a35 authored by Sergei Golubchik's avatar Sergei Golubchik

hide have_sanitizer variable in non-ASAN builds

and change its semantics so that it could in the future
be used for MSAN, UBSAN, and other sanitizer too.
parent d90fa9ad
......@@ -2,7 +2,7 @@
# be overcome. In normal cases one should fix the bug server/test case or in
# the worst case add a (temporary?) suppression in asan.supp or lsan.supp
if (`select @@have_sanitizer <> 'NO'`)
if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer'`)
{
--skip Can't be run with ASan
}
......@@ -49,7 +49,6 @@ select VARIABLE_NAME, VARIABLE_SCOPE, VARIABLE_TYPE, VARIABLE_COMMENT,
where variable_name in (
'have_openssl',
'have_symlink',
'have_sanitizer',
'hostname',
'large_files_support',
'lower_case_file_system',
......
......@@ -4655,7 +4655,6 @@ from information_schema.system_variables
where variable_name in (
'have_openssl',
'have_symlink',
'have_sanitizer',
'hostname',
'large_files_support',
'lower_case_file_system',
......@@ -4681,16 +4680,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HAVE_SANITIZER
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT If the server is compiled with ASan (Address sanitizer) this will be set to YES, otherwise will be set to NO
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HAVE_SYMLINK
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
......
......@@ -5747,7 +5747,6 @@ from information_schema.system_variables
where variable_name in (
'have_openssl',
'have_symlink',
'have_sanitizer',
'hostname',
'large_files_support',
'lower_case_file_system',
......@@ -5773,16 +5772,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HAVE_SANITIZER
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT If the server is compiled with ASan (Address sanitizer) this will be set to YES, otherwise will be set to NO
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HAVE_SYMLINK
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
......
......@@ -675,7 +675,7 @@ MY_LOCALE *my_default_lc_time_names;
SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen, have_query_cache;
SHOW_COMP_OPTION have_geometry, have_rtree_keys;
SHOW_COMP_OPTION have_crypt, have_compress, have_sanitizer;
SHOW_COMP_OPTION have_crypt, have_compress;
SHOW_COMP_OPTION have_profiling;
SHOW_COMP_OPTION have_openssl;
......@@ -7957,14 +7957,6 @@ static int mysql_init_variables(void)
#endif /* ! EMBEDDED_LIBRARY */
#endif /* HAVE_OPENSSL */
have_sanitizer= SHOW_OPTION_NO;
#if defined(__has_feature)
#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
have_sanitizer= SHOW_OPTION_YES;
#endif
#endif
#if defined(__WIN__)
/* Allow Win32 users to move MySQL anywhere */
{
......
......@@ -393,7 +393,7 @@ extern SHOW_COMP_OPTION have_csv, have_innodb;
extern SHOW_COMP_OPTION have_ndbcluster, have_partitioning;
extern SHOW_COMP_OPTION have_profiling;
extern SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen, have_sanitizer;
extern SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen;
extern SHOW_COMP_OPTION have_query_cache;
extern SHOW_COMP_OPTION have_geometry, have_rtree_keys;
extern SHOW_COMP_OPTION have_crypt;
......
......@@ -4808,12 +4808,6 @@ static Sys_var_have Sys_have_rtree_keys(
"are available, will be set to YES, otherwise will be set to NO.",
READ_ONLY GLOBAL_VAR(have_rtree_keys), NO_CMD_LINE);
static Sys_var_have Sys_have_santitizer(
"have_sanitizer",
"If the server is compiled with ASan (Address sanitizer) this will be "
"set to YES, otherwise will be set to NO",
READ_ONLY GLOBAL_VAR(have_sanitizer), NO_CMD_LINE);
static Sys_var_have Sys_have_ssl(
"have_ssl", "If the server supports secure connections, will be set to YES, "
"otherwise will be set to NO. If set to DISABLED, the server was compiled with "
......@@ -4829,6 +4823,16 @@ static Sys_var_have Sys_have_symlink(
"--skip-symbolic-links option.",
READ_ONLY GLOBAL_VAR(have_symlink), NO_CMD_LINE);
#ifdef __SANITIZE_ADDRESS__
static char *have_sanitizer;
static Sys_var_charptr Sys_have_santitizer(
"have_sanitizer",
"If the server is compiled with ASan (Address sanitizer) this will be "
"set to ASAN",
READ_ONLY GLOBAL_VAR(have_sanitizer), NO_CMD_LINE,
IN_FS_CHARSET, DEFAULT("ASAN"));
#endif
static bool fix_log_state(sys_var *self, THD *thd, enum_var_type type);
static Sys_var_mybool Sys_general_log(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment