Luís, hello.
The patch is okay. Considering one suggestion I made
>> > There is one more place in the code
>> > bool LOGGER::slow_log_print() referring to `opt_log_slow_slave_statements'
>> >
>> > if (thd->slave_thread && !opt_log_slow_slave_statements)
>> > return 0;
>> >
>> > rather than to `enable_slow_log'. That piece of code is actually
>> > completely extraneous because the caller of the function is to check
> `enable_slow_log'
>> > before to call the func.
>> >
>> > I suggest to remove the referred snippet.
>>
>> Hmm... I opted to keep this one. The opt_log_slow_slave_statements may
>> be used to enable disable from a regular connnection the slow query
>> logging for replication thread (as one seems to be able to do with
>> regular connections). Nevertheless, there seems to be some lack of
>> support for this in the opt_log_slow_slave_statements (as there is for
>> opt_slow_log).
>
> I mean, opt_slow_slave_statements is not dynamic.
>
Ok, I can stand it.
We have two flags managing the execution flow control:
1. if (thd->enable_slow_log)
slow_log_print()
2. and inside slow_log_print():
if (thd->slave_thread && !opt_log_slow_slave_statements)
return 0;
As
thd->enable_slow_log := opt_log_slow_slave_statements
`return 0' is impossible. If you don't like to remove then
you are better to assert that.
cheers,
Andrei