Cleanup MYSQL_LOG
Embed MYSQL_LOG::init(). Reduce visibility of MYSQL_LOG::init_and_set_log_file_name(). Cleanup unused mysql_bin_log_file_name() and mysql_bin_log_file_pos().
This commit is contained in:
parent
1d58e62d5b
commit
e976d95614
32
sql/log.cc
32
sql/log.cc
@ -2590,24 +2590,14 @@ end:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MYSQL_LOG::init(enum_log_type log_type_arg,
|
|
||||||
enum cache_type io_cache_type_arg)
|
|
||||||
{
|
|
||||||
DBUG_ENTER("MYSQL_LOG::init");
|
|
||||||
log_type= log_type_arg;
|
|
||||||
io_cache_type= io_cache_type_arg;
|
|
||||||
DBUG_PRINT("info",("log_type: %d", log_type));
|
|
||||||
DBUG_VOID_RETURN;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool MYSQL_LOG::init_and_set_log_file_name(const char *log_name,
|
bool MYSQL_LOG::init_and_set_log_file_name(const char *log_name,
|
||||||
const char *new_name,
|
const char *new_name,
|
||||||
ulong next_log_number,
|
ulong next_log_number,
|
||||||
enum_log_type log_type_arg,
|
enum_log_type log_type_arg,
|
||||||
enum cache_type io_cache_type_arg)
|
enum cache_type io_cache_type_arg)
|
||||||
{
|
{
|
||||||
init(log_type_arg, io_cache_type_arg);
|
log_type= log_type_arg;
|
||||||
|
io_cache_type= io_cache_type_arg;
|
||||||
|
|
||||||
if (new_name)
|
if (new_name)
|
||||||
{
|
{
|
||||||
@ -10438,24 +10428,6 @@ MYSQL_BIN_LOG::do_binlog_recovery(const char *opt_name, bool do_xa_recovery)
|
|||||||
|
|
||||||
|
|
||||||
#ifdef INNODB_COMPATIBILITY_HOOKS
|
#ifdef INNODB_COMPATIBILITY_HOOKS
|
||||||
/**
|
|
||||||
Get the file name of the MySQL binlog.
|
|
||||||
@return the name of the binlog file
|
|
||||||
*/
|
|
||||||
extern "C"
|
|
||||||
const char* mysql_bin_log_file_name(void)
|
|
||||||
{
|
|
||||||
return mysql_bin_log.get_log_fname();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
Get the current position of the MySQL binlog.
|
|
||||||
@return byte offset from the beginning of the binlog
|
|
||||||
*/
|
|
||||||
extern "C"
|
|
||||||
ulonglong mysql_bin_log_file_pos(void)
|
|
||||||
{
|
|
||||||
return (ulonglong) mysql_bin_log.get_log_file()->pos_in_file;
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
Get the current position of the MySQL binlog for transaction currently being
|
Get the current position of the MySQL binlog for transaction currently being
|
||||||
committed.
|
committed.
|
||||||
|
15
sql/log.h
15
sql/log.h
@ -305,13 +305,6 @@ public:
|
|||||||
enum_log_type log_type,
|
enum_log_type log_type,
|
||||||
const char *new_name, ulong next_file_number,
|
const char *new_name, ulong next_file_number,
|
||||||
enum cache_type io_cache_type_arg);
|
enum cache_type io_cache_type_arg);
|
||||||
bool init_and_set_log_file_name(const char *log_name,
|
|
||||||
const char *new_name,
|
|
||||||
ulong next_log_number,
|
|
||||||
enum_log_type log_type_arg,
|
|
||||||
enum cache_type io_cache_type_arg);
|
|
||||||
void init(enum_log_type log_type_arg,
|
|
||||||
enum cache_type io_cache_type_arg);
|
|
||||||
void close(uint exiting);
|
void close(uint exiting);
|
||||||
inline bool is_open() { return log_state != LOG_CLOSED; }
|
inline bool is_open() { return log_state != LOG_CLOSED; }
|
||||||
const char *generate_name(const char *log_name,
|
const char *generate_name(const char *log_name,
|
||||||
@ -335,7 +328,12 @@ public:
|
|||||||
/** Instrumentation key to use for file io in @c log_file */
|
/** Instrumentation key to use for file io in @c log_file */
|
||||||
PSI_file_key m_log_file_key;
|
PSI_file_key m_log_file_key;
|
||||||
#endif
|
#endif
|
||||||
/* for documentation of mutexes held in various places in code */
|
|
||||||
|
bool init_and_set_log_file_name(const char *log_name,
|
||||||
|
const char *new_name,
|
||||||
|
ulong next_log_number,
|
||||||
|
enum_log_type log_type_arg,
|
||||||
|
enum cache_type io_cache_type_arg);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Tell the io thread if we can delay the master info sync. */
|
/* Tell the io thread if we can delay the master info sync. */
|
||||||
@ -414,7 +412,6 @@ struct wait_for_commit;
|
|||||||
|
|
||||||
class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
|
class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
#ifdef HAVE_PSI_INTERFACE
|
#ifdef HAVE_PSI_INTERFACE
|
||||||
/** The instrumentation key to use for @ LOCK_index. */
|
/** The instrumentation key to use for @ LOCK_index. */
|
||||||
PSI_mutex_key m_key_LOCK_index;
|
PSI_mutex_key m_key_LOCK_index;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user