1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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
This commit is contained in:
monty@mysql.com/nosik.monty.fi
2007-08-01 22:59:05 +03:00
parent b16289a5e0
commit 96f90711a7
24 changed files with 245 additions and 127 deletions

View File

@ -15,7 +15,7 @@
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
#define CHECK_VERSION "2.4.5"
#define CHECK_VERSION "2.5.0"
#include "client_priv.h"
#include <m_ctype.h>
@ -33,10 +33,11 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
opt_compress = 0, opt_databases = 0, opt_fast = 0,
opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0,
opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0,
tty_password= 0, opt_frm= 0, info_flag= 0,
tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0,
opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0,
opt_write_binlog= 1;
static uint verbose = 0, opt_mysql_port=0;
static int my_end_arg;
static char * opt_mysql_unix_port = 0;
static char *opt_password = 0, *current_user = 0,
*default_charset = (char *)MYSQL_DEFAULT_CHARSET_NAME,
@ -96,8 +97,12 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (uchar**) &info_flag,
(uchar**) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (uchar**) &default_charset,
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -375,6 +380,10 @@ static int get_options(int *argc, char ***argv)
}
if (tty_password)
opt_password = get_tty_password(NullS);
if (debug_info_flag)
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
if (debug_check_flag)
my_end_arg= MY_CHECK_ERROR;
return(0);
} /* get_options */
@ -762,7 +771,7 @@ int main(int argc, char **argv)
*/
if (get_options(&argc, &argv))
{
my_end(info_flag ? MY_CHECK_ERROR : 0);
my_end(my_end_arg);
exit(EX_USAGE);
}
if (dbConnect(current_host, current_user, opt_password))
@ -804,6 +813,6 @@ int main(int argc, char **argv)
#ifdef HAVE_SMEM
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif
my_end(info_flag ? MY_CHECK_ERROR : 0);
my_end(my_end_arg);
return(first_error!=0);
} /* main */