summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2005-10-12 21:58:02 +0200
committerunknown <guilhem@mysql.com>2005-10-12 21:58:02 +0200
commit8b1a32aeadf22776e2e3f8d1f67ee32f0e1fd80d (patch)
treea42e8586944072e7730401a2c2d33f5f227c60c8 /sql/log_event.cc
parent3f11381b7c27dba3a0b387b642f4353c4d18cb7e (diff)
parent61dfc3347f013eadb46a5035cbf0479bcacc8f22 (diff)
downloadmariadb-git-8b1a32aeadf22776e2e3f8d1f67ee32f0e1fd80d.tar.gz
Merge mysql.com:/home/mysql_src/mysql-4.1
into mysql.com:/home/mysql_src/mysql-5.0; a very bad automerge (issues with non-ascii chars), plus some hard conflicts I'll fix by hand in a next cset BitKeeper/deleted/.del-compile-pentium64-valgrind-max: Delete: BUILD/compile-pentium64-valgrind-max BitKeeper/etc/config: Auto merged sql/log.cc: Auto merged sql/slave.h: Auto merged client/mysqltest.c: manual merge mysql-test/r/subselect.result: manual merge mysql-test/t/subselect.test: manual merge sql/log_event.cc: manual merge sql/log_event.h: manual merge sql/slave.cc: manual merge sql/sql_yacc.yy: manual merge
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc41
1 files changed, 34 insertions, 7 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index ed6599f692f..4bfe502d77e 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2962,10 +2962,39 @@ void Rotate_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_
#endif /* MYSQL_CLIENT */
+
/*
- Rotate_log_event::Rotate_log_event()
+ Rotate_log_event::Rotate_log_event() (2 constructors)
*/
+
+#ifndef MYSQL_CLIENT
+Rotate_log_event::Rotate_log_event(THD* thd_arg,
+ const char* new_log_ident_arg,
+ uint ident_len_arg, ulonglong pos_arg,
+ uint flags_arg)
+ :Log_event(), new_log_ident(new_log_ident_arg),
+ pos(pos_arg),ident_len(ident_len_arg ? ident_len_arg :
+ (uint) strlen(new_log_ident_arg)), flags(flags_arg)
+{
+#ifndef DBUG_OFF
+ char buff[22];
+ DBUG_ENTER("Rotate_log_event::Rotate_log_event(THD*,...)");
+ DBUG_PRINT("enter",("new_log_ident %s pos %s flags %lu", new_log_ident_arg,
+ llstr(pos_arg, buff), flags));
+#endif
+ if (flags & DUP_NAME)
+ new_log_ident= my_strdup_with_length(new_log_ident_arg,
+ ident_len,
+ MYF(MY_WME));
+ DBUG_VOID_RETURN;
+}
+#endif
+
+
+Rotate_log_event::Rotate_log_event(const char* buf, int event_len,
+ bool old_format)
+ :Log_event(buf, old_format), new_log_ident(0), flags(DUP_NAME)
Rotate_log_event::Rotate_log_event(const char* buf, uint event_len,
const Format_description_log_event* description_event)
:Log_event(buf, description_event) ,new_log_ident(NULL),alloced(0)
@@ -2983,12 +3012,9 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len,
(header_size+post_header_len));
ident_offset = post_header_len;
set_if_smaller(ident_len,FN_REFLEN-1);
- if (!(new_log_ident= my_strdup_with_length((byte*) buf +
- ident_offset,
- (uint) ident_len,
- MYF(MY_WME))))
- DBUG_VOID_RETURN;
- alloced = 1;
+ new_log_ident= my_strdup_with_length((byte*) buf + ident_offset,
+ (uint) ident_len,
+ MYF(MY_WME));
DBUG_VOID_RETURN;
}
@@ -3001,6 +3027,7 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len,
bool Rotate_log_event::write(IO_CACHE* file)
{
char buf[ROTATE_HEADER_LEN];
+ DBUG_ASSERT(!(flags & ZERO_LEN)); // such an event cannot be written
int8store(buf + R_POS_OFFSET, pos);
return (write_header(file, ROTATE_HEADER_LEN + ident_len) ||
my_b_safe_write(file, (byte*)buf, ROTATE_HEADER_LEN) ||