1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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.
This commit is contained in:
Andrei Elkin
2012-01-19 16:44:09 +02:00
parent 8c894564ab
commit f91c2d33f4
8 changed files with 23 additions and 21 deletions

View File

@ -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);