• Luis Soares's avatar
    BUG#23300: Slow query log on slave does not log slow replicated statements · 7cf99622
    Luis Soares authored
          
    NOTE: this is the backport to next-mr.
          
    When using replication, the slave will not log any slow query logs queries 
    replicated from the master, even if the option "--log-slow-slave-statements" 
    is set and these take more than "log_query_time" to execute.
                  
    In order to log slow queries in replicated thread one needs to set the
    --log-slow-slave-statements, so that the SQL thread is initialized with the 
    correct switch. Although setting this flag correctly configures the slave 
    thread option to log slow queries, there is an issue with the condition that 
    is used to check whether to log the slow query or not. When replaying binlog 
    events the statement contains the SET TIMESTAMP clause which will force the 
    slow logging condition check to fail. Consequently, the slow query logging will
    not take place.
                  
    This patch addresses this issue by removing the second condition from the
    log_slow_statements as it prevents slow queries to be binlogged and seems 
    to be deprecated.
    7cf99622
rpl_slow_query_log.test 5.5 KB