summaryrefslogtreecommitdiff
path: root/sql/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/log.h')
-rw-r--r--sql/log.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/sql/log.h b/sql/log.h
index 277e5c6f69c..0e6b2c895af 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2005, 2016, Oracle and/or its affiliates.
- Copyright (c) 2009, 2016, Monty Program Ab
+ Copyright (c) 2009, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@ class Relay_log_info;
class Format_description_log_event;
+void setup_log_handling();
bool trans_has_updated_trans_table(const THD* thd);
bool stmt_has_updated_trans_table(const THD *thd);
bool use_trans_cache(const THD* thd, bool is_transactional);
@@ -286,9 +287,9 @@ typedef struct st_log_info
#define MAX_LOG_HANDLERS_NUM 3
/* log event handler flags */
-#define LOG_NONE 1
-#define LOG_FILE 2
-#define LOG_TABLE 4
+#define LOG_NONE 1U
+#define LOG_FILE 2U
+#define LOG_TABLE 4U
class Log_event;
class Rows_log_event;
@@ -354,7 +355,7 @@ public:
MYSQL_QUERY_LOG() : last_time(0) {}
void reopen_file();
bool write(time_t event_time, const char *user_host,
- uint user_host_len, int thread_id,
+ uint user_host_len, my_thread_id thread_id,
const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len);
bool write(THD *thd, time_t current_time,
@@ -585,10 +586,11 @@ public:
ulong binlog_id;
/* Total prepared XIDs and pending checkpoint requests in this binlog. */
long xid_count;
+ long notify_count;
/* For linking in requests to the binlog background thread. */
xid_count_per_binlog *next_in_queue;
xid_count_per_binlog(char *log_file_name, uint log_file_name_len)
- :binlog_id(0), xid_count(0)
+ :binlog_id(0), xid_count(0), notify_count(0)
{
binlog_name_len= log_file_name_len;
binlog_name= (char *) my_malloc(binlog_name_len, MYF(MY_ZEROFILL));
@@ -605,6 +607,8 @@ public:
mysql_cond_t COND_binlog_background_thread;
mysql_cond_t COND_binlog_background_thread_end;
+ void stop_background_thread();
+
using MYSQL_LOG::generate_name;
using MYSQL_LOG::is_open;
@@ -921,7 +925,7 @@ public:
virtual bool log_error(enum loglevel level, const char *format,
va_list args)= 0;
virtual bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
- uint user_host_len, int thread_id,
+ uint user_host_len, my_thread_id thread_id,
const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len,
CHARSET_INFO *client_cs)= 0;
@@ -950,7 +954,7 @@ public:
virtual bool log_error(enum loglevel level, const char *format,
va_list args);
virtual bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
- uint user_host_len, int thread_id,
+ uint user_host_len, my_thread_id thread_id,
const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len,
CHARSET_INFO *client_cs);
@@ -982,7 +986,7 @@ public:
virtual bool log_error(enum loglevel level, const char *format,
va_list args);
virtual bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
- uint user_host_len, int thread_id,
+ uint user_host_len, my_thread_id thread_id,
const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len,
CHARSET_INFO *client_cs);
@@ -1030,7 +1034,6 @@ public:
*/
void init_base();
void init_log_tables();
- bool flush_logs(THD *thd);
bool flush_slow_log();
bool flush_general_log();
/* Perform basic logger cleanup. this will leave e.g. error log open. */
@@ -1083,6 +1086,7 @@ int vprint_msg_to_log(enum loglevel level, const char *format, va_list args);
void sql_print_error(const char *format, ...);
void sql_print_warning(const char *format, ...);
void sql_print_information(const char *format, ...);
+void sql_print_information_v(const char *format, va_list ap);
typedef void (*sql_print_message_func)(const char *format, ...);
extern sql_print_message_func sql_print_message_handlers[];
@@ -1109,6 +1113,7 @@ void make_default_log_name(char **out, const char* log_ext, bool once);
void binlog_reset_cache(THD *thd);
extern MYSQL_PLUGIN_IMPORT MYSQL_BIN_LOG mysql_bin_log;
+extern handlerton *binlog_hton;
extern LOGGER logger;
extern const char *log_bin_index;