summaryrefslogtreecommitdiff
path: root/client/mysqlslap.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
commit0c9a3e597d329c5475d4fec0a6f95ac87d65ca19 (patch)
treeea014474c5b5d34f211415d0a43cbc13631ccdfc /client/mysqlslap.c
parentb59217ebbbb9c2869ab914805729b3ca57c976fa (diff)
downloadmariadb-git-0c9a3e597d329c5475d4fec0a6f95ac87d65ca19.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 'client/mysqlslap.c')
-rw-r--r--client/mysqlslap.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 546b9dee3f5..33173858228 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -69,7 +69,7 @@ TODO:
*/
-#define SHOW_VERSION "0.9"
+#define SLAP_VERSION "1.0"
#define HUGE_STRING_LENGTH 8196
#define RAND_STRING_SIZE 126
@@ -128,10 +128,8 @@ const char *delimiter= "\n";
const char *create_schema_string= "mysqlslap";
-static my_bool opt_preserve;
-
+static my_bool opt_preserve= 0, debug_info_flag= 0, debug_check_flag= 0;
static my_bool opt_only_print= FALSE;
-
static my_bool opt_compress= FALSE, tty_password= FALSE,
opt_silent= FALSE,
auto_generate_sql_autoincrement= FALSE,
@@ -144,13 +142,14 @@ static unsigned long connect_flags= CLIENT_MULTI_RESULTS;
static int verbose, delimiter_length;
const char *num_int_cols_opt;
const char *num_char_cols_opt;
+
/* Yes, we do set defaults here */
static unsigned int num_int_cols= 1;
static unsigned int num_char_cols= 1;
static unsigned int num_int_cols_index= 0;
static unsigned int num_char_cols_index= 0;
-
static unsigned int iterations;
+static uint my_end_arg= 0;
static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
static ulonglong actual_queries= 0;
static ulonglong auto_actual_queries;
@@ -403,7 +402,7 @@ int main(int argc, char **argv)
my_free(shared_memory_base_name, MYF(MY_ALLOW_ZERO_PTR));
#endif
free_defaults(defaults_argv);
- my_end(0);
+ my_end(my_end_arg);
return 0;
}
@@ -546,6 +545,11 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
(uchar**) &default_dbug_option, (uchar**) &default_dbug_option, 0, GET_STR,
OPT_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", 'T', "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},
{"delimiter", 'F',
"Delimiter to use in SQL statements supplied in file or command line.",
(uchar**) &delimiter, (uchar**) &delimiter, 0, GET_STR, REQUIRED_ARG,
@@ -636,7 +640,7 @@ static struct my_option my_long_options[] =
static void print_version(void)
{
- printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,SHOW_VERSION,
+ printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname, SLAP_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
}
@@ -1090,6 +1094,10 @@ get_options(int *argc,char ***argv)
DBUG_ENTER("get_options");
if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
+ if (debug_info_flag)
+ my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
+ if (debug_check_flag)
+ my_end_arg= MY_CHECK_ERROR;
if (!user)
user= (char *)"root";