diff options
author | guilhem@mysql.com <> | 2005-10-12 21:58:02 +0200 |
---|---|---|
committer | guilhem@mysql.com <> | 2005-10-12 21:58:02 +0200 |
commit | 4252b546b3ef78c9f49f397142827ea2b277f086 (patch) | |
tree | a42e8586944072e7730401a2c2d33f5f227c60c8 /sql/log_event.cc | |
parent | 03ed3231af42f76c79483ac585d1397bc07aac42 (diff) | |
parent | ab05c75ea7c1483c8f07cb74bf6255e037e67228 (diff) | |
download | mariadb-git-4252b546b3ef78c9f49f397142827ea2b277f086.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
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 41 |
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) || |