Commit 797a44a9 authored by Michael Widenius's avatar Michael Widenius Committed by Michael Widenius

MDEV-734: LP:917662 - mysql_print_status() missing final fflush()

Patch from 5.6 by Praveenkumar Hulakund
Bug#13608112 - 64048: MYSQL_PRINT_STATUS() MISSING FINAL FFLUSH()
  
  Analysis:
  While printing debug information, memory related information and event
  related information were written to buffer after flushing it. Because of this,
  these information were getting printed when we do the next flush.
  
  Fix:
  Instead of calling fflush() before writing memory and event
  information, calling it after memory and event information.
parent dca4b915
...@@ -615,7 +615,6 @@ Next alarm time: %lu\n", ...@@ -615,7 +615,6 @@ Next alarm time: %lu\n",
(ulong)alarm_info.next_alarm_time); (ulong)alarm_info.next_alarm_time);
#endif #endif
display_table_locks(); display_table_locks();
fflush(stdout);
#ifdef HAVE_MALLINFO #ifdef HAVE_MALLINFO
struct mallinfo info= mallinfo(); struct mallinfo info= mallinfo();
printf("\nMemory status:\n\ printf("\nMemory status:\n\
...@@ -647,4 +646,5 @@ Estimated memory (with thread stack): %ld\n", ...@@ -647,4 +646,5 @@ Estimated memory (with thread stack): %ld\n",
Events::dump_internal_status(); Events::dump_internal_status();
#endif #endif
puts(""); puts("");
fflush(stdout);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment