1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/new/mysql-5.0-marvel

into  a88-113-38-195.elisa-laajakaista.fi:/home/my/new/mysql-5.1-marvel
This commit is contained in:
jani@a88-113-38-195.elisa-laajakaista.fi
2007-04-13 10:25:33 +03:00
7 changed files with 342 additions and 51 deletions

View File

@ -1099,7 +1099,7 @@ static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
uint logname_len;
NET* net;
int error= 0;
my_off_t old_off= min(start_position_mot, BIN_LOG_HEADER_SIZE);
my_off_t old_off= start_position_mot;
char fname[FN_REFLEN+1];
DBUG_ENTER("dump_remote_log_entries");
@ -1217,6 +1217,18 @@ could be out of memory");
len= 1; // fake Rotate, so don't increment old_off
}
}
else if (type == FORMAT_DESCRIPTION_EVENT)
{
/*
This could be an fake Format_description_log_event that server
(5.0+) automatically sends to a slave on connect, before sending
a first event at the requested position. If this is the case,
don't increment old_off. Real Format_description_log_event always
starts from BIN_LOG_HEADER_SIZE position.
*/
if (old_off != BIN_LOG_HEADER_SIZE)
len= 1; // fake event, don't increment old_off
}
if ((error= process_event(print_event_info, ev, old_off)))
{
error= ((error < 0) ? 0 : 1);
@ -1229,16 +1241,16 @@ could be out of memory");
const char *old_fname= le->fname;
uint old_len= le->fname_len;
File file;
if ((file= load_processor.prepare_new_file_for_old_format(le,fname)) < 0)
{
error= 1;
goto err;
}
if ((error= process_event(print_event_info, ev, old_off)))
{
my_close(file,MYF(MY_WME));
my_close(file,MYF(MY_WME));
error= ((error < 0) ? 0 : 1);
goto err;
}
@ -1253,15 +1265,8 @@ could be out of memory");
/*
Let's adjust offset for remote log as for local log to produce
similar text and to have --stop-position to work identically.
Exception - the server sends Format_description_log_event
in the beginning of the dump, and only after it the event from
start_position. Let the old_off reflect it.
*/
if (old_off < start_position_mot)
old_off= start_position_mot;
else
old_off+= len-1;
old_off+= len-1;
}
err: