diff options
author | unknown <guilhem@mysql.com> | 2003-06-06 16:41:28 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2003-06-06 16:41:28 +0200 |
commit | a0120344b9039328221e2a25ae8ae516b6d2c0c4 (patch) | |
tree | 6355f561936938df547dcf9c94734e32c95496b1 /sql/slave.h | |
parent | bd414c301c1bbadecf385e1c10aa8a27cd76f61a (diff) | |
download | mariadb-git-a0120344b9039328221e2a25ae8ae516b6d2c0c4.tar.gz |
Fix for bug 254 :
we now make a distinction between if the master is < 3.23.57, 3.23 && >=57, and 4.x
(before the 2 3.23 were one). This is because in 3.23.57 we have a way to distinguish between
a Start_log_event written at server startup and one written at FLUSH LOGS, so we
have a way to know if the slave must drop old temp tables or not.
Change: mi->old_format was bool, now it's enum (to handle 3 cases). However, functions
which had 'bool old_format' as an argument have their prototypes unchanged, because
the old old_format == 0 now corresponds to the enum value BINLOG_FORMAT_CURRENT which
is equal to 0, so boolean tests are left untouched. The only case were we use mi->old_format
as an enum instead of casting it implicitly to a bool, is in Start_log_event::exec_event,
where we want to distinguish between the 3 possible enum values.
sql/log_event.cc:
Fix for bug 254 :
we now make a distinction between if the master is < 3.23.57, 3.23 && >=57, and 4.x
(before the 2 3.23 were one), to know if the slave must drop old temp tables or not.
sql/slave.cc:
Fix for bug 254 : mi->old_format is now enum.
An unrelated comment.
sql/slave.h:
fix for bug 254 : mi->old_format is now enum.
Diffstat (limited to 'sql/slave.h')
-rw-r--r-- | sql/slave.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/slave.h b/sql/slave.h index 8832302056d..66000f45e69 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -35,6 +35,11 @@ extern my_bool opt_log_slave_updates; extern ulonglong relay_log_space_limit; struct st_master_info; +enum enum_binlog_formats { + BINLOG_FORMAT_CURRENT=0, /* 0 is important for easy 'if (mi->old_format)' */ + BINLOG_FORMAT_323_LESS_57, + BINLOG_FORMAT_323_GEQ_57 }; + /* TODO: this needs to be redone, but for now it does not matter since we do not have multi-master yet. @@ -266,15 +271,15 @@ typedef struct st_master_info int events_till_abort; #endif bool inited; - bool old_format; /* master binlog is in 3.23 format */ + enum enum_binlog_formats old_format; /* master binlog is in 3.23 format */ volatile bool abort_slave, slave_running; volatile ulong slave_run_id; bool ignore_stop_event; st_master_info() - :fd(-1), io_thd(0), inited(0), old_format(0),abort_slave(0), - slave_running(0), slave_run_id(0) + :fd(-1), io_thd(0), inited(0), old_format(BINLOG_FORMAT_CURRENT), + abort_slave(0),slave_running(0), slave_run_id(0) { host[0] = 0; user[0] = 0; password[0] = 0; bzero(&file, sizeof(file)); |