| List: | Commits | « Previous MessageNext Message » | |
| From: | He Zhenxing | Date: | September 29 2009 1:07pm |
| Subject: | Re: bzr commit into mysql-5.1-bugteam branch (Dao-Gang.Qu:3117) Bug#46640 | ||
| View as plain text | |||
Daogang Qu wrote: > Sven Sandberg 写道: > > Daogang Qu wrote: > > [...] > Sorry, what's this? There are lines that's been snipped. > >>>> === modified file 'sql/sql_binlog.cc' > >>>> --- a/sql/sql_binlog.cc 2009-01-09 12:49:24 +0000 > >>>> +++ b/sql/sql_binlog.cc 2009-09-28 05:34:02 +0000 > > [...] > >>>> @@ -209,9 +211,27 @@ void mysql_client_binlog_statement(THD* > >>>> reporting. > >>>> */ > >>>> #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) > >>>> - if (apply_event_and_update_pos(ev, thd, thd->rli_fake, FALSE)) > >>>> + err= ev->apply_event(rli); > >>>> +#else > >>>> + err= 0; > >>>> +#endif > >>>> + if (ev->get_type_code() == FORMAT_DESCRIPTION_EVENT) > >>>> + { > >>>> + /* > >>>> + Install this as the format description event to use for any > >>>> + following events. > >>>> + */ > >>>> + delete rli->relay_log.description_event_for_exec; > >>>> + rli->relay_log.description_event_for_exec= > >>>> + static_cast<Format_description_log_event *>(ev); > >>>> + } > >>>> + else > >>> > >>> (S2) > >>> This duplicates code from > >>> Format_description_log_event::do_update_pos. Can't you move it to > >>> Format_description_log_event::do_apply_event instead? I think it > >>> makes more sense to have it there anyway. > >> The compile can't be passed, if we move it to > >> Format_description_log_event::do_apply_event. > > > > What compiler error do you get? The only thing I can think of that > > would go wrong is that rli is const, but you can just cast that: > > > > delete > > > (const_cast<Relay_log_info*>rli)->relay_log.description_event_for_exec; > > > > etc. Let me know if there are other problems or if there is anything I > > can help with! > > > > /Sven > Right. It worked now. Thanks! > > > >>> > >>>> { > >>>> delete ev; > >>>> + } > >>>> + ev= 0; > >>>> + if (err) > >>>> + { > >>>> /* > >>>> TODO: Maybe a better error message since the BINLOG statement > >>>> now contains several events. > >>>> @@ -219,17 +239,6 @@ void mysql_client_binlog_statement(THD* > >>>> my_error(ER_UNKNOWN_ERROR, MYF(0), "Error executing BINLOG > >>>> statement"); > >>>> goto end; > >>>> } > >>>> -#endif > >>>> - > >>>> - /* > >>>> - Format_description_log_event should not be deleted because it > >>>> - will be used to read info about the relay log's format; it > >>>> - will be deleted when the SQL thread does not need it, > >>>> - i.e. when this thread terminates. > >>>> - */ > >>>> - if (ev->get_type_code() != FORMAT_DESCRIPTION_EVENT) > >>>> - delete ev; > >>>> - ev= 0; > >>>> } > >>>> } > >>>> > >>>> @@ -238,7 +247,7 @@ void mysql_client_binlog_statement(THD* > >>>> my_ok(thd); > >>>> > >>>> end: > >>>> - thd->rli_fake->clear_tables_to_lock(); > >>>> + rli->clear_tables_to_lock(); > >>>> my_free(buf, MYF(MY_ALLOW_ZERO_PTR)); > >>>> DBUG_VOID_RETURN; > >>>> } > >>>> > >>>> > >>>> > >>>> > ------------------------------------------------------------------------ > >>>> > >>>> > >>>> > >>> > >>> > >> > > > > > >
