Skip to content

Commit

Permalink
Fixed warning for maria.maria-recovery2 about crashed table
Browse files Browse the repository at this point in the history
The bug was a missing va_start in eprint() which caused a wrong table
name to be printed.
Patch backported from 10.3.
  • Loading branch information
montywi committed Mar 18, 2022
1 parent 22fd31c commit 74e668e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions storage/maria/ma_recovery_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ void tprint(FILE *trace_file __attribute__ ((unused)),
va_list args;
#ifndef DBUG_OFF
{
char buff[1024], *end;
char buff[1024];
size_t length;
va_start(args, format);
vsnprintf(buff, sizeof(buff)-1, format, args);
if (*(end= strend(buff)) == '\n')
*end= 0; /* Don't print end \n */
length= my_vsnprintf(buff, sizeof(buff)-1, format, args);
if (length && buff[length-1] == '\n')
buff[length-1]= 0; /* Don't print end \n */
DBUG_PRINT("info", ("%s", buff));
va_end(args);
}
Expand Down Expand Up @@ -95,6 +96,7 @@ void eprint(FILE *trace_file __attribute__ ((unused)),
fputc('\n', trace_file);
if (trace_file != stderr)
{
va_start(args, format);
my_printv_error(HA_ERR_INITIALIZATION, format, MYF(0), args);
}
va_end(args);
Expand Down

0 comments on commit 74e668e

Please sign in to comment.