2005-12-22 06:39:02 +01:00
|
|
|
/* Copyright (C) 2005 MySQL AB
|
|
|
|
|
|
|
|
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
|
2006-12-27 02:23:51 +01:00
|
|
|
the Free Software Foundation; version 2 of the License.
|
2005-12-22 06:39:02 +01:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
|
|
|
|
#ifndef LOG_H
|
|
|
|
#define LOG_H
|
|
|
|
|
|
|
|
struct st_relay_log_info;
|
|
|
|
|
|
|
|
class Format_description_log_event;
|
|
|
|
|
|
|
|
/*
|
|
|
|
Transaction Coordinator log - a base abstract class
|
|
|
|
for two different implementations
|
|
|
|
*/
|
|
|
|
class TC_LOG
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
int using_heuristic_recover();
|
|
|
|
TC_LOG() {}
|
|
|
|
virtual ~TC_LOG() {}
|
|
|
|
|
|
|
|
virtual int open(const char *opt_name)=0;
|
|
|
|
virtual void close()=0;
|
|
|
|
virtual int log(THD *thd, my_xid xid)=0;
|
|
|
|
virtual void unlog(ulong cookie, my_xid xid)=0;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TC_LOG_DUMMY: public TC_LOG // use it to disable the logging
|
|
|
|
{
|
2006-03-29 13:27:36 +02:00
|
|
|
public:
|
|
|
|
TC_LOG_DUMMY() {}
|
2005-12-22 06:39:02 +01:00
|
|
|
int open(const char *opt_name) { return 0; }
|
|
|
|
void close() { }
|
|
|
|
int log(THD *thd, my_xid xid) { return 1; }
|
|
|
|
void unlog(ulong cookie, my_xid xid) { }
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef HAVE_MMAP
|
|
|
|
class TC_LOG_MMAP: public TC_LOG
|
|
|
|
{
|
|
|
|
public: // only to keep Sun Forte on sol9x86 happy
|
|
|
|
typedef enum {
|
|
|
|
POOL, // page is in pool
|
|
|
|
ERROR, // last sync failed
|
|
|
|
DIRTY // new xids added since last sync
|
|
|
|
} PAGE_STATE;
|
|
|
|
|
|
|
|
private:
|
|
|
|
typedef struct st_page {
|
|
|
|
struct st_page *next; // page a linked in a fifo queue
|
|
|
|
my_xid *start, *end; // usable area of a page
|
|
|
|
my_xid *ptr; // next xid will be written here
|
|
|
|
int size, free; // max and current number of free xid slots on the page
|
|
|
|
int waiters; // number of waiters on condition
|
|
|
|
PAGE_STATE state; // see above
|
|
|
|
pthread_mutex_t lock; // to access page data or control structure
|
|
|
|
pthread_cond_t cond; // to wait for a sync
|
|
|
|
} PAGE;
|
|
|
|
|
|
|
|
char logname[FN_REFLEN];
|
|
|
|
File fd;
|
|
|
|
my_off_t file_length;
|
|
|
|
uint npages, inited;
|
|
|
|
uchar *data;
|
|
|
|
struct st_page *pages, *syncing, *active, *pool, *pool_last;
|
|
|
|
/*
|
|
|
|
note that, e.g. LOCK_active is only used to protect
|
|
|
|
'active' pointer, to protect the content of the active page
|
|
|
|
one has to use active->lock.
|
|
|
|
Same for LOCK_pool and LOCK_sync
|
|
|
|
*/
|
|
|
|
pthread_mutex_t LOCK_active, LOCK_pool, LOCK_sync;
|
|
|
|
pthread_cond_t COND_pool, COND_active;
|
|
|
|
|
|
|
|
public:
|
|
|
|
TC_LOG_MMAP(): inited(0) {}
|
|
|
|
int open(const char *opt_name);
|
|
|
|
void close();
|
|
|
|
int log(THD *thd, my_xid xid);
|
|
|
|
void unlog(ulong cookie, my_xid xid);
|
|
|
|
int recover();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void get_active_from_pool();
|
|
|
|
int sync();
|
|
|
|
int overflow();
|
|
|
|
};
|
|
|
|
#else
|
|
|
|
#define TC_LOG_MMAP TC_LOG_DUMMY
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern TC_LOG *tc_log;
|
|
|
|
extern TC_LOG_MMAP tc_log_mmap;
|
|
|
|
extern TC_LOG_DUMMY tc_log_dummy;
|
|
|
|
|
|
|
|
/* log info errors */
|
|
|
|
#define LOG_INFO_EOF -1
|
|
|
|
#define LOG_INFO_IO -2
|
|
|
|
#define LOG_INFO_INVALID -3
|
|
|
|
#define LOG_INFO_SEEK -4
|
|
|
|
#define LOG_INFO_MEM -6
|
|
|
|
#define LOG_INFO_FATAL -7
|
|
|
|
#define LOG_INFO_IN_USE -8
|
2006-10-13 06:48:05 +02:00
|
|
|
#define LOG_INFO_EMFILE -9
|
|
|
|
|
2005-12-22 06:39:02 +01:00
|
|
|
|
|
|
|
/* bitmap to SQL_LOG::close() */
|
|
|
|
#define LOG_CLOSE_INDEX 1
|
|
|
|
#define LOG_CLOSE_TO_BE_OPENED 2
|
|
|
|
#define LOG_CLOSE_STOP_EVENT 4
|
|
|
|
|
|
|
|
struct st_relay_log_info;
|
|
|
|
|
|
|
|
typedef struct st_log_info
|
|
|
|
{
|
|
|
|
char log_file_name[FN_REFLEN];
|
|
|
|
my_off_t index_file_offset, index_file_start_offset;
|
|
|
|
my_off_t pos;
|
|
|
|
bool fatal; // if the purge happens to give us a negative offset
|
|
|
|
pthread_mutex_t lock;
|
|
|
|
st_log_info():fatal(0) { pthread_mutex_init(&lock, MY_MUTEX_INIT_FAST);}
|
|
|
|
~st_log_info() { pthread_mutex_destroy(&lock);}
|
|
|
|
} LOG_INFO;
|
|
|
|
|
2006-01-19 03:56:06 +01:00
|
|
|
/*
|
|
|
|
Currently we have only 3 kinds of logging functions: old-fashioned
|
|
|
|
logs, stdout and csv logging routines.
|
|
|
|
*/
|
|
|
|
#define MAX_LOG_HANDLERS_NUM 3
|
|
|
|
|
2006-01-27 11:41:15 +01:00
|
|
|
/* log event handler flags */
|
|
|
|
#define LOG_NONE 1
|
|
|
|
#define LOG_FILE 2
|
|
|
|
#define LOG_TABLE 4
|
2006-01-19 03:56:06 +01:00
|
|
|
|
2005-12-22 06:39:02 +01:00
|
|
|
class Log_event;
|
|
|
|
class Rows_log_event;
|
|
|
|
|
2006-06-05 03:34:34 +02:00
|
|
|
enum enum_log_type { LOG_UNKNOWN, LOG_NORMAL, LOG_BIN };
|
|
|
|
enum enum_log_state { LOG_OPENED, LOG_CLOSED, LOG_TO_BE_OPENED };
|
2005-12-22 06:39:02 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
TODO use mmap instead of IO_CACHE for binlog
|
|
|
|
(mmap+fsync is two times faster than write+fsync)
|
|
|
|
*/
|
|
|
|
|
2006-05-05 08:45:58 +02:00
|
|
|
class MYSQL_LOG
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MYSQL_LOG();
|
|
|
|
void init_pthread_objects();
|
|
|
|
void cleanup();
|
|
|
|
bool open(const char *log_name,
|
|
|
|
enum_log_type log_type,
|
|
|
|
const char *new_name,
|
|
|
|
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);
|
2006-06-05 03:34:34 +02:00
|
|
|
inline bool is_open() { return log_state != LOG_CLOSED; }
|
2006-05-05 08:45:58 +02:00
|
|
|
const char *generate_name(const char *log_name, const char *suffix,
|
|
|
|
bool strip_ext, char *buff);
|
|
|
|
int generate_new_name(char *new_name, const char *log_name);
|
|
|
|
protected:
|
|
|
|
/* LOCK_log is inited by init_pthread_objects() */
|
|
|
|
pthread_mutex_t LOCK_log;
|
|
|
|
char *name;
|
|
|
|
char log_file_name[FN_REFLEN];
|
2006-09-28 15:00:44 +02:00
|
|
|
char time_buff[20], db[NAME_LEN + 1];
|
2006-05-05 08:45:58 +02:00
|
|
|
bool write_error, inited;
|
|
|
|
IO_CACHE log_file;
|
2006-06-05 03:34:34 +02:00
|
|
|
enum_log_type log_type;
|
|
|
|
volatile enum_log_state log_state;
|
2006-05-05 08:45:58 +02:00
|
|
|
enum cache_type io_cache_type;
|
|
|
|
friend class Log_event;
|
|
|
|
};
|
|
|
|
|
2006-06-05 03:34:34 +02:00
|
|
|
class MYSQL_QUERY_LOG: public MYSQL_LOG
|
2006-05-05 08:45:58 +02:00
|
|
|
{
|
|
|
|
public:
|
2006-06-05 03:34:34 +02:00
|
|
|
MYSQL_QUERY_LOG() : last_time(0) {}
|
|
|
|
void reopen_file();
|
2006-05-05 08:45:58 +02:00
|
|
|
bool write(time_t event_time, const char *user_host,
|
|
|
|
uint user_host_len, int 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, time_t query_start_arg,
|
|
|
|
const char *user_host, uint user_host_len,
|
|
|
|
longlong query_time, longlong lock_time, bool is_command,
|
|
|
|
const char *sql_text, uint sql_text_len);
|
|
|
|
bool open_slow_log(const char *log_name)
|
|
|
|
{
|
|
|
|
char buf[FN_REFLEN];
|
|
|
|
return open(generate_name(log_name, "-slow.log", 0, buf), LOG_NORMAL, 0,
|
|
|
|
WRITE_CACHE);
|
|
|
|
}
|
2006-06-05 03:34:34 +02:00
|
|
|
bool open_query_log(const char *log_name)
|
|
|
|
{
|
|
|
|
char buf[FN_REFLEN];
|
|
|
|
return open(generate_name(log_name, ".log", 0, buf), LOG_NORMAL, 0,
|
|
|
|
WRITE_CACHE);
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
time_t last_time;
|
2006-05-05 08:45:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
|
2005-12-22 06:39:02 +01:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
/* LOCK_log and LOCK_index are inited by init_pthread_objects() */
|
2006-05-05 08:45:58 +02:00
|
|
|
pthread_mutex_t LOCK_index;
|
2005-12-22 06:39:02 +01:00
|
|
|
pthread_mutex_t LOCK_prep_xids;
|
|
|
|
pthread_cond_t COND_prep_xids;
|
|
|
|
pthread_cond_t update_cond;
|
|
|
|
ulonglong bytes_written;
|
|
|
|
IO_CACHE index_file;
|
2006-05-05 08:45:58 +02:00
|
|
|
char index_file_name[FN_REFLEN];
|
2005-12-22 06:39:02 +01:00
|
|
|
/*
|
|
|
|
The max size before rotation (usable only if log_type == LOG_BIN: binary
|
|
|
|
logs and relay logs).
|
|
|
|
For a binlog, max_size should be max_binlog_size.
|
|
|
|
For a relay log, it should be max_relay_log_size if this is non-zero,
|
|
|
|
max_binlog_size otherwise.
|
|
|
|
max_size is set in init(), and dynamically changed (when one does SET
|
|
|
|
GLOBAL MAX_BINLOG_SIZE|MAX_RELAY_LOG_SIZE) by fix_max_binlog_size and
|
|
|
|
fix_max_relay_log_size).
|
|
|
|
*/
|
|
|
|
ulong max_size;
|
|
|
|
ulong prepared_xids; /* for tc log - number of xids to remember */
|
|
|
|
// current file sequence number for load data infile binary logging
|
|
|
|
uint file_id;
|
|
|
|
uint open_count; // For replication
|
|
|
|
int readers_count;
|
|
|
|
bool need_start_event;
|
|
|
|
/*
|
|
|
|
no_auto_events means we don't want any of these automatic events :
|
|
|
|
Start/Rotate/Stop. That is, in 4.x when we rotate a relay log, we don't
|
|
|
|
want a Rotate_log event to be written to the relay log. When we start a
|
|
|
|
relay log etc. So in 4.x this is 1 for relay logs, 0 for binlogs.
|
|
|
|
In 5.0 it's 0 for relay logs too!
|
|
|
|
*/
|
|
|
|
bool no_auto_events;
|
|
|
|
|
|
|
|
ulonglong m_table_map_version;
|
|
|
|
|
2006-02-16 08:30:53 +01:00
|
|
|
int write_to_file(IO_CACHE *cache);
|
2006-05-05 08:45:58 +02:00
|
|
|
/*
|
|
|
|
This is used to start writing to a new log file. The difference from
|
|
|
|
new_file() is locking. new_file_without_locking() does not acquire
|
|
|
|
LOCK_log.
|
|
|
|
*/
|
|
|
|
void new_file_without_locking();
|
|
|
|
void new_file_impl(bool need_lock);
|
2006-02-16 08:30:53 +01:00
|
|
|
|
|
|
|
public:
|
2006-05-05 08:45:58 +02:00
|
|
|
MYSQL_LOG::generate_name;
|
2006-06-05 03:34:34 +02:00
|
|
|
MYSQL_LOG::is_open;
|
2005-12-22 06:39:02 +01:00
|
|
|
/*
|
|
|
|
These describe the log's format. This is used only for relay logs.
|
|
|
|
_for_exec is used by the SQL thread, _for_queue by the I/O thread. It's
|
|
|
|
necessary to have 2 distinct objects, because the I/O thread may be reading
|
|
|
|
events in a different format from what the SQL thread is reading (consider
|
|
|
|
the case of a master which has been upgraded from 5.0 to 5.1 without doing
|
|
|
|
RESET MASTER, or from 4.x to 5.0).
|
|
|
|
*/
|
|
|
|
Format_description_log_event *description_event_for_exec,
|
|
|
|
*description_event_for_queue;
|
|
|
|
|
2006-05-05 08:45:58 +02:00
|
|
|
MYSQL_BIN_LOG();
|
2005-12-22 06:39:02 +01:00
|
|
|
/*
|
2006-05-05 08:45:58 +02:00
|
|
|
note that there's no destructor ~MYSQL_BIN_LOG() !
|
2005-12-22 06:39:02 +01:00
|
|
|
The reason is that we don't want it to be automatically called
|
|
|
|
on exit() - but only during the correct shutdown process
|
|
|
|
*/
|
|
|
|
|
|
|
|
int open(const char *opt_name);
|
|
|
|
void close();
|
|
|
|
int log(THD *thd, my_xid xid);
|
|
|
|
void unlog(ulong cookie, my_xid xid);
|
|
|
|
int recover(IO_CACHE *log, Format_description_log_event *fdle);
|
|
|
|
#if !defined(MYSQL_CLIENT)
|
|
|
|
bool is_table_mapped(TABLE *table) const
|
|
|
|
{
|
2006-02-16 08:30:53 +01:00
|
|
|
return table->s->table_map_version == table_map_version();
|
2005-12-22 06:39:02 +01:00
|
|
|
}
|
|
|
|
|
2006-02-16 08:30:53 +01:00
|
|
|
ulonglong table_map_version() const { return m_table_map_version; }
|
|
|
|
void update_table_map_version() { ++m_table_map_version; }
|
|
|
|
|
2005-12-22 06:39:02 +01:00
|
|
|
int flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event);
|
|
|
|
|
|
|
|
#endif /* !defined(MYSQL_CLIENT) */
|
|
|
|
void reset_bytes_written()
|
|
|
|
{
|
|
|
|
bytes_written = 0;
|
|
|
|
}
|
|
|
|
void harvest_bytes_written(ulonglong* counter)
|
|
|
|
{
|
|
|
|
#ifndef DBUG_OFF
|
|
|
|
char buf1[22],buf2[22];
|
|
|
|
#endif
|
|
|
|
DBUG_ENTER("harvest_bytes_written");
|
|
|
|
(*counter)+=bytes_written;
|
|
|
|
DBUG_PRINT("info",("counter: %s bytes_written: %s", llstr(*counter,buf1),
|
|
|
|
llstr(bytes_written,buf2)));
|
|
|
|
bytes_written=0;
|
|
|
|
DBUG_VOID_RETURN;
|
|
|
|
}
|
|
|
|
void set_max_size(ulong max_size_arg);
|
|
|
|
void signal_update();
|
|
|
|
void wait_for_update(THD* thd, bool master_or_slave);
|
|
|
|
void set_need_start_event() { need_start_event = 1; }
|
2006-05-05 08:45:58 +02:00
|
|
|
void init(bool no_auto_events_arg, ulong max_size);
|
2005-12-22 06:39:02 +01:00
|
|
|
void init_pthread_objects();
|
|
|
|
void cleanup();
|
|
|
|
bool open(const char *log_name,
|
|
|
|
enum_log_type log_type,
|
|
|
|
const char *new_name,
|
|
|
|
enum cache_type io_cache_type_arg,
|
|
|
|
bool no_auto_events_arg, ulong max_size,
|
|
|
|
bool null_created);
|
|
|
|
bool open_index_file(const char *index_file_name_arg,
|
|
|
|
const char *log_name);
|
2006-05-05 08:45:58 +02:00
|
|
|
/* Use this to start writing a new log file */
|
|
|
|
void new_file();
|
2006-01-19 03:56:06 +01:00
|
|
|
|
2005-12-22 06:39:02 +01:00
|
|
|
bool write(Log_event* event_info); // binary log write
|
|
|
|
bool write(THD *thd, IO_CACHE *cache, Log_event *commit_event);
|
|
|
|
|
|
|
|
void start_union_events(THD *thd);
|
|
|
|
void stop_union_events(THD *thd);
|
|
|
|
bool is_query_in_union(THD *thd, query_id_t query_id_param);
|
|
|
|
|
|
|
|
/*
|
|
|
|
v stands for vector
|
|
|
|
invoked as appendv(buf1,len1,buf2,len2,...,bufn,lenn,0)
|
|
|
|
*/
|
|
|
|
bool appendv(const char* buf,uint len,...);
|
|
|
|
bool append(Log_event* ev);
|
|
|
|
|
|
|
|
void make_log_name(char* buf, const char* log_ident);
|
|
|
|
bool is_active(const char* log_file_name);
|
|
|
|
int update_log_index(LOG_INFO* linfo, bool need_update_threads);
|
|
|
|
void rotate_and_purge(uint flags);
|
|
|
|
bool flush_and_sync();
|
|
|
|
int purge_logs(const char *to_log, bool included,
|
|
|
|
bool need_mutex, bool need_update_threads,
|
|
|
|
ulonglong *decrease_log_space);
|
|
|
|
int purge_logs_before_date(time_t purge_time);
|
|
|
|
int purge_first_log(struct st_relay_log_info* rli, bool included);
|
|
|
|
bool reset_logs(THD* thd);
|
|
|
|
void close(uint exiting);
|
|
|
|
|
|
|
|
// iterating through the log index file
|
|
|
|
int find_log_pos(LOG_INFO* linfo, const char* log_name,
|
|
|
|
bool need_mutex);
|
|
|
|
int find_next_log(LOG_INFO* linfo, bool need_mutex);
|
|
|
|
int get_current_log(LOG_INFO* linfo);
|
2006-09-04 14:19:39 +02:00
|
|
|
int raw_get_current_log(LOG_INFO* linfo);
|
2005-12-22 06:39:02 +01:00
|
|
|
uint next_file_id();
|
|
|
|
inline char* get_index_fname() { return index_file_name;}
|
|
|
|
inline char* get_log_fname() { return log_file_name; }
|
|
|
|
inline char* get_name() { return name; }
|
|
|
|
inline pthread_mutex_t* get_log_lock() { return &LOCK_log; }
|
|
|
|
inline IO_CACHE* get_log_file() { return &log_file; }
|
|
|
|
|
|
|
|
inline void lock_index() { pthread_mutex_lock(&LOCK_index);}
|
|
|
|
inline void unlock_index() { pthread_mutex_unlock(&LOCK_index);}
|
|
|
|
inline IO_CACHE *get_index_file() { return &index_file;}
|
|
|
|
inline uint32 get_open_count() { return open_count; }
|
|
|
|
};
|
|
|
|
|
2006-01-19 03:56:06 +01:00
|
|
|
class Log_event_handler
|
|
|
|
{
|
|
|
|
public:
|
2006-03-29 13:27:36 +02:00
|
|
|
Log_event_handler() {}
|
2006-01-19 03:56:06 +01:00
|
|
|
virtual bool init()= 0;
|
|
|
|
virtual void cleanup()= 0;
|
|
|
|
|
|
|
|
virtual bool log_slow(THD *thd, time_t current_time,
|
|
|
|
time_t query_start_arg, const char *user_host,
|
|
|
|
uint user_host_len, longlong query_time,
|
|
|
|
longlong lock_time, bool is_command,
|
|
|
|
const char *sql_text, uint sql_text_len)= 0;
|
|
|
|
virtual bool log_error(enum loglevel level, const char *format,
|
|
|
|
va_list args)= 0;
|
|
|
|
virtual bool log_general(time_t event_time, const char *user_host,
|
|
|
|
uint user_host_len, int thread_id,
|
|
|
|
const char *command_type, uint command_type_len,
|
2006-02-03 11:05:14 +01:00
|
|
|
const char *sql_text, uint sql_text_len,
|
|
|
|
CHARSET_INFO *client_cs)= 0;
|
2006-01-19 03:56:06 +01:00
|
|
|
virtual ~Log_event_handler() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
Fix for Bug #17544 "Cannot do atomic log rotate",
Bug #21785 "Server crashes after rename of the log table" and
Bug #21966 "Strange warnings on create like/repair of the log
tables"
According to the patch, from now on, one should use RENAME to
perform a log table rotation (this should also be reflected in
the manual).
Here is a sample:
use mysql;
CREATE TABLE IF NOT EXISTS general_log2 LIKE general_log;
RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log;
The rules for Rename of the log tables are following:
IF 1. Log tables are enabled
AND 2. Rename operates on the log table and nothing is being
renamed to the log table.
DO 3. Throw an error message.
ELSE 4. Perform rename.
The very RENAME query will go the the old (backup) table. This is
consistent with the behavoiur we have with binlog ROTATE LOGS
statement.
Other problems, which are solved by the patch are:
1) Now REPAIR of the log table is exclusive operation (as it should be), this
also eliminates lock-related warnings. and
2) CREATE LIKE TABLE now usese usual read lock on the source table rather
then name lock, which is too restrictive. This way we get rid of another
log table-related warning, which occured because of the above fact
(as a side-effect, name lock resulted in a warning).
mysql-test/r/log_tables.result:
update result file
mysql-test/t/log_tables.test:
Add tests for the bugs
sql/handler.cc:
update comment
sql/handler.h:
update function to reflect changes in log tables
locking logic.
sql/lock.cc:
Now we allow locking of the log tables for "privileged" threads
Privileged thread must explicitly close and lock log tables. This
is required for admin operations such as REPAIR.
sql/log.cc:
Changes to the file:
1) Add checks for table schema. It's more important now,
as we allow rename of the log tables. Since we should
check for schema when writing to a log table.
E.g. if one created a table with one-only comlumn and
renamed it to general_log, the server should cope with
it.
2) refactor LOGGER::flush(), so that we can now use the same
machinery as we use in FLUSH LOGS in other statements:
whenever we have to perform a serious operation on the log
tables, we have to
(a) lock logger, which blocks other concurrent statements (such
as selects) (b) close logs. Then perform an
exclusive operation, c) reenable logs and d) unlock logger.
3) Add a function to check if a given table is a log table.
4) Add support for "privileged" thread
5) merge is_[general/slow]_log_table_enabled() into one function.
6) Add new function: reopen _log_tables, which reopens the tables,
which were enabled (after temporary close, required for admin
operation)
sql/log.h:
1) add a new call close_n_lock_tables(). Now we use it instead of
LOGGER::flush() in FLUSH LOGS implementation.
2) add a prototype for the function to check if a given
table is a log table;
3) add privileged table flag to table logger
4) merge is_[general/slow]_log_table_enabled()
into one function.
sql/mysql_priv.h:
move log table defines to log.h
sql/sql_delete.cc:
use new function check_if_log_table() instead of direct strcmp
sql/sql_rename.cc:
Traverse the list of tables in mysql_rename_tables
to make sure that log tables are processed correctly
(that is, according to the rules specified in the
main CS comment)
sql/sql_table.cc:
1) mysql_admin_table() should disable logs if it performs
exclusive admin operation on a log table. This way we
also eliminate warning on REPAIR of the log table.
2) mysql_create_like_table should read-lock the source table
instead getting name lock on it. Name lock is too restrictive
in this case.
sql/share/errmsg.txt:
Add a new error message for rename of the log tables
sql/table.cc:
use new function instead of direct strcmp.
change my_strcasecmp() -> strcmp(), when
comparing system db and table names
storage/csv/ha_tina.cc:
update function to reflect changes in log tables
locking logic.
storage/myisam/ha_myisam.cc:
update function to reflect changes in log tables
locking logic.
2006-10-13 15:26:46 +02:00
|
|
|
int check_if_log_table(uint db_len, const char *db, uint table_name_len,
|
|
|
|
const char *table_name, uint check_if_opened);
|
|
|
|
|
2006-01-19 03:56:06 +01:00
|
|
|
class Log_to_csv_event_handler: public Log_event_handler
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
We create artificial THD for each of the logs. This is to avoid
|
|
|
|
locking issues: we don't want locks on the log tables reside in the
|
|
|
|
THD's of the query. The reason is the locking order and duration.
|
|
|
|
*/
|
|
|
|
THD *general_log_thd, *slow_log_thd;
|
Fix for Bug #17544 "Cannot do atomic log rotate",
Bug #21785 "Server crashes after rename of the log table" and
Bug #21966 "Strange warnings on create like/repair of the log
tables"
According to the patch, from now on, one should use RENAME to
perform a log table rotation (this should also be reflected in
the manual).
Here is a sample:
use mysql;
CREATE TABLE IF NOT EXISTS general_log2 LIKE general_log;
RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log;
The rules for Rename of the log tables are following:
IF 1. Log tables are enabled
AND 2. Rename operates on the log table and nothing is being
renamed to the log table.
DO 3. Throw an error message.
ELSE 4. Perform rename.
The very RENAME query will go the the old (backup) table. This is
consistent with the behavoiur we have with binlog ROTATE LOGS
statement.
Other problems, which are solved by the patch are:
1) Now REPAIR of the log table is exclusive operation (as it should be), this
also eliminates lock-related warnings. and
2) CREATE LIKE TABLE now usese usual read lock on the source table rather
then name lock, which is too restrictive. This way we get rid of another
log table-related warning, which occured because of the above fact
(as a side-effect, name lock resulted in a warning).
mysql-test/r/log_tables.result:
update result file
mysql-test/t/log_tables.test:
Add tests for the bugs
sql/handler.cc:
update comment
sql/handler.h:
update function to reflect changes in log tables
locking logic.
sql/lock.cc:
Now we allow locking of the log tables for "privileged" threads
Privileged thread must explicitly close and lock log tables. This
is required for admin operations such as REPAIR.
sql/log.cc:
Changes to the file:
1) Add checks for table schema. It's more important now,
as we allow rename of the log tables. Since we should
check for schema when writing to a log table.
E.g. if one created a table with one-only comlumn and
renamed it to general_log, the server should cope with
it.
2) refactor LOGGER::flush(), so that we can now use the same
machinery as we use in FLUSH LOGS in other statements:
whenever we have to perform a serious operation on the log
tables, we have to
(a) lock logger, which blocks other concurrent statements (such
as selects) (b) close logs. Then perform an
exclusive operation, c) reenable logs and d) unlock logger.
3) Add a function to check if a given table is a log table.
4) Add support for "privileged" thread
5) merge is_[general/slow]_log_table_enabled() into one function.
6) Add new function: reopen _log_tables, which reopens the tables,
which were enabled (after temporary close, required for admin
operation)
sql/log.h:
1) add a new call close_n_lock_tables(). Now we use it instead of
LOGGER::flush() in FLUSH LOGS implementation.
2) add a prototype for the function to check if a given
table is a log table;
3) add privileged table flag to table logger
4) merge is_[general/slow]_log_table_enabled()
into one function.
sql/mysql_priv.h:
move log table defines to log.h
sql/sql_delete.cc:
use new function check_if_log_table() instead of direct strcmp
sql/sql_rename.cc:
Traverse the list of tables in mysql_rename_tables
to make sure that log tables are processed correctly
(that is, according to the rules specified in the
main CS comment)
sql/sql_table.cc:
1) mysql_admin_table() should disable logs if it performs
exclusive admin operation on a log table. This way we
also eliminate warning on REPAIR of the log table.
2) mysql_create_like_table should read-lock the source table
instead getting name lock on it. Name lock is too restrictive
in this case.
sql/share/errmsg.txt:
Add a new error message for rename of the log tables
sql/table.cc:
use new function instead of direct strcmp.
change my_strcasecmp() -> strcmp(), when
comparing system db and table names
storage/csv/ha_tina.cc:
update function to reflect changes in log tables
locking logic.
storage/myisam/ha_myisam.cc:
update function to reflect changes in log tables
locking logic.
2006-10-13 15:26:46 +02:00
|
|
|
/*
|
|
|
|
This is for the thread, which called tmp_close_log_tables. The thread
|
|
|
|
will be allowed to write-lock the log tables (as it explicitly disabled
|
|
|
|
logging). This is used for such operations as REPAIR, which require
|
|
|
|
exclusive lock on the log tables.
|
|
|
|
NOTE: there can be only one priviliged thread, as one should
|
|
|
|
lock logger with logger.lock() before calling tmp_close_log_tables().
|
|
|
|
So no other thread could get privileged status at the same time.
|
|
|
|
*/
|
|
|
|
THD *privileged_thread;
|
2006-01-19 03:56:06 +01:00
|
|
|
friend class LOGGER;
|
|
|
|
TABLE_LIST general_log, slow_log;
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool open_log_table(uint log_type);
|
|
|
|
|
|
|
|
public:
|
|
|
|
Log_to_csv_event_handler();
|
|
|
|
~Log_to_csv_event_handler();
|
|
|
|
virtual bool init();
|
|
|
|
virtual void cleanup();
|
|
|
|
|
|
|
|
virtual bool log_slow(THD *thd, time_t current_time,
|
|
|
|
time_t query_start_arg, const char *user_host,
|
|
|
|
uint user_host_len, longlong query_time,
|
|
|
|
longlong lock_time, bool is_command,
|
|
|
|
const char *sql_text, uint sql_text_len);
|
|
|
|
virtual bool log_error(enum loglevel level, const char *format,
|
|
|
|
va_list args);
|
|
|
|
virtual bool log_general(time_t event_time, const char *user_host,
|
|
|
|
uint user_host_len, int thread_id,
|
|
|
|
const char *command_type, uint command_type_len,
|
2006-02-03 11:05:14 +01:00
|
|
|
const char *sql_text, uint sql_text_len,
|
|
|
|
CHARSET_INFO *client_cs);
|
Fix for Bug #17544 "Cannot do atomic log rotate",
Bug #21785 "Server crashes after rename of the log table" and
Bug #21966 "Strange warnings on create like/repair of the log
tables"
According to the patch, from now on, one should use RENAME to
perform a log table rotation (this should also be reflected in
the manual).
Here is a sample:
use mysql;
CREATE TABLE IF NOT EXISTS general_log2 LIKE general_log;
RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log;
The rules for Rename of the log tables are following:
IF 1. Log tables are enabled
AND 2. Rename operates on the log table and nothing is being
renamed to the log table.
DO 3. Throw an error message.
ELSE 4. Perform rename.
The very RENAME query will go the the old (backup) table. This is
consistent with the behavoiur we have with binlog ROTATE LOGS
statement.
Other problems, which are solved by the patch are:
1) Now REPAIR of the log table is exclusive operation (as it should be), this
also eliminates lock-related warnings. and
2) CREATE LIKE TABLE now usese usual read lock on the source table rather
then name lock, which is too restrictive. This way we get rid of another
log table-related warning, which occured because of the above fact
(as a side-effect, name lock resulted in a warning).
mysql-test/r/log_tables.result:
update result file
mysql-test/t/log_tables.test:
Add tests for the bugs
sql/handler.cc:
update comment
sql/handler.h:
update function to reflect changes in log tables
locking logic.
sql/lock.cc:
Now we allow locking of the log tables for "privileged" threads
Privileged thread must explicitly close and lock log tables. This
is required for admin operations such as REPAIR.
sql/log.cc:
Changes to the file:
1) Add checks for table schema. It's more important now,
as we allow rename of the log tables. Since we should
check for schema when writing to a log table.
E.g. if one created a table with one-only comlumn and
renamed it to general_log, the server should cope with
it.
2) refactor LOGGER::flush(), so that we can now use the same
machinery as we use in FLUSH LOGS in other statements:
whenever we have to perform a serious operation on the log
tables, we have to
(a) lock logger, which blocks other concurrent statements (such
as selects) (b) close logs. Then perform an
exclusive operation, c) reenable logs and d) unlock logger.
3) Add a function to check if a given table is a log table.
4) Add support for "privileged" thread
5) merge is_[general/slow]_log_table_enabled() into one function.
6) Add new function: reopen _log_tables, which reopens the tables,
which were enabled (after temporary close, required for admin
operation)
sql/log.h:
1) add a new call close_n_lock_tables(). Now we use it instead of
LOGGER::flush() in FLUSH LOGS implementation.
2) add a prototype for the function to check if a given
table is a log table;
3) add privileged table flag to table logger
4) merge is_[general/slow]_log_table_enabled()
into one function.
sql/mysql_priv.h:
move log table defines to log.h
sql/sql_delete.cc:
use new function check_if_log_table() instead of direct strcmp
sql/sql_rename.cc:
Traverse the list of tables in mysql_rename_tables
to make sure that log tables are processed correctly
(that is, according to the rules specified in the
main CS comment)
sql/sql_table.cc:
1) mysql_admin_table() should disable logs if it performs
exclusive admin operation on a log table. This way we
also eliminate warning on REPAIR of the log table.
2) mysql_create_like_table should read-lock the source table
instead getting name lock on it. Name lock is too restrictive
in this case.
sql/share/errmsg.txt:
Add a new error message for rename of the log tables
sql/table.cc:
use new function instead of direct strcmp.
change my_strcasecmp() -> strcmp(), when
comparing system db and table names
storage/csv/ha_tina.cc:
update function to reflect changes in log tables
locking logic.
storage/myisam/ha_myisam.cc:
update function to reflect changes in log tables
locking logic.
2006-10-13 15:26:46 +02:00
|
|
|
void tmp_close_log_tables(THD *thd);
|
2006-01-19 03:56:06 +01:00
|
|
|
void close_log_table(uint log_type, bool lock_in_use);
|
|
|
|
bool reopen_log_table(uint log_type);
|
Fix for Bug #17544 "Cannot do atomic log rotate",
Bug #21785 "Server crashes after rename of the log table" and
Bug #21966 "Strange warnings on create like/repair of the log
tables"
According to the patch, from now on, one should use RENAME to
perform a log table rotation (this should also be reflected in
the manual).
Here is a sample:
use mysql;
CREATE TABLE IF NOT EXISTS general_log2 LIKE general_log;
RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log;
The rules for Rename of the log tables are following:
IF 1. Log tables are enabled
AND 2. Rename operates on the log table and nothing is being
renamed to the log table.
DO 3. Throw an error message.
ELSE 4. Perform rename.
The very RENAME query will go the the old (backup) table. This is
consistent with the behavoiur we have with binlog ROTATE LOGS
statement.
Other problems, which are solved by the patch are:
1) Now REPAIR of the log table is exclusive operation (as it should be), this
also eliminates lock-related warnings. and
2) CREATE LIKE TABLE now usese usual read lock on the source table rather
then name lock, which is too restrictive. This way we get rid of another
log table-related warning, which occured because of the above fact
(as a side-effect, name lock resulted in a warning).
mysql-test/r/log_tables.result:
update result file
mysql-test/t/log_tables.test:
Add tests for the bugs
sql/handler.cc:
update comment
sql/handler.h:
update function to reflect changes in log tables
locking logic.
sql/lock.cc:
Now we allow locking of the log tables for "privileged" threads
Privileged thread must explicitly close and lock log tables. This
is required for admin operations such as REPAIR.
sql/log.cc:
Changes to the file:
1) Add checks for table schema. It's more important now,
as we allow rename of the log tables. Since we should
check for schema when writing to a log table.
E.g. if one created a table with one-only comlumn and
renamed it to general_log, the server should cope with
it.
2) refactor LOGGER::flush(), so that we can now use the same
machinery as we use in FLUSH LOGS in other statements:
whenever we have to perform a serious operation on the log
tables, we have to
(a) lock logger, which blocks other concurrent statements (such
as selects) (b) close logs. Then perform an
exclusive operation, c) reenable logs and d) unlock logger.
3) Add a function to check if a given table is a log table.
4) Add support for "privileged" thread
5) merge is_[general/slow]_log_table_enabled() into one function.
6) Add new function: reopen _log_tables, which reopens the tables,
which were enabled (after temporary close, required for admin
operation)
sql/log.h:
1) add a new call close_n_lock_tables(). Now we use it instead of
LOGGER::flush() in FLUSH LOGS implementation.
2) add a prototype for the function to check if a given
table is a log table;
3) add privileged table flag to table logger
4) merge is_[general/slow]_log_table_enabled()
into one function.
sql/mysql_priv.h:
move log table defines to log.h
sql/sql_delete.cc:
use new function check_if_log_table() instead of direct strcmp
sql/sql_rename.cc:
Traverse the list of tables in mysql_rename_tables
to make sure that log tables are processed correctly
(that is, according to the rules specified in the
main CS comment)
sql/sql_table.cc:
1) mysql_admin_table() should disable logs if it performs
exclusive admin operation on a log table. This way we
also eliminate warning on REPAIR of the log table.
2) mysql_create_like_table should read-lock the source table
instead getting name lock on it. Name lock is too restrictive
in this case.
sql/share/errmsg.txt:
Add a new error message for rename of the log tables
sql/table.cc:
use new function instead of direct strcmp.
change my_strcasecmp() -> strcmp(), when
comparing system db and table names
storage/csv/ha_tina.cc:
update function to reflect changes in log tables
locking logic.
storage/myisam/ha_myisam.cc:
update function to reflect changes in log tables
locking logic.
2006-10-13 15:26:46 +02:00
|
|
|
THD* get_privileged_thread()
|
|
|
|
{
|
|
|
|
return privileged_thread;
|
|
|
|
}
|
2006-01-19 03:56:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
Fix for Bug #17544 "Cannot do atomic log rotate",
Bug #21785 "Server crashes after rename of the log table" and
Bug #21966 "Strange warnings on create like/repair of the log
tables"
According to the patch, from now on, one should use RENAME to
perform a log table rotation (this should also be reflected in
the manual).
Here is a sample:
use mysql;
CREATE TABLE IF NOT EXISTS general_log2 LIKE general_log;
RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log;
The rules for Rename of the log tables are following:
IF 1. Log tables are enabled
AND 2. Rename operates on the log table and nothing is being
renamed to the log table.
DO 3. Throw an error message.
ELSE 4. Perform rename.
The very RENAME query will go the the old (backup) table. This is
consistent with the behavoiur we have with binlog ROTATE LOGS
statement.
Other problems, which are solved by the patch are:
1) Now REPAIR of the log table is exclusive operation (as it should be), this
also eliminates lock-related warnings. and
2) CREATE LIKE TABLE now usese usual read lock on the source table rather
then name lock, which is too restrictive. This way we get rid of another
log table-related warning, which occured because of the above fact
(as a side-effect, name lock resulted in a warning).
mysql-test/r/log_tables.result:
update result file
mysql-test/t/log_tables.test:
Add tests for the bugs
sql/handler.cc:
update comment
sql/handler.h:
update function to reflect changes in log tables
locking logic.
sql/lock.cc:
Now we allow locking of the log tables for "privileged" threads
Privileged thread must explicitly close and lock log tables. This
is required for admin operations such as REPAIR.
sql/log.cc:
Changes to the file:
1) Add checks for table schema. It's more important now,
as we allow rename of the log tables. Since we should
check for schema when writing to a log table.
E.g. if one created a table with one-only comlumn and
renamed it to general_log, the server should cope with
it.
2) refactor LOGGER::flush(), so that we can now use the same
machinery as we use in FLUSH LOGS in other statements:
whenever we have to perform a serious operation on the log
tables, we have to
(a) lock logger, which blocks other concurrent statements (such
as selects) (b) close logs. Then perform an
exclusive operation, c) reenable logs and d) unlock logger.
3) Add a function to check if a given table is a log table.
4) Add support for "privileged" thread
5) merge is_[general/slow]_log_table_enabled() into one function.
6) Add new function: reopen _log_tables, which reopens the tables,
which were enabled (after temporary close, required for admin
operation)
sql/log.h:
1) add a new call close_n_lock_tables(). Now we use it instead of
LOGGER::flush() in FLUSH LOGS implementation.
2) add a prototype for the function to check if a given
table is a log table;
3) add privileged table flag to table logger
4) merge is_[general/slow]_log_table_enabled()
into one function.
sql/mysql_priv.h:
move log table defines to log.h
sql/sql_delete.cc:
use new function check_if_log_table() instead of direct strcmp
sql/sql_rename.cc:
Traverse the list of tables in mysql_rename_tables
to make sure that log tables are processed correctly
(that is, according to the rules specified in the
main CS comment)
sql/sql_table.cc:
1) mysql_admin_table() should disable logs if it performs
exclusive admin operation on a log table. This way we
also eliminate warning on REPAIR of the log table.
2) mysql_create_like_table should read-lock the source table
instead getting name lock on it. Name lock is too restrictive
in this case.
sql/share/errmsg.txt:
Add a new error message for rename of the log tables
sql/table.cc:
use new function instead of direct strcmp.
change my_strcasecmp() -> strcmp(), when
comparing system db and table names
storage/csv/ha_tina.cc:
update function to reflect changes in log tables
locking logic.
storage/myisam/ha_myisam.cc:
update function to reflect changes in log tables
locking logic.
2006-10-13 15:26:46 +02:00
|
|
|
/* type of the log table */
|
|
|
|
#define QUERY_LOG_SLOW 1
|
|
|
|
#define QUERY_LOG_GENERAL 2
|
|
|
|
|
2006-01-19 03:56:06 +01:00
|
|
|
class Log_to_file_event_handler: public Log_event_handler
|
|
|
|
{
|
2006-06-05 03:34:34 +02:00
|
|
|
MYSQL_QUERY_LOG mysql_log;
|
|
|
|
MYSQL_QUERY_LOG mysql_slow_log;
|
2006-01-19 03:56:06 +01:00
|
|
|
bool is_initialized;
|
|
|
|
public:
|
|
|
|
Log_to_file_event_handler(): is_initialized(FALSE)
|
|
|
|
{}
|
|
|
|
virtual bool init();
|
|
|
|
virtual void cleanup();
|
|
|
|
|
|
|
|
virtual bool log_slow(THD *thd, time_t current_time,
|
|
|
|
time_t query_start_arg, const char *user_host,
|
|
|
|
uint user_host_len, longlong query_time,
|
|
|
|
longlong lock_time, bool is_command,
|
|
|
|
const char *sql_text, uint sql_text_len);
|
|
|
|
virtual bool log_error(enum loglevel level, const char *format,
|
|
|
|
va_list args);
|
|
|
|
virtual bool log_general(time_t event_time, const char *user_host,
|
|
|
|
uint user_host_len, int thread_id,
|
|
|
|
const char *command_type, uint command_type_len,
|
2006-02-03 11:05:14 +01:00
|
|
|
const char *sql_text, uint sql_text_len,
|
|
|
|
CHARSET_INFO *client_cs);
|
2006-01-19 03:56:06 +01:00
|
|
|
void flush();
|
|
|
|
void init_pthread_objects();
|
2006-06-21 11:53:40 +02:00
|
|
|
MYSQL_QUERY_LOG *get_mysql_slow_log() { return &mysql_slow_log; }
|
|
|
|
MYSQL_QUERY_LOG *get_mysql_log() { return &mysql_log; }
|
2006-01-19 03:56:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Class which manages slow, general and error log event handlers */
|
|
|
|
class LOGGER
|
|
|
|
{
|
|
|
|
pthread_mutex_t LOCK_logger;
|
|
|
|
/* flag to check whether logger mutex is initialized */
|
|
|
|
uint inited;
|
|
|
|
|
|
|
|
/* available log handlers */
|
|
|
|
Log_to_csv_event_handler *table_log_handler;
|
|
|
|
Log_to_file_event_handler *file_log_handler;
|
|
|
|
|
|
|
|
/* NULL-terminated arrays of log handlers */
|
|
|
|
Log_event_handler *error_log_handler_list[MAX_LOG_HANDLERS_NUM + 1];
|
|
|
|
Log_event_handler *slow_log_handler_list[MAX_LOG_HANDLERS_NUM + 1];
|
|
|
|
Log_event_handler *general_log_handler_list[MAX_LOG_HANDLERS_NUM + 1];
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
bool is_log_tables_initialized;
|
|
|
|
|
|
|
|
LOGGER() : inited(0), table_log_handler(NULL),
|
|
|
|
file_log_handler(NULL), is_log_tables_initialized(FALSE)
|
|
|
|
{}
|
|
|
|
void lock() { (void) pthread_mutex_lock(&LOCK_logger); }
|
|
|
|
void unlock() { (void) pthread_mutex_unlock(&LOCK_logger); }
|
Fix for Bug #17544 "Cannot do atomic log rotate",
Bug #21785 "Server crashes after rename of the log table" and
Bug #21966 "Strange warnings on create like/repair of the log
tables"
According to the patch, from now on, one should use RENAME to
perform a log table rotation (this should also be reflected in
the manual).
Here is a sample:
use mysql;
CREATE TABLE IF NOT EXISTS general_log2 LIKE general_log;
RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log;
The rules for Rename of the log tables are following:
IF 1. Log tables are enabled
AND 2. Rename operates on the log table and nothing is being
renamed to the log table.
DO 3. Throw an error message.
ELSE 4. Perform rename.
The very RENAME query will go the the old (backup) table. This is
consistent with the behavoiur we have with binlog ROTATE LOGS
statement.
Other problems, which are solved by the patch are:
1) Now REPAIR of the log table is exclusive operation (as it should be), this
also eliminates lock-related warnings. and
2) CREATE LIKE TABLE now usese usual read lock on the source table rather
then name lock, which is too restrictive. This way we get rid of another
log table-related warning, which occured because of the above fact
(as a side-effect, name lock resulted in a warning).
mysql-test/r/log_tables.result:
update result file
mysql-test/t/log_tables.test:
Add tests for the bugs
sql/handler.cc:
update comment
sql/handler.h:
update function to reflect changes in log tables
locking logic.
sql/lock.cc:
Now we allow locking of the log tables for "privileged" threads
Privileged thread must explicitly close and lock log tables. This
is required for admin operations such as REPAIR.
sql/log.cc:
Changes to the file:
1) Add checks for table schema. It's more important now,
as we allow rename of the log tables. Since we should
check for schema when writing to a log table.
E.g. if one created a table with one-only comlumn and
renamed it to general_log, the server should cope with
it.
2) refactor LOGGER::flush(), so that we can now use the same
machinery as we use in FLUSH LOGS in other statements:
whenever we have to perform a serious operation on the log
tables, we have to
(a) lock logger, which blocks other concurrent statements (such
as selects) (b) close logs. Then perform an
exclusive operation, c) reenable logs and d) unlock logger.
3) Add a function to check if a given table is a log table.
4) Add support for "privileged" thread
5) merge is_[general/slow]_log_table_enabled() into one function.
6) Add new function: reopen _log_tables, which reopens the tables,
which were enabled (after temporary close, required for admin
operation)
sql/log.h:
1) add a new call close_n_lock_tables(). Now we use it instead of
LOGGER::flush() in FLUSH LOGS implementation.
2) add a prototype for the function to check if a given
table is a log table;
3) add privileged table flag to table logger
4) merge is_[general/slow]_log_table_enabled()
into one function.
sql/mysql_priv.h:
move log table defines to log.h
sql/sql_delete.cc:
use new function check_if_log_table() instead of direct strcmp
sql/sql_rename.cc:
Traverse the list of tables in mysql_rename_tables
to make sure that log tables are processed correctly
(that is, according to the rules specified in the
main CS comment)
sql/sql_table.cc:
1) mysql_admin_table() should disable logs if it performs
exclusive admin operation on a log table. This way we
also eliminate warning on REPAIR of the log table.
2) mysql_create_like_table should read-lock the source table
instead getting name lock on it. Name lock is too restrictive
in this case.
sql/share/errmsg.txt:
Add a new error message for rename of the log tables
sql/table.cc:
use new function instead of direct strcmp.
change my_strcasecmp() -> strcmp(), when
comparing system db and table names
storage/csv/ha_tina.cc:
update function to reflect changes in log tables
locking logic.
storage/myisam/ha_myisam.cc:
update function to reflect changes in log tables
locking logic.
2006-10-13 15:26:46 +02:00
|
|
|
void tmp_close_log_tables(THD *thd);
|
|
|
|
bool is_log_table_enabled(uint log_table_type)
|
2006-08-03 19:28:15 +02:00
|
|
|
{
|
Fix for Bug #17544 "Cannot do atomic log rotate",
Bug #21785 "Server crashes after rename of the log table" and
Bug #21966 "Strange warnings on create like/repair of the log
tables"
According to the patch, from now on, one should use RENAME to
perform a log table rotation (this should also be reflected in
the manual).
Here is a sample:
use mysql;
CREATE TABLE IF NOT EXISTS general_log2 LIKE general_log;
RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log;
The rules for Rename of the log tables are following:
IF 1. Log tables are enabled
AND 2. Rename operates on the log table and nothing is being
renamed to the log table.
DO 3. Throw an error message.
ELSE 4. Perform rename.
The very RENAME query will go the the old (backup) table. This is
consistent with the behavoiur we have with binlog ROTATE LOGS
statement.
Other problems, which are solved by the patch are:
1) Now REPAIR of the log table is exclusive operation (as it should be), this
also eliminates lock-related warnings. and
2) CREATE LIKE TABLE now usese usual read lock on the source table rather
then name lock, which is too restrictive. This way we get rid of another
log table-related warning, which occured because of the above fact
(as a side-effect, name lock resulted in a warning).
mysql-test/r/log_tables.result:
update result file
mysql-test/t/log_tables.test:
Add tests for the bugs
sql/handler.cc:
update comment
sql/handler.h:
update function to reflect changes in log tables
locking logic.
sql/lock.cc:
Now we allow locking of the log tables for "privileged" threads
Privileged thread must explicitly close and lock log tables. This
is required for admin operations such as REPAIR.
sql/log.cc:
Changes to the file:
1) Add checks for table schema. It's more important now,
as we allow rename of the log tables. Since we should
check for schema when writing to a log table.
E.g. if one created a table with one-only comlumn and
renamed it to general_log, the server should cope with
it.
2) refactor LOGGER::flush(), so that we can now use the same
machinery as we use in FLUSH LOGS in other statements:
whenever we have to perform a serious operation on the log
tables, we have to
(a) lock logger, which blocks other concurrent statements (such
as selects) (b) close logs. Then perform an
exclusive operation, c) reenable logs and d) unlock logger.
3) Add a function to check if a given table is a log table.
4) Add support for "privileged" thread
5) merge is_[general/slow]_log_table_enabled() into one function.
6) Add new function: reopen _log_tables, which reopens the tables,
which were enabled (after temporary close, required for admin
operation)
sql/log.h:
1) add a new call close_n_lock_tables(). Now we use it instead of
LOGGER::flush() in FLUSH LOGS implementation.
2) add a prototype for the function to check if a given
table is a log table;
3) add privileged table flag to table logger
4) merge is_[general/slow]_log_table_enabled()
into one function.
sql/mysql_priv.h:
move log table defines to log.h
sql/sql_delete.cc:
use new function check_if_log_table() instead of direct strcmp
sql/sql_rename.cc:
Traverse the list of tables in mysql_rename_tables
to make sure that log tables are processed correctly
(that is, according to the rules specified in the
main CS comment)
sql/sql_table.cc:
1) mysql_admin_table() should disable logs if it performs
exclusive admin operation on a log table. This way we
also eliminate warning on REPAIR of the log table.
2) mysql_create_like_table should read-lock the source table
instead getting name lock on it. Name lock is too restrictive
in this case.
sql/share/errmsg.txt:
Add a new error message for rename of the log tables
sql/table.cc:
use new function instead of direct strcmp.
change my_strcasecmp() -> strcmp(), when
comparing system db and table names
storage/csv/ha_tina.cc:
update function to reflect changes in log tables
locking logic.
storage/myisam/ha_myisam.cc:
update function to reflect changes in log tables
locking logic.
2006-10-13 15:26:46 +02:00
|
|
|
switch (log_table_type) {
|
|
|
|
case QUERY_LOG_SLOW:
|
|
|
|
return table_log_handler && table_log_handler->slow_log.table != 0;
|
|
|
|
case QUERY_LOG_GENERAL:
|
|
|
|
return table_log_handler && table_log_handler->general_log.table != 0;
|
|
|
|
default:
|
|
|
|
DBUG_ASSERT(0);
|
|
|
|
return FALSE; /* make compiler happy */
|
|
|
|
}
|
2006-08-03 19:28:15 +02:00
|
|
|
}
|
2006-01-19 03:56:06 +01:00
|
|
|
/*
|
|
|
|
We want to initialize all log mutexes as soon as possible,
|
|
|
|
but we cannot do it in constructor, as safe_mutex relies on
|
|
|
|
initialization, performed by MY_INIT(). This why this is done in
|
|
|
|
this function.
|
|
|
|
*/
|
|
|
|
void init_base();
|
|
|
|
void init_log_tables();
|
|
|
|
bool flush_logs(THD *thd);
|
|
|
|
THD *get_general_log_thd()
|
|
|
|
{
|
2006-01-30 00:24:47 +01:00
|
|
|
if (table_log_handler)
|
|
|
|
return (THD *) table_log_handler->general_log_thd;
|
|
|
|
else
|
|
|
|
return NULL;
|
2006-01-19 03:56:06 +01:00
|
|
|
}
|
|
|
|
THD *get_slow_log_thd()
|
|
|
|
{
|
2006-01-30 00:24:47 +01:00
|
|
|
if (table_log_handler)
|
|
|
|
return (THD *) table_log_handler->slow_log_thd;
|
|
|
|
else
|
|
|
|
return NULL;
|
2006-01-19 03:56:06 +01:00
|
|
|
}
|
2006-01-27 14:10:40 +01:00
|
|
|
/* Perform basic logger cleanup. this will leave e.g. error log open. */
|
|
|
|
void cleanup_base();
|
|
|
|
/* Free memory. Nothing could be logged after this function is called */
|
|
|
|
void cleanup_end();
|
2006-01-19 03:56:06 +01:00
|
|
|
bool error_log_print(enum loglevel level, const char *format,
|
|
|
|
va_list args);
|
|
|
|
bool slow_log_print(THD *thd, const char *query, uint query_length,
|
|
|
|
time_t query_start_arg);
|
|
|
|
bool general_log_print(THD *thd,enum enum_server_command command,
|
|
|
|
const char *format, va_list args);
|
|
|
|
|
|
|
|
void close_log_table(uint log_type, bool lock_in_use);
|
|
|
|
bool reopen_log_table(uint log_type);
|
Fix for Bug #17544 "Cannot do atomic log rotate",
Bug #21785 "Server crashes after rename of the log table" and
Bug #21966 "Strange warnings on create like/repair of the log
tables"
According to the patch, from now on, one should use RENAME to
perform a log table rotation (this should also be reflected in
the manual).
Here is a sample:
use mysql;
CREATE TABLE IF NOT EXISTS general_log2 LIKE general_log;
RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log;
The rules for Rename of the log tables are following:
IF 1. Log tables are enabled
AND 2. Rename operates on the log table and nothing is being
renamed to the log table.
DO 3. Throw an error message.
ELSE 4. Perform rename.
The very RENAME query will go the the old (backup) table. This is
consistent with the behavoiur we have with binlog ROTATE LOGS
statement.
Other problems, which are solved by the patch are:
1) Now REPAIR of the log table is exclusive operation (as it should be), this
also eliminates lock-related warnings. and
2) CREATE LIKE TABLE now usese usual read lock on the source table rather
then name lock, which is too restrictive. This way we get rid of another
log table-related warning, which occured because of the above fact
(as a side-effect, name lock resulted in a warning).
mysql-test/r/log_tables.result:
update result file
mysql-test/t/log_tables.test:
Add tests for the bugs
sql/handler.cc:
update comment
sql/handler.h:
update function to reflect changes in log tables
locking logic.
sql/lock.cc:
Now we allow locking of the log tables for "privileged" threads
Privileged thread must explicitly close and lock log tables. This
is required for admin operations such as REPAIR.
sql/log.cc:
Changes to the file:
1) Add checks for table schema. It's more important now,
as we allow rename of the log tables. Since we should
check for schema when writing to a log table.
E.g. if one created a table with one-only comlumn and
renamed it to general_log, the server should cope with
it.
2) refactor LOGGER::flush(), so that we can now use the same
machinery as we use in FLUSH LOGS in other statements:
whenever we have to perform a serious operation on the log
tables, we have to
(a) lock logger, which blocks other concurrent statements (such
as selects) (b) close logs. Then perform an
exclusive operation, c) reenable logs and d) unlock logger.
3) Add a function to check if a given table is a log table.
4) Add support for "privileged" thread
5) merge is_[general/slow]_log_table_enabled() into one function.
6) Add new function: reopen _log_tables, which reopens the tables,
which were enabled (after temporary close, required for admin
operation)
sql/log.h:
1) add a new call close_n_lock_tables(). Now we use it instead of
LOGGER::flush() in FLUSH LOGS implementation.
2) add a prototype for the function to check if a given
table is a log table;
3) add privileged table flag to table logger
4) merge is_[general/slow]_log_table_enabled()
into one function.
sql/mysql_priv.h:
move log table defines to log.h
sql/sql_delete.cc:
use new function check_if_log_table() instead of direct strcmp
sql/sql_rename.cc:
Traverse the list of tables in mysql_rename_tables
to make sure that log tables are processed correctly
(that is, according to the rules specified in the
main CS comment)
sql/sql_table.cc:
1) mysql_admin_table() should disable logs if it performs
exclusive admin operation on a log table. This way we
also eliminate warning on REPAIR of the log table.
2) mysql_create_like_table should read-lock the source table
instead getting name lock on it. Name lock is too restrictive
in this case.
sql/share/errmsg.txt:
Add a new error message for rename of the log tables
sql/table.cc:
use new function instead of direct strcmp.
change my_strcasecmp() -> strcmp(), when
comparing system db and table names
storage/csv/ha_tina.cc:
update function to reflect changes in log tables
locking logic.
storage/myisam/ha_myisam.cc:
update function to reflect changes in log tables
locking logic.
2006-10-13 15:26:46 +02:00
|
|
|
bool reopen_log_tables();
|
2006-01-19 03:56:06 +01:00
|
|
|
|
|
|
|
/* we use this function to setup all enabled log event handlers */
|
2006-01-27 11:41:15 +01:00
|
|
|
int set_handlers(uint error_log_printer,
|
|
|
|
uint slow_log_printer,
|
|
|
|
uint general_log_printer);
|
|
|
|
void init_error_log(uint error_log_printer);
|
|
|
|
void init_slow_log(uint slow_log_printer);
|
|
|
|
void init_general_log(uint general_log_printer);
|
2006-06-19 15:30:55 +02:00
|
|
|
void deactivate_log_handler(THD* thd, uint log_type);
|
|
|
|
bool activate_log_handler(THD* thd, uint log_type);
|
2006-06-21 11:53:40 +02:00
|
|
|
MYSQL_QUERY_LOG *get_slow_log_file_handler()
|
2006-06-19 15:30:55 +02:00
|
|
|
{
|
|
|
|
if (file_log_handler)
|
|
|
|
return file_log_handler->get_mysql_slow_log();
|
|
|
|
return NULL;
|
|
|
|
}
|
2006-06-21 11:53:40 +02:00
|
|
|
MYSQL_QUERY_LOG *get_log_file_handler()
|
2006-06-19 15:30:55 +02:00
|
|
|
{
|
|
|
|
if (file_log_handler)
|
|
|
|
return file_log_handler->get_mysql_log();
|
|
|
|
return NULL;
|
|
|
|
}
|
Fix for Bug #17544 "Cannot do atomic log rotate",
Bug #21785 "Server crashes after rename of the log table" and
Bug #21966 "Strange warnings on create like/repair of the log
tables"
According to the patch, from now on, one should use RENAME to
perform a log table rotation (this should also be reflected in
the manual).
Here is a sample:
use mysql;
CREATE TABLE IF NOT EXISTS general_log2 LIKE general_log;
RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log;
The rules for Rename of the log tables are following:
IF 1. Log tables are enabled
AND 2. Rename operates on the log table and nothing is being
renamed to the log table.
DO 3. Throw an error message.
ELSE 4. Perform rename.
The very RENAME query will go the the old (backup) table. This is
consistent with the behavoiur we have with binlog ROTATE LOGS
statement.
Other problems, which are solved by the patch are:
1) Now REPAIR of the log table is exclusive operation (as it should be), this
also eliminates lock-related warnings. and
2) CREATE LIKE TABLE now usese usual read lock on the source table rather
then name lock, which is too restrictive. This way we get rid of another
log table-related warning, which occured because of the above fact
(as a side-effect, name lock resulted in a warning).
mysql-test/r/log_tables.result:
update result file
mysql-test/t/log_tables.test:
Add tests for the bugs
sql/handler.cc:
update comment
sql/handler.h:
update function to reflect changes in log tables
locking logic.
sql/lock.cc:
Now we allow locking of the log tables for "privileged" threads
Privileged thread must explicitly close and lock log tables. This
is required for admin operations such as REPAIR.
sql/log.cc:
Changes to the file:
1) Add checks for table schema. It's more important now,
as we allow rename of the log tables. Since we should
check for schema when writing to a log table.
E.g. if one created a table with one-only comlumn and
renamed it to general_log, the server should cope with
it.
2) refactor LOGGER::flush(), so that we can now use the same
machinery as we use in FLUSH LOGS in other statements:
whenever we have to perform a serious operation on the log
tables, we have to
(a) lock logger, which blocks other concurrent statements (such
as selects) (b) close logs. Then perform an
exclusive operation, c) reenable logs and d) unlock logger.
3) Add a function to check if a given table is a log table.
4) Add support for "privileged" thread
5) merge is_[general/slow]_log_table_enabled() into one function.
6) Add new function: reopen _log_tables, which reopens the tables,
which were enabled (after temporary close, required for admin
operation)
sql/log.h:
1) add a new call close_n_lock_tables(). Now we use it instead of
LOGGER::flush() in FLUSH LOGS implementation.
2) add a prototype for the function to check if a given
table is a log table;
3) add privileged table flag to table logger
4) merge is_[general/slow]_log_table_enabled()
into one function.
sql/mysql_priv.h:
move log table defines to log.h
sql/sql_delete.cc:
use new function check_if_log_table() instead of direct strcmp
sql/sql_rename.cc:
Traverse the list of tables in mysql_rename_tables
to make sure that log tables are processed correctly
(that is, according to the rules specified in the
main CS comment)
sql/sql_table.cc:
1) mysql_admin_table() should disable logs if it performs
exclusive admin operation on a log table. This way we
also eliminate warning on REPAIR of the log table.
2) mysql_create_like_table should read-lock the source table
instead getting name lock on it. Name lock is too restrictive
in this case.
sql/share/errmsg.txt:
Add a new error message for rename of the log tables
sql/table.cc:
use new function instead of direct strcmp.
change my_strcasecmp() -> strcmp(), when
comparing system db and table names
storage/csv/ha_tina.cc:
update function to reflect changes in log tables
locking logic.
storage/myisam/ha_myisam.cc:
update function to reflect changes in log tables
locking logic.
2006-10-13 15:26:46 +02:00
|
|
|
THD* get_privileged_thread()
|
|
|
|
{
|
|
|
|
if (table_log_handler)
|
|
|
|
return table_log_handler->get_privileged_thread();
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
2006-06-19 15:30:55 +02:00
|
|
|
};
|
WL#2977 and WL#2712 global and session-level variable to set the binlog format (row/statement),
and new binlog format called "mixed" (which is statement-based except if only row-based is correct,
in this cset it means if UDF or UUID is used; more cases could be added in later 5.1 release):
SET GLOBAL|SESSION BINLOG_FORMAT=row|statement|mixed|default;
the global default is statement unless cluster is enabled (then it's row) as in 5.1-alpha.
It's not possible to use SET on this variable if a session is currently in row-based mode and has open temporary tables (because CREATE
TEMPORARY TABLE was not binlogged so temp table is not known on slave), or if NDB is enabled (because
NDB does not support such change on-the-fly, though it will later), of if in a stored function (see below).
The added tests test the possibility or impossibility to SET, their effects, and the mixed mode,
including in prepared statements and in stored procedures and functions.
Caveats:
a) The mixed mode will not work for stored functions: in mixed mode, a stored function will
always be binlogged as one call and in a statement-based way (e.g. INSERT VALUES(myfunc()) or SELECT myfunc()).
b) for the same reason, changing the thread's binlog format inside a stored function is
refused with an error message.
c) the same problems apply to triggers; implementing b) for triggers will be done later (will ask
Dmitri).
Additionally, as the binlog format is now changeable by each user for his session, I remove the implication
which was done at startup, where row-based automatically set log-bin-trust-routine-creators to 1
(not possible anymore as a user can now switch to stmt-based and do nasty things again), and automatically
set --innodb-locks-unsafe-for-binlog to 1 (was anyway theoretically incorrect as it disabled
phantom protection).
Plus fixes for compiler warnings.
mysql-test/r/rpl_row_4_bytes.result:
update
mysql-test/t/rpl_row_4_bytes.test:
don't influence next tests
sql/ha_archive.cc:
please pay attention to this structure when you change it...
sql/ha_berkeley.cc:
please pay attention to this structure when you change it...
sql/ha_blackhole.cc:
please pay attention to this structure when you change it...
sql/ha_federated.cc:
please pay attention to this structure when you change it...
sql/ha_heap.cc:
please pay attention to this structure when you change it...
sql/ha_innodb.cc:
please pay attention to this structure when you change it...
sql/ha_myisam.cc:
please pay attention to this structure when you change it...
sql/ha_myisammrg.cc:
please pay attention to this structure when you change it...
sql/ha_ndbcluster_binlog.cc:
no more global 'binlog_row_based'
sql/ha_partition.cc:
please pay attention to this structure when you change it...
sql/handler.cc:
please pay attention to this structure when you change it...
sql/handler.h:
it's good to initialize statically (to get no compiler warning) even if to a null value.
sql/item_func.cc:
UDFs require row-based if this is the "mixed" binlog format.
sql/item_strfunc.cc:
UUID() requires row-based binlogging if this is the "mixed" binlog format
sql/log.cc:
binlog_row_based -> thd->current_stmt_binlog_row_based
sql/log.h:
the enum enum_binlog_format moves to log.h from mysqld.cc as we need it in several places.
sql/log_event.cc:
binlog_row_based -> thd->current_stmt_binlog_row_based
sql/log_event.h:
this global variable not used anymore
sql/mysql_priv.h:
these global variables not used anymore
sql/mysqld.cc:
simplification in the handling of --binlog-format (but with no user-visible change), thanks to
the new global system variable.
RBR does not anymore turn on --log-bin-trust-function-creators and --innodb-locks-unsafe-for-binlog
as these are global options and RBR is now settable per session.
sql/partition_info.cc:
compiler warnings
sql/set_var.cc:
new class of thread's variable, to handle the binlog_format (like sys_var_thd_enum except
that is_readonly() is overriden for more checks before update).
compiler warnings (ok'd by Serg)
sql/set_var.h:
new class for the thread's binlog_format (see set_var.cc)
sql/share/errmsg.txt:
some messages for when one can't toggle from one binlog format to another
sql/sp_head.cc:
binlog_row_based -> thd->current_stmt_binlog_row_based
sql/sql_base.cc:
binlog_row_based -> thd->current_stmt_binlog_row_based
sql/sql_class.cc:
When a THD is initialized, we set its current_stmt_binlog_row_based
sql/sql_class.h:
new THD::variables.binlog_format (the value of the session variable set by SET
or inherited from the global value), and THD::current_stmt_binlog_row_based which tells if the
current statement does row-based or statement-based binlogging. Both members are needed
as the 2nd one cannot be derived only from the first one (the statement's type plays a role too),
and the 1st one is needed to reset the 2nd one.
sql/sql_delete.cc:
binlog_row_based -> thd->current_stmt_binlog_row_based
sql/sql_insert.cc:
binlog_row_based -> thd->current_stmt_binlog_row_based
sql/sql_load.cc:
binlog_row_based -> thd->current_stmt_binlog_row_based.
sql/sql_parse.cc:
when we are done with a statement, we reset the current_stmt_binlog_row_based to the value
derived from THD::variables.binlog_format.
sql/sql_partition.cc:
compiler warning
sql/sql_show.cc:
compiler warning
sql/sql_table.cc:
binlog_row_based -> thd->current_stmt_binlog_row_based
tests/mysql_client_test.c:
compiler warning
mysql-test/r/ndb_binlog_basic2.result:
new result
mysql-test/r/rpl_switch_stm_row_mixed.result:
new result
mysql-test/t/ndb_binlog_basic2.test:
new test to verify that if cluster is enabled, can't change binlog format on the fly.
mysql-test/t/rpl_switch_stm_row_mixed.test:
test to see if one can switch between SBR, RBR, and "mixed" mode, and when one cannot,
and test to see if the switching, and the mixed mode, work properly (using UUID() to test,
as using UDFs is not possible in the testsuite for portability reasons).
2006-02-25 22:21:03 +01:00
|
|
|
|
|
|
|
enum enum_binlog_format {
|
|
|
|
BINLOG_FORMAT_STMT= 0, // statement-based
|
|
|
|
#ifdef HAVE_ROW_BASED_REPLICATION
|
|
|
|
BINLOG_FORMAT_ROW= 1, // row_based
|
|
|
|
/*
|
|
|
|
statement-based except for cases where only row-based can work (UUID()
|
|
|
|
etc):
|
|
|
|
*/
|
|
|
|
BINLOG_FORMAT_MIXED= 2,
|
|
|
|
#endif
|
|
|
|
/*
|
|
|
|
This value is last, after the end of binlog_format_typelib: it has no
|
|
|
|
corresponding cell in this typelib. We use this value to be able to know if
|
|
|
|
the user has explicitely specified a binlog format at startup or not.
|
|
|
|
*/
|
|
|
|
BINLOG_FORMAT_UNSPEC= 3
|
|
|
|
};
|
|
|
|
extern TYPELIB binlog_format_typelib;
|
|
|
|
|
2005-12-22 06:39:02 +01:00
|
|
|
#endif /* LOG_H */
|