Description:
The code generating this message is:
fprintf(file,
"--Thread %lu has waited at %s line %lu"
" for %.2f seconds the semaphore:\n",
(ulong) os_thread_pf(cell->thread),
innobase_basename(cell->file), (ulong) cell->line,
difftime(time(NULL), cell->reservation_time));
So the result of difftime() is printed using %.2f as format.
difftime() never returns fractional if implemented according to the standard though:
"... The difftime() function shall return the difference expressed in seconds as a type double. ..."
(see eg. http://pubs.opengroup.org/onlinepubs/009695399/functions/difftime.html )
(the fact that it returns double instead of time_t is probably that time_t may be unsigned ...?)
So those extra two decimals give a false sense of precision that isn't actually there, and just printing the number of seconds without decimals would be sufficient
How to repeat:
see above
Suggested fix:
change %.2f format specifier to %.0f, or use %d and cast to (int) ...?
Description: The code generating this message is: fprintf(file, "--Thread %lu has waited at %s line %lu" " for %.2f seconds the semaphore:\n", (ulong) os_thread_pf(cell->thread), innobase_basename(cell->file), (ulong) cell->line, difftime(time(NULL), cell->reservation_time)); So the result of difftime() is printed using %.2f as format. difftime() never returns fractional if implemented according to the standard though: "... The difftime() function shall return the difference expressed in seconds as a type double. ..." (see eg. http://pubs.opengroup.org/onlinepubs/009695399/functions/difftime.html ) (the fact that it returns double instead of time_t is probably that time_t may be unsigned ...?) So those extra two decimals give a false sense of precision that isn't actually there, and just printing the number of seconds without decimals would be sufficient How to repeat: see above Suggested fix: change %.2f format specifier to %.0f, or use %d and cast to (int) ...?