mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Safety and speedup fixes:
Changed is_open() to work as before. Added back inited argument to LOG mysql-test/r/rpl_flush_log_loop.result: Fixed results (probably bug in previous rpatch) sql/handler.cc: Changed is_open() to work as before sql/item_func.cc: Changed is_open() to work as before sql/log.cc: Part revert of previous patch. The reason for adding back 'inited' is that is that we can't be 100 % sure that init_pthread_objects() is called before mysqld dies (for example on windows) I removed mutex lock handling in is_open() as the new code didn't have ANY affect except beeing slower. Added back checking of is_open() to some functions as we don't want to do a mutex lock when we are not using logging. Indentation/comment fixes sql/log_event.cc: Changed is_open() to work as before sql/repl_failsafe.cc: Changed is_open() to work as before sql/sql_base.cc: Changed is_open() to work as before sql/sql_class.h: Changed is_open() to work as before. Added back 'inited' variable sql/sql_db.cc: Changed is_open() to work as before sql/sql_delete.cc: Changed is_open() to work as before sql/sql_insert.cc: Changed is_open() to work as before sql/sql_load.cc: Changed is_open() to work as before sql/sql_parse.cc: Changed is_open() to work as before sql/sql_rename.cc: Changed is_open() to work as before sql/sql_repl.cc: Changed is_open() to work as before sql/sql_table.cc: Changed is_open() to work as before sql/sql_update.cc: Changed is_open() to work as before
This commit is contained in:
@@ -58,13 +58,10 @@ typedef struct st_log_info
|
||||
|
||||
class Log_event;
|
||||
|
||||
class MYSQL_LOG {
|
||||
class MYSQL_LOG
|
||||
{
|
||||
private:
|
||||
/*
|
||||
LOCK_log is inited by MYSQL_LOG::init(), so one should try to lock it only
|
||||
if he is sure MYSQL_LOG::init() has been called (i.e. if 'inited' is true).
|
||||
Same for LOCK_index.
|
||||
*/
|
||||
/* LOCK_log and LOCK_index are inited by init_pthread_objects() */
|
||||
pthread_mutex_t LOCK_log, LOCK_index;
|
||||
pthread_cond_t update_cond;
|
||||
ulonglong bytes_written;
|
||||
@@ -84,7 +81,7 @@ class MYSQL_LOG {
|
||||
*/
|
||||
volatile enum_log_type log_type;
|
||||
enum cache_type io_cache_type;
|
||||
bool write_error;
|
||||
bool write_error, inited;
|
||||
bool need_start_event;
|
||||
bool no_auto_events; // for relay binlog
|
||||
/*
|
||||
@@ -162,8 +159,7 @@ public:
|
||||
int find_next_log(LOG_INFO* linfo, bool need_mutex);
|
||||
int get_current_log(LOG_INFO* linfo);
|
||||
uint next_file_id();
|
||||
bool is_open(bool need_mutex=0);
|
||||
|
||||
inline bool is_open() { return log_type != LOG_CLOSED; }
|
||||
inline char* get_index_fname() { return index_file_name;}
|
||||
inline char* get_log_fname() { return log_file_name; }
|
||||
inline pthread_mutex_t* get_log_lock() { return &LOCK_log; }
|
||||
|
||||
Reference in New Issue
Block a user