From f91c2d33f4ba3c9b5b69652bd045632c8085f30f Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Thu, 19 Jan 2012 16:44:09 +0200 Subject: bug#3593869-64035 A follow-up patch corrects max sizes of printed strings and changes llstr() to %lld. Credits go to Davi who provided a great feedback. sql/share/errmsg-utf8.txt: Max size for the whole message is 512 so a part of - like '%-.512s' should be less, reduction to 320 is safe and with good chances won't cut off a part of a rather log message in Last_IO_Error = 'Got fatal error 1236 ...' sql/sql_repl.cc: llstr() is replaced by %lld. --- sql/sql_repl.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'sql/sql_repl.cc') diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 605acc1f393..511c5581dae 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -447,7 +447,6 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, String* packet = &thd->packet; int error; const char *errmsg = "Unknown error"; - char llbuff0[22], llbuff1[22], llbuff2[22]; char error_text[MAX_SLAVE_ERRMSG]; // to be send to slave via my_message() NET* net = &thd->net; mysql_mutex_t *log_lock; @@ -1034,12 +1033,14 @@ err: detailing the fatal error message with coordinates of the last position read. */ - const char *fmt= "%s; the start event position from '%s' at %s, the last event was read from '%s' at %s, the last byte read was read from '%s' at %s."; - my_snprintf(error_text, sizeof(error_text), fmt, errmsg, - p_start_coord->file_name, - (llstr(p_start_coord->pos, llbuff0), llbuff0), - p_coord->file_name, (llstr(p_coord->pos, llbuff1), llbuff1), - log_file_name, (llstr(my_b_tell(&log), llbuff2), llbuff2)); + my_snprintf(error_text, sizeof(error_text), + "%s; the first event '%s' at %lld, " + "the last event read from '%s' at %lld, " + "the last byte read from '%s' at %lld.", + errmsg, + p_start_coord->file_name, p_start_coord->pos, + p_coord->file_name, p_coord->pos, + log_file_name, my_b_tell(&log)); } else strcpy(error_text, errmsg); -- cgit v1.2.1