From 797a44a9ec5a601a4745b9520c2dea321f96d155 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sat, 22 Mar 2014 12:32:36 +0200 Subject: [PATCH] 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. --- sql/sql_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_test.cc b/sql/sql_test.cc index c64a5d182a5..ae16a281277 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -615,7 +615,6 @@ Next alarm time: %lu\n", (ulong)alarm_info.next_alarm_time); #endif display_table_locks(); - fflush(stdout); #ifdef HAVE_MALLINFO struct mallinfo info= mallinfo(); printf("\nMemory status:\n\ @@ -647,4 +646,5 @@ Estimated memory (with thread stack): %ld\n", Events::dump_internal_status(); #endif puts(""); + fflush(stdout); }