Description:
Some of the error messages are logged with the Client Ids using
New error logging APIs
mysqld.cc:
...
switch (err)
{
case ER_WARN_BINLOG_PARTIAL_UPDATES_DISABLED:
case ER_WARN_BINLOG_PARTIAL_UPDATES_SUGGESTS_PARTIAL_IMAGES:
LogErr(WARNING_LEVEL, err, msg, "PARTIAL_JSON");
break;
case ER_WARN_BINLOG_V1_ROW_EVENTS_DISABLED:
LogErr(WARNING_LEVEL, err, msg);
...
rpl_slave.cc:
...
if ((slave_errno == ER_STOP_SLAVE_SQL_THREAD_TIMEOUT) ||
(slave_errno == ER_STOP_SLAVE_IO_THREAD_TIMEOUT))
{
push_warning(thd, Sql_condition::SL_NOTE, slave_errno,
ER_THD(thd, slave_errno));
/*
If new slave_errno is added in the if() condition above then make sure
that there are no % in the error message or change the logging API
to use verbatim() to avoid % substitutions.
*/
LogErr(WARNING_LEVEL, slave_errno);
...
How to repeat:
1 ) ER_WARN_BINLOG_PARTIAL_UPDATES_DISABLED
MTR_TEST: main.binlog_partial_json_warnings
2018-02-05T05:37:06.446102Z 0 [Warning] [MY-003645] When binlog_format=STATEMENT, the option binlog_row_value_options=PARTIAL_JSON will be ignored and updates will be written in full format to binary log.
2) "ER_WARN_BINLOG_PARTIAL_UPDATES_SUGGESTS_PARTIAL_IMAGES"
MTR_TEST: main.binlog_partial_json_warnings
2018-02-05T05:37:09.179592Z 0 [Warning] [MY-003647] When binlog_row_image=FULL, the option binlog_row_value_options=PARTIAL_JSON will be used only for the after-image. Full values will be written in the before-image, so the saving in disk space due to binlog_row_value_options is limited to less than 50%.
3) "ER_WARN_BINLOG_V1_ROW_EVENTS_DISABLED"
MTR_TEST: main.binlog_partial_json_warnings
2018-02-05T05:37:11.966870Z 0 [Warning] [MY-003646] When binlog_row_value_options=PARTIAL_JSON, the option log_bin_use_v1_row_events=1 will be ignored and row events will be written in new format to binary log.
4) ER_STOP_SLAVE_SQL_THREAD_TIMEOUT
MTR_TEST: i_rpl.rpl_stop_slave_timeout
2018-02-05T09:47:40.790928Z 13 [Warning] [MY-001875] STOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is complete.
5) ER_STOP_SLAVE_IO_THREAD_TIMEOUT
MTR_TEST: i_rpl.rpl_stop_slave_timeout 'mix'
2018-02-05T05:54:57.098459Z 59 [Warning] [MY-001876] STOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is complete.
Suggested fix:
Use error messages Ids to log error messages.