mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
cleanup: comments
This commit is contained in:
@@ -5956,7 +5956,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
When binary logging is not enabled (--log-bin=0), wsrep-patch partially
|
When binary logging is not enabled (--log-bin=0), wsrep-patch partially
|
||||||
enables it without opening the binlog file (MSQL_BIN_LOG::open().
|
enables it without opening the binlog file (MYSQL_BIN_LOG::open().
|
||||||
So, avoid writing to binlog file.
|
So, avoid writing to binlog file.
|
||||||
*/
|
*/
|
||||||
if (direct &&
|
if (direct &&
|
||||||
|
@@ -1157,8 +1157,7 @@ bool Log_event::write_footer(IO_CACHE* file)
|
|||||||
{
|
{
|
||||||
DBUG_ENTER("write_footer");
|
DBUG_ENTER("write_footer");
|
||||||
/*
|
/*
|
||||||
footer contains the checksum-algorithm descriptor
|
(optional) footer contains the checksum value
|
||||||
followed by the checksum value
|
|
||||||
*/
|
*/
|
||||||
if (need_checksum())
|
if (need_checksum())
|
||||||
{
|
{
|
||||||
@@ -1171,7 +1170,7 @@ bool Log_event::write_footer(IO_CACHE* file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Log_event::write()
|
Log_event::write_header()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool Log_event::write_header(IO_CACHE* file, ulong event_data_length)
|
bool Log_event::write_header(IO_CACHE* file, ulong event_data_length)
|
||||||
@@ -1209,29 +1208,8 @@ bool Log_event::write_header(IO_CACHE* file, ulong event_data_length)
|
|||||||
else if (!log_pos)
|
else if (!log_pos)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Calculate position of end of event
|
Calculate the position of where the next event will start
|
||||||
|
(end of this event, that is).
|
||||||
Note that with a SEQ_READ_APPEND cache, my_b_tell() does not
|
|
||||||
work well. So this will give slightly wrong positions for the
|
|
||||||
Format_desc/Rotate/Stop events which the slave writes to its
|
|
||||||
relay log. For example, the initial Format_desc will have
|
|
||||||
end_log_pos=91 instead of 95. Because after writing the first 4
|
|
||||||
bytes of the relay log, my_b_tell() still reports 0. Because
|
|
||||||
my_b_append() does not update the counter which my_b_tell()
|
|
||||||
later uses (one should probably use my_b_append_tell() to work
|
|
||||||
around this). To get right positions even when writing to the
|
|
||||||
relay log, we use the (new) my_b_safe_tell().
|
|
||||||
|
|
||||||
Note that this raises a question on the correctness of all these
|
|
||||||
DBUG_ASSERT(my_b_tell()=rli->event_relay_log_pos).
|
|
||||||
|
|
||||||
If in a transaction, the log_pos which we calculate below is not
|
|
||||||
very good (because then my_b_safe_tell() returns start position
|
|
||||||
of the BEGIN, so it's like the statement was at the BEGIN's
|
|
||||||
place), but it's not a very serious problem (as the slave, when
|
|
||||||
it is in a transaction, does not take those end_log_pos into
|
|
||||||
account (as it calls inc_event_relay_log_pos()). To be fixed
|
|
||||||
later, so that it looks less strange. But not bug.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
log_pos= my_b_safe_tell(file)+data_written;
|
log_pos= my_b_safe_tell(file)+data_written;
|
||||||
@@ -1341,7 +1319,7 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet,
|
|||||||
file->error will have been set to number of bytes left to read
|
file->error will have been set to number of bytes left to read
|
||||||
2. Read was interrupted, file->error would normally be set to -1
|
2. Read was interrupted, file->error would normally be set to -1
|
||||||
3. Failed to allocate memory for packet, my_errno
|
3. Failed to allocate memory for packet, my_errno
|
||||||
will be ENOMEM(file->error shuold be 0, but since the
|
will be ENOMEM(file->error should be 0, but since the
|
||||||
memory allocation occurs before the call to read it might
|
memory allocation occurs before the call to read it might
|
||||||
be uninitialized)
|
be uninitialized)
|
||||||
*/
|
*/
|
||||||
@@ -2737,7 +2715,7 @@ void Query_log_event::pack_info(THD *thd, Protocol *protocol)
|
|||||||
/**
|
/**
|
||||||
Utility function for the next method (Query_log_event::write()) .
|
Utility function for the next method (Query_log_event::write()) .
|
||||||
*/
|
*/
|
||||||
static void write_str_with_code_and_len(uchar **dst, const char *src,
|
static void store_str_with_code_and_len(uchar **dst, const char *src,
|
||||||
uint len, uint code)
|
uint len, uint code)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -2833,7 +2811,7 @@ bool Query_log_event::write(IO_CACHE* file)
|
|||||||
}
|
}
|
||||||
if (catalog_len) // i.e. this var is inited (false for 4.0 events)
|
if (catalog_len) // i.e. this var is inited (false for 4.0 events)
|
||||||
{
|
{
|
||||||
write_str_with_code_and_len(&start,
|
store_str_with_code_and_len(&start,
|
||||||
catalog, catalog_len, Q_CATALOG_NZ_CODE);
|
catalog, catalog_len, Q_CATALOG_NZ_CODE);
|
||||||
/*
|
/*
|
||||||
In 5.0.x where x<4 masters we used to store the end zero here. This was
|
In 5.0.x where x<4 masters we used to store the end zero here. This was
|
||||||
@@ -2871,7 +2849,7 @@ bool Query_log_event::write(IO_CACHE* file)
|
|||||||
{
|
{
|
||||||
/* In the TZ sys table, column Name is of length 64 so this should be ok */
|
/* In the TZ sys table, column Name is of length 64 so this should be ok */
|
||||||
DBUG_ASSERT(time_zone_len <= MAX_TIME_ZONE_NAME_LENGTH);
|
DBUG_ASSERT(time_zone_len <= MAX_TIME_ZONE_NAME_LENGTH);
|
||||||
write_str_with_code_and_len(&start,
|
store_str_with_code_and_len(&start,
|
||||||
time_zone_str, time_zone_len, Q_TIME_ZONE_CODE);
|
time_zone_str, time_zone_len, Q_TIME_ZONE_CODE);
|
||||||
}
|
}
|
||||||
if (lc_time_names_number)
|
if (lc_time_names_number)
|
||||||
|
@@ -1239,10 +1239,12 @@ public:
|
|||||||
write_data_body(file) ||
|
write_data_body(file) ||
|
||||||
write_footer(file));
|
write_footer(file));
|
||||||
}
|
}
|
||||||
virtual bool write_data_header(IO_CACHE* file)
|
virtual bool write_data_header(IO_CACHE* file __attribute__((unused)))
|
||||||
{ return 0; }
|
{ return 0; }
|
||||||
virtual bool write_data_body(IO_CACHE* file __attribute__((unused)))
|
virtual bool write_data_body(IO_CACHE* file __attribute__((unused)))
|
||||||
{ return 0; }
|
{ return 0; }
|
||||||
|
|
||||||
|
/* Return start of query time or current time */
|
||||||
inline my_time_t get_time()
|
inline my_time_t get_time()
|
||||||
{
|
{
|
||||||
THD *tmp_thd;
|
THD *tmp_thd;
|
||||||
@@ -1321,8 +1323,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
const char* get_type_str();
|
const char* get_type_str();
|
||||||
|
|
||||||
/* Return start of query time or current time */
|
|
||||||
|
|
||||||
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
|
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@@ -1009,7 +1009,7 @@ void Relay_log_info::inc_group_relay_log_pos(ulonglong log_pos,
|
|||||||
group_relay_log_pos= event_relay_log_pos;
|
group_relay_log_pos= event_relay_log_pos;
|
||||||
strmake_buf(group_relay_log_name, event_relay_log_name);
|
strmake_buf(group_relay_log_name, event_relay_log_name);
|
||||||
notify_group_relay_log_name_update();
|
notify_group_relay_log_name_update();
|
||||||
if (log_pos) // 3.23 binlogs don't have log_posx
|
if (log_pos) // not 3.23 binlogs (no log_pos there) and not Stop_log_event
|
||||||
group_master_log_pos= log_pos;
|
group_master_log_pos= log_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user