Andrei Elkin wrote:
> Alfranio, Zhen Xing, hello.
>
> > Alfranio Correia wrote:
> >
> > Hi Jasonh,
> >
> > I like your idea:
> >
> > "I'm thinking about maybe we can use the command flags setupped in
> > init_update_queries(), such as CF_AUTO_COMMIT_TRANS, or maybe we can
> > define a new flag."
> >
> >
> > Maybe we could create a new flag and remove the "direct" flag from
> > the MYSQL_BIN_LOG::write().
>
> To repeat (and clarify on), we have had the bool is_trans which I find
> is better to be an exact qualifier where the being logged stuff should
> go.
> And we have three choices with the patch: the direct, the T-cache, and
> the N-cache.
>
I agree that the direct argument should be removed.
I only see three cases where direct is set to true (please point out if
there are other cases):
1) for DDL, in this case it can be checked within the function
2) for Incident events, this can also be checked within the function
3) in close_temporary_tables(THD *thd) for the statement to drop
temporary tables, I think in this case, it does not matter to write it
directly or at the end of the statement through the S-cache.
So in short, I think the direct argument can be removed.
> I still think there is nothing to remove in the base code, not to add
> the new direct bool as well, but rather to convert the existing `bool
> is_trans' into an enum having the three values.
>
I think we do not need to make is_trans into an enum. See above comment.
> > Note that this is orthogonal to the
> > call to thd->binlog_start_trans_and_stmt().
>
> I realize that.
>
> > However, if you both
> > want we can avoid calling such method when processing a DDL. I don't
> > have a strong opinion. And if we adopt the flag, I think we should
> > not call thd->binlog_start_trans_and_stmt() when processing DDLs.
> >
>
> I don't see a good reason to call thd->binlog_start_trans_and_stmt()
> for DDL either.
> However, for the current work I would stay concervative.
>
> > Andrei, what do you think about Jasonh's suggestion?
> >
>
> cheers,
>
> Andrei
>