diff options
author | monty@mysql.com/nosik.monty.fi <> | 2007-08-01 22:59:05 +0300 |
---|---|---|
committer | monty@mysql.com/nosik.monty.fi <> | 2007-08-01 22:59:05 +0300 |
commit | 96f90711a7fb6f6c33b56b0c6519e1f1a7226277 (patch) | |
tree | ea014474c5b5d34f211415d0a43cbc13631ccdfc /client/mysqlcheck.c | |
parent | b16289a5e05397211fd47e05ce08fe12f93ec38a (diff) | |
download | mariadb-git-96f90711a7fb6f6c33b56b0c6519e1f1a7226277.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
Diffstat (limited to 'client/mysqlcheck.c')
-rw-r--r-- | client/mysqlcheck.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 372dfe860df..622975c51d5 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -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 */ |