summaryrefslogtreecommitdiff
path: root/mysys/my_init.c
diff options
context:
space:
mode:
authorunknown <monty@mysql.com/nosik.monty.fi>2007-08-01 22:59:05 +0300
committerunknown <monty@mysql.com/nosik.monty.fi>2007-08-01 22:59:05 +0300
commitb6abe0d2c37fe0e4bf5555c63208a3ee9cb25668 (patch)
treeea014474c5b5d34f211415d0a43cbc13631ccdfc /mysys/my_init.c
parent21e25f8bf584f587ab6167d467e4e29f2892a47c (diff)
downloadmariadb-git-b6abe0d2c37fe0e4bf5555c63208a3ee9cb25668.tar.gz
Fixes Bug#30127: --debug-info no longer prints memory usage in mysql
Fixed compiler warnings, errors and link errors Fixed new bug on Solaris with gethrtime() Added --debug-check option to all mysql clients to print errors and memory leaks Added --debug-info to all clients. This now works as --debug-check but also prints memory and cpu usage BUILD/compile-solaris-sparc-debug: Remove old cpu options client/client_priv.h: Added OPT_DBUG_CHECK client/mysql.cc: --debug-info now prints memory usage Added --debug-check client/mysql_upgrade.c: --debug-info now prints memory usage Added --debug-check client/mysqladmin.cc: --debug-info now prints memory usage Added --debug-check client/mysqlbinlog.cc: --debug-info now prints memory usage Added --debug-check client/mysqlcheck.c: --debug-info now prints memory usage Added --debug-check client/mysqldump.c: --debug-info now prints memory usage Added --debug-check client/mysqlimport.c: --debug-info now prints memory usage Added --debug-check client/mysqlshow.c: --debug-info now prints memory usage Added --debug-check client/mysqlslap.c: --debug-info now prints memory usage Added --debug-check client/mysqltest.c: --debug-info now prints memory usage Added --debug-check include/my_sys.h: Added extra option to TERMINATE to not print statistics libmysql/libmysql.c: Fixed compiler warning mysql-test/mysql-test-run.pl: --debug-info -> --debug-check to not print memory usage mysys/my_getsystime.c: Moved fast time calculation to my_micro_time_and_time() Fixed bug in previous push related to HAVE_GETHRTIME mysys/my_init.c: Print not freed memory in my_end() if MY_CHECK_ERROR is given mysys/my_static.c: Cleanup mysys/safemalloc.c: Added extra option to TERMINATE to not print statistics sql/item_xmlfunc.cc: Fixed compiler warning sql/sql_test.cc: Fixed TERMINATE() call unittest/mysys/base64-t.c: Fixed link error unittest/mysys/bitmap-t.c: Fixed link error unittest/mysys/my_atomic-t.c: Fixed link error
Diffstat (limited to 'mysys/my_init.c')
-rw-r--r--mysys/my_init.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 8281d7ced99..127e94c958b 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -130,8 +130,9 @@ void my_end(int infoflag)
*/
FILE *info_file= DBUG_FILE;
my_bool print_info= (info_file != stderr);
- /* We do not use DBUG_ENTER here, as after cleanup DBUG is no longer
- operational, so we cannot use DBUG_RETURN.
+ /*
+ We do not use DBUG_ENTER here, as after cleanup DBUG is no longer
+ operational, so we cannot use DBUG_RETURN.
*/
DBUG_PRINT("info",("Shutting down"));
if (!info_file)
@@ -185,7 +186,7 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
fprintf(info_file,"\nRun time: %.1f\n",(double) clock()/CLOCKS_PER_SEC);
#endif
#if defined(SAFEMALLOC)
- TERMINATE(stderr); /* Give statistic on screen */
+ TERMINATE(stderr, 1); /* Give statistic on screen */
#elif defined(__WIN__) && defined(_MSC_VER)
_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR );
@@ -197,6 +198,10 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
_CrtDumpMemoryLeaks();
#endif
}
+ else if (infoflag & MY_CHECK_ERROR)
+ {
+ TERMINATE(stderr, 0); /* Print memory leaks on screen */
+ }
if (!(infoflag & MY_DONT_FREE_DBUG))
{