diff options
author | unknown <monty@nosik.monty.fi> | 2007-08-02 07:55:33 +0300 |
---|---|---|
committer | unknown <monty@nosik.monty.fi> | 2007-08-02 07:55:33 +0300 |
commit | 926664fe2c802bd7ffc6d9a6b56372ba2e142b23 (patch) | |
tree | 5c544cc45c47bbd06c8b4d216aab02fe9307f8de /client/mysqlslap.c | |
parent | ccada6ff956e2fed0347051890445049ec9ed8df (diff) | |
parent | f9ea427508fa5451bd22c0d6366a855a4d88800d (diff) | |
download | mariadb-git-926664fe2c802bd7ffc6d9a6b56372ba2e142b23.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into mysql.com:/home/my/mysql-5.1
client/client_priv.h:
Auto merged
client/mysqldump.c:
Auto merged
client/mysqlslap.c:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
mysql-test/t/disabled.def:
Auto merged
sql/event_data_objects.cc:
Auto merged
sql/event_queue.cc:
Auto merged
sql/ha_partition.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/log.cc:
Auto merged
sql/log.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_plugin.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql-common/client.c:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_cache.cc:
Manual merge
Removed comment about bug in old code (not relevant)
Diffstat (limited to 'client/mysqlslap.c')
-rw-r--r-- | client/mysqlslap.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/client/mysqlslap.c b/client/mysqlslap.c index aa15141bfdc..a550dcae260 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 @@ -131,10 +131,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, @@ -149,13 +147,14 @@ static uint commit_rate; static uint detach_rate; 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; @@ -410,7 +409,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; } @@ -569,6 +568,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, @@ -672,7 +676,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); } @@ -731,6 +735,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; case '#': DBUG_PUSH(argument ? argument : default_dbug_option); + debug_check_flag= 1; break; #include <sslopt-case.h> case 'V': @@ -1126,6 +1131,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"; |