summaryrefslogtreecommitdiff
path: root/sql/log_event.h
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2000-10-03 19:53:13 -0600
committerunknown <sasha@mysql.sashanet.com>2000-10-03 19:53:13 -0600
commitcfc4a2e74e3fb0179f9094d0eb31d43c9155a14c (patch)
treefba8e93a1047a25f2dc74a994deb39e64361ff2f /sql/log_event.h
parentddae2009f506389aae9c1521e4da0a509eb60dee (diff)
downloadmariadb-git-cfc4a2e74e3fb0179f9094d0eb31d43c9155a14c.tar.gz
fixed mutex bug ( or lack of it) when reading log entries on COM_BINLOG_DUMP
added error_code to query event, and checking to see if we get the expected error on the slave removed obsolete code from slave.cc sql/log_event.cc: added mutex as an argument to FILE read_log_event functions sql/log_event.h: added error_code for the query event sql/mysqlbinlog.cc: fix for new form of read_log_event sql/slave.cc: removed obsolte code with fetch nx table added check to see if the query runs with the same error on the slave as it did on the master sql/sql_repl.cc: fixed mutex problem around read_log_event
Diffstat (limited to 'sql/log_event.h')
-rw-r--r--sql/log_event.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/log_event.h b/sql/log_event.h
index 871258885cf..f0aecf47e8c 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -31,7 +31,8 @@
#define BINLOG_VERSION 1
#define LOG_EVENT_HEADER_LEN 13
-#define QUERY_HEADER_LEN (sizeof(uint32) + sizeof(uint32) + sizeof(uchar))
+#define QUERY_HEADER_LEN (sizeof(uint32) + sizeof(uint32) + \
+ sizeof(uchar) + sizeof(uint16))
#define LOAD_HEADER_LEN (sizeof(uint32) + sizeof(uint32) + \
+ sizeof(uint32) + 2 + sizeof(uint32))
#define EVENT_LEN_OFFSET 9
@@ -88,11 +89,13 @@ public:
void print_timestamp(FILE* file, time_t *ts = 0);
void print_header(FILE* file);
- static Log_event* read_log_event(FILE* file);
+ // if mutex is 0, the read will proceed without mutex
+ static Log_event* read_log_event(FILE* file, pthread_mutex_t* log_lock);
static Log_event* read_log_event(const char* buf, int max_buf);
#ifndef MYSQL_CLIENT
- static int read_log_event(FILE* file, String* packet);
+ static int read_log_event(FILE* file, String* packet,
+ pthread_mutex_t* log_lock);
#endif
};
@@ -109,12 +112,14 @@ public:
// we pass it here, so we would not have to call strlen()
// otherwise, set it to 0, in which case, we compute it with strlen()
uint32 db_len;
+ uint16 error_code;
int thread_id;
#if !defined(MYSQL_CLIENT)
THD* thd;
Query_log_event(THD* thd_arg, const char* query_arg):
Log_event(thd_arg->start_time,0,0,thd_arg->server_id), data_buf(0),
query(query_arg), db(thd_arg->db), q_len(thd_arg->query_length),
+ error_code(thd_arg->net.last_errno),
thread_id(thd_arg->thread_id), thd(thd_arg)
{
time_t end_time;
@@ -142,6 +147,7 @@ public:
return q_len + db_len + 2 +
sizeof(uint32) // thread_id
+ sizeof(uint32) // exec_time
+ + sizeof(uint16) // error_code
;
}