summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-07-20 13:35:58 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2018-07-20 17:35:52 +0200
commita0d33dc6ef6f380fb5a2d166e75ed6fed2dfce9d (patch)
tree23a851546156ca246920f5ffa7e825188856c02d
parent323f269d4099b4a47530f0574af63292dfd89b8f (diff)
downloadmariadb-git-a0d33dc6ef6f380fb5a2d166e75ed6fed2dfce9d.tar.gz
MDEV-16689: core-file should become a real server variablebb-10.1-MDEV-16689
Mysql Bug#56124 bug analog fix using Sys_var_bit.
-rw-r--r--client/mysqlbinlog.cc2
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result14
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result14
-rw-r--r--sql/mysqld.cc3
-rw-r--r--sql/mysqld.h3
-rw-r--r--sql/sys_vars.cc6
6 files changed, 39 insertions, 3 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 9753125dd67..bc13aa6c2cc 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -71,7 +71,7 @@ ulong bytes_sent = 0L, bytes_received = 0L;
ulong mysqld_net_retry_count = 10L;
ulong open_files_limit;
ulong opt_binlog_rows_event_max_size;
-uint test_flags = 0;
+ulonglong test_flags = 0;
static uint opt_protocol= 0;
static FILE *result_file;
static char *result_file_name= 0;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
index 7f046a188cc..2b3ecc36772 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -471,6 +471,20 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME CORE_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT write a core-file on crashes
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME DATADIR
SESSION_VALUE NULL
GLOBAL_VALUE PATH
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index 72550ffb3af..8df07cdefbd 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -471,6 +471,20 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME CORE_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT write a core-file on crashes
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME DATADIR
SESSION_VALUE NULL
GLOBAL_VALUE PATH
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 0f5147c8cf1..1e6e144ccff 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -482,7 +482,7 @@ my_bool opt_master_verify_checksum= 0;
my_bool opt_slave_sql_verify_checksum= 1;
const char *binlog_format_names[]= {"MIXED", "STATEMENT", "ROW", NullS};
volatile sig_atomic_t calling_initgroups= 0; /**< Used in SIGSEGV handler. */
-uint mysqld_port, test_flags, select_errors, dropping_tables, ha_open_options;
+uint mysqld_port, select_errors, dropping_tables, ha_open_options;
uint mysqld_extra_port;
uint mysqld_port_timeout;
ulong delay_key_write_options;
@@ -509,6 +509,7 @@ ulonglong max_binlog_cache_size=0;
ulong slave_max_allowed_packet= 0;
ulonglong binlog_stmt_cache_size=0;
ulonglong max_binlog_stmt_cache_size=0;
+ulonglong test_flags;
ulonglong query_cache_size=0;
ulong query_cache_limit=0;
ulong executed_events=0;
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 97ecf889787..0a3266abfb5 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -159,7 +159,8 @@ extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size;
extern ulong tc_log_page_waits;
extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb;
extern my_bool relay_log_recovery;
-extern uint test_flags,select_errors,ha_open_options;
+extern uint select_errors,ha_open_options;
+extern ulonglong test_flags;
extern uint protocol_version, mysqld_port, dropping_tables;
extern ulong delay_key_write_options;
extern char *opt_logname, *opt_slow_logname, *opt_bin_logname,
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 5470acc7892..f941794f89e 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -440,6 +440,12 @@ bool check_has_super(sys_var *self, THD *thd, set_var *var)
#endif
return false;
}
+
+static Sys_var_bit Sys_core_file("core_file", "write a core-file on crashes",
+ READ_ONLY GLOBAL_VAR(test_flags), NO_CMD_LINE,
+ TEST_CORE_ON_SIGNAL, DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ 0,0,0);
+
static bool binlog_format_check(sys_var *self, THD *thd, set_var *var)
{
if (check_has_super(self, thd, var))