524
507
print_conclusions_csv(&conclusion);
509
my_free(head_sptr, MYF(0));
531
static struct option my_long_options[] =
514
static struct my_option my_long_options[] =
533
516
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
535
518
{"auto-generate-sql-select-columns", OPT_SLAP_AUTO_GENERATE_SELECT_COLUMNS,
536
"Provide a string to use for the select fields used in auto tests.",
537
(char**) &auto_generate_selected_columns_opt,
538
(char**) &auto_generate_selected_columns_opt,
539
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
519
"Provide a string to use for the select fields used in auto tests.",
520
(char**) &auto_generate_selected_columns_opt,
521
(char**) &auto_generate_selected_columns_opt,
522
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
540
523
{"auto-generate-sql", 'a',
541
"Generate SQL where not supplied by file or command line.",
542
(char**) &auto_generate_sql, (char**) &auto_generate_sql,
543
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
524
"Generate SQL where not supplied by file or command line.",
525
(char**) &auto_generate_sql, (char**) &auto_generate_sql,
526
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
544
527
{"auto-generate-sql-add-autoincrement", OPT_SLAP_AUTO_GENERATE_ADD_AUTO,
545
"Add an AUTO_INCREMENT column to auto-generated tables.",
546
(char**) &auto_generate_sql_autoincrement,
547
(char**) &auto_generate_sql_autoincrement,
548
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
528
"Add an AUTO_INCREMENT column to auto-generated tables.",
529
(char**) &auto_generate_sql_autoincrement,
530
(char**) &auto_generate_sql_autoincrement,
531
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
549
532
{"auto-generate-sql-execute-number", OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES,
550
"Set this number to generate a set number of queries to run.",
551
(char**) &auto_actual_queries, (char**) &auto_actual_queries,
552
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
533
"Set this number to generate a set number of queries to run.",
534
(char**) &auto_actual_queries, (char**) &auto_actual_queries,
535
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
553
536
{"auto-generate-sql-guid-primary", OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY,
554
"Add GUID based primary keys to auto-generated tables.",
555
(char**) &auto_generate_sql_guid_primary,
556
(char**) &auto_generate_sql_guid_primary,
557
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
537
"Add GUID based primary keys to auto-generated tables.",
538
(char**) &auto_generate_sql_guid_primary,
539
(char**) &auto_generate_sql_guid_primary,
540
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
558
541
{"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE,
559
"Specify test load type: mixed, update, write, key, or read; default is mixed.",
560
(char**) &opt_auto_generate_sql_type, (char**) &opt_auto_generate_sql_type,
561
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
562
{"auto-generate-sql-secondary-indexes",
563
OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES,
564
"Number of secondary indexes to add to auto-generated tables.",
565
(char**) &auto_generate_sql_secondary_indexes,
566
(char**) &auto_generate_sql_secondary_indexes, 0,
567
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
568
{"auto-generate-sql-unique-query-number",
569
OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM,
570
"Number of unique queries to generate for automatic tests.",
571
(char**) &auto_generate_sql_unique_query_number,
572
(char**) &auto_generate_sql_unique_query_number,
573
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
574
{"auto-generate-sql-unique-write-number",
575
OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM,
576
"Number of unique queries to generate for auto-generate-sql-write-number.",
577
(char**) &auto_generate_sql_unique_write_number,
578
(char**) &auto_generate_sql_unique_write_number,
579
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
542
"Specify test load type: mixed, update, write, key, or read; default is mixed.",
543
(char**) &opt_auto_generate_sql_type, (char**) &opt_auto_generate_sql_type,
544
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
545
{"auto-generate-sql-secondary-indexes",
546
OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES,
547
"Number of secondary indexes to add to auto-generated tables.",
548
(char**) &auto_generate_sql_secondary_indexes,
549
(char**) &auto_generate_sql_secondary_indexes, 0,
550
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
551
{"auto-generate-sql-unique-query-number",
552
OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM,
553
"Number of unique queries to generate for automatic tests.",
554
(char**) &auto_generate_sql_unique_query_number,
555
(char**) &auto_generate_sql_unique_query_number,
556
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
557
{"auto-generate-sql-unique-write-number",
558
OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM,
559
"Number of unique queries to generate for auto-generate-sql-write-number.",
560
(char**) &auto_generate_sql_unique_write_number,
561
(char**) &auto_generate_sql_unique_write_number,
562
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
580
563
{"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
581
"Number of row inserts to perform for each thread (default is 100).",
582
(char**) &auto_generate_sql_number, (char**) &auto_generate_sql_number,
583
0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
564
"Number of row inserts to perform for each thread (default is 100).",
565
(char**) &auto_generate_sql_number, (char**) &auto_generate_sql_number,
566
0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
584
567
{"burnin", OPT_SLAP_BURNIN, "Run full test case in infinite loop.",
585
(char**) &opt_burnin, (char**) &opt_burnin, 0, GET_BOOL, NO_ARG, 0, 0, 0,
587
{"ignore-sql-errors", OPT_SLAP_IGNORE_SQL_ERRORS,
588
"Ignore SQL erros in query run.",
589
(char**) &opt_ignore_sql_errors,
590
(char**) &opt_ignore_sql_errors,
591
0, GET_BOOL, NO_ARG, 0, 0, 0,
568
(char**) &opt_burnin, (char**) &opt_burnin, 0, GET_BOOL, NO_ARG, 0, 0, 0,
570
{"ignore-sql-errors", OPT_SLAP_IGNORE_SQL_ERRORS,
571
"Ignore SQL erros in query run.",
572
(char**) &opt_ignore_sql_errors,
573
(char**) &opt_ignore_sql_errors,
574
0, GET_BOOL, NO_ARG, 0, 0, 0,
593
576
{"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.",
594
(char**) &commit_rate, (char**) &commit_rate, 0, GET_UINT, REQUIRED_ARG,
577
(char**) &commit_rate, (char**) &commit_rate, 0, GET_UINT, REQUIRED_ARG,
579
{"compress", 'C', "Use compression in server/client protocol.",
580
(char**) &opt_compress, (char**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
596
582
{"concurrency", 'c', "Number of clients to simulate for query to run.",
597
(char**) &concurrency_str, (char**) &concurrency_str, 0, GET_STR,
598
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
583
(char**) &concurrency_str, (char**) &concurrency_str, 0, GET_STR,
584
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
599
585
{"create", OPT_SLAP_CREATE_STRING, "File or string to use create tables.",
600
(char**) &create_string, (char**) &create_string, 0, GET_STR, REQUIRED_ARG,
586
(char**) &create_string, (char**) &create_string, 0, GET_STR, REQUIRED_ARG,
602
588
{"create-schema", OPT_CREATE_SLAP_SCHEMA, "Schema to run tests in.",
603
(char**) &create_schema_string, (char**) &create_schema_string, 0, GET_STR,
604
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
589
(char**) &create_schema_string, (char**) &create_schema_string, 0, GET_STR,
590
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
605
591
{"csv", OPT_SLAP_CSV,
606
"Generate CSV output to named file or to stdout if no file is named.",
607
(char**) &opt_csv_str, (char**) &opt_csv_str, 0, GET_STR,
608
OPT_ARG, 0, 0, 0, 0, 0, 0},
609
{"delayed-start", OPT_SLAP_DELAYED_START,
610
"Delay the startup of threads by a random number of microsends (the maximum of the delay)",
611
(char**) &opt_delayed_start, (char**) &opt_delayed_start, 0, GET_UINT,
612
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
592
"Generate CSV output to named file or to stdout if no file is named.",
593
(char**) &opt_csv_str, (char**) &opt_csv_str, 0, GET_STR,
594
OPT_ARG, 0, 0, 0, 0, 0, 0},
596
{"debug", '#', "This is a non-debug version. Catch this and exit.",
597
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
599
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
600
(char**) &default_dbug_option, (char**) &default_dbug_option, 0, GET_STR,
601
OPT_ARG, 0, 0, 0, 0, 0, 0},
603
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
604
(char**) &debug_check_flag, (char**) &debug_check_flag, 0,
605
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
606
{"debug-info", 'T', "Print some debug info at exit.", (char**) &debug_info_flag,
607
(char**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
608
{"delayed-start", OPT_SLAP_DELAYED_START,
609
"Delay the startup of threads by a random number of microsends (the maximum of the delay)",
610
(char**) &opt_delayed_start, (char**) &opt_delayed_start, 0, GET_UINT,
611
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
613
612
{"delimiter", 'F',
614
"Delimiter to use in SQL statements supplied in file or command line.",
615
(char**) &delimiter, (char**) &delimiter, 0, GET_STR, REQUIRED_ARG,
613
"Delimiter to use in SQL statements supplied in file or command line.",
614
(char**) &delimiter, (char**) &delimiter, 0, GET_STR, REQUIRED_ARG,
617
616
{"detach", OPT_SLAP_DETACH,
618
"Detach (close and reopen) connections after X number of requests.",
619
(char**) &detach_rate, (char**) &detach_rate, 0, GET_UINT, REQUIRED_ARG,
617
"Detach (close and reopen) connections after X number of requests.",
618
(char**) &detach_rate, (char**) &detach_rate, 0, GET_UINT, REQUIRED_ARG,
621
620
{"engine", 'e', "Storage engine to use for creating the table.",
622
(char**) &default_engine, (char**) &default_engine, 0,
623
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
621
(char**) &default_engine, (char**) &default_engine, 0,
622
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
624
623
{"host", 'h', "Connect to host.", (char**) &host, (char**) &host, 0, GET_STR,
625
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
624
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
626
625
{"iterations", 'i', "Number of times to run the tests.", (char**) &iterations,
627
(char**) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
626
(char**) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
628
627
{"label", OPT_SLAP_LABEL, "Label to use for print and csv output.",
629
(char**) &opt_label, (char**) &opt_label, 0,
630
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
631
{"mysql", 'm', N_("Use MySQL Protocol."),
632
(char**) &opt_mysql, (char**) &opt_mysql, 0, GET_BOOL, NO_ARG, 1, 0, 0,
634
{"number-blob-cols", OPT_SLAP_BLOB_COL,
635
"Number of BLOB columns to create table with if specifying --auto-generate-sql. Example --number-blob-cols=3:1024/2048 would give you 3 blobs with a random size between 1024 and 2048. ",
636
(char**) &num_blob_cols_opt, (char**) &num_blob_cols_opt, 0, GET_STR, REQUIRED_ARG,
638
{"number-char-cols", 'x',
639
"Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
640
(char**) &num_char_cols_opt, (char**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
642
{"number-int-cols", 'y',
643
"Number of INT columns to create in table if specifying --auto-generate-sql.",
644
(char**) &num_int_cols_opt, (char**) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG,
646
{"number-of-queries", OPT_DRIZZLE_NUMBER_OF_QUERY,
647
"Limit each client to this number of queries (this is not exact).",
648
(char**) &num_of_query, (char**) &num_of_query, 0,
649
GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
650
{"only-print", OPT_DRIZZLE_ONLY_PRINT,
651
"This causes drizzleslap to not connect to the databases, but instead print "
652
"out what it would have done instead.",
653
(char**) &opt_only_print, (char**) &opt_only_print, 0, GET_BOOL, NO_ARG,
656
"Password to use when connecting to server. If password is not given it's "
657
"asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
658
{"port", 'p', "Port number to use for connection.",
659
0, 0, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
628
(char**) &opt_label, (char**) &opt_label, 0,
629
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
630
{"number-blob-cols", OPT_SLAP_BLOB_COL,
631
"Number of BLOB columns to create table with if specifying --auto-generate-sql. Example --number-blob-cols=3:1024/2048 would give you 3 blobs with a random size between 1024 and 2048. ",
632
(char**) &num_blob_cols_opt, (char**) &num_blob_cols_opt, 0, GET_STR, REQUIRED_ARG,
634
{"number-char-cols", 'x',
635
"Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
636
(char**) &num_char_cols_opt, (char**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
638
{"number-int-cols", 'y',
639
"Number of INT columns to create in table if specifying --auto-generate-sql.",
640
(char**) &num_int_cols_opt, (char**) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG,
642
{"number-of-queries", OPT_MYSQL_NUMBER_OF_QUERY,
643
"Limit each client to this number of queries (this is not exact).",
644
(char**) &num_of_query, (char**) &num_of_query, 0,
645
GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
646
{"only-print", OPT_MYSQL_ONLY_PRINT,
647
"This causes mysqlslap to not connect to the databases, but instead print "
648
"out what it would have done instead.",
649
(char**) &opt_only_print, (char**) &opt_only_print, 0, GET_BOOL, NO_ARG,
652
"Password to use when connecting to server. If password is not given it's "
653
"asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
654
{"port", 'P', "Port number to use for connection.", (char**) &opt_mysql_port,
655
(char**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
660
657
{"post-query", OPT_SLAP_POST_QUERY,
661
"Query to run or file containing query to execute after tests have completed.",
662
(char**) &user_supplied_post_statements,
663
(char**) &user_supplied_post_statements,
664
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
658
"Query to run or file containing query to execute after tests have completed.",
659
(char**) &user_supplied_post_statements,
660
(char**) &user_supplied_post_statements,
661
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
665
662
{"post-system", OPT_SLAP_POST_SYSTEM,
666
"system() string to execute after tests have completed.",
667
(char**) &post_system,
668
(char**) &post_system,
669
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
670
{"pre-query", OPT_SLAP_PRE_QUERY,
671
"Query to run or file containing query to execute before running tests.",
672
(char**) &user_supplied_pre_statements,
673
(char**) &user_supplied_pre_statements,
674
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
675
{"pre-system", OPT_SLAP_PRE_SYSTEM,
676
"system() string to execute before running tests.",
677
(char**) &pre_system,
678
(char**) &pre_system,
679
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
680
{"protocol", OPT_DRIZZLE_PROTOCOL,
681
"The protocol of connection (tcp,socket,pipe,memory).",
682
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
663
"system() string to execute after tests have completed.",
664
(char**) &post_system,
665
(char**) &post_system,
666
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
667
{"pre-query", OPT_SLAP_PRE_QUERY,
668
"Query to run or file containing query to execute before running tests.",
669
(char**) &user_supplied_pre_statements,
670
(char**) &user_supplied_pre_statements,
671
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
672
{"pre-system", OPT_SLAP_PRE_SYSTEM,
673
"system() string to execute before running tests.",
674
(char**) &pre_system,
675
(char**) &pre_system,
676
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
677
{"protocol", OPT_MYSQL_PROTOCOL,
678
"The protocol of connection (tcp,socket,pipe,memory).",
679
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
683
680
{"query", 'q', "Query to run or file containing query to run.",
684
(char**) &user_supplied_query, (char**) &user_supplied_query,
685
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
686
{"set-random-seed", OPT_SLAP_SET_RANDOM_SEED,
687
"Seed for random number generator (srandom(3))",
688
(char**)&opt_set_random_seed,
689
(char**)&opt_set_random_seed,0,
690
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
681
(char**) &user_supplied_query, (char**) &user_supplied_query,
682
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
683
{"set-random-seed", OPT_SLAP_SET_RANDOM_SEED,
684
"Seed for random number generator (srandom(3))",
685
(char**)&opt_set_random_seed,
686
(char**)&opt_set_random_seed,0,
687
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
689
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
690
"Base name of shared memory.", (char**) &shared_memory_base_name,
691
(char**) &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
691
694
{"silent", 's', "Run program in silent mode - no output.",
692
(char**) &opt_silent, (char**) &opt_silent, 0, GET_BOOL, NO_ARG,
694
{"timer-length", OPT_SLAP_TIMER_LENGTH,
695
"Require drizzleslap to run each specific test a certain amount of time in seconds.",
696
(char**) &opt_timer_length, (char**) &opt_timer_length, 0, GET_UINT,
697
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
695
(char**) &opt_silent, (char**) &opt_silent, 0, GET_BOOL, NO_ARG,
697
{"socket", 'S', "Socket file to use for connection.",
698
(char**) &opt_mysql_unix_port, (char**) &opt_mysql_unix_port, 0, GET_STR,
699
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
700
{"timer-length", OPT_SLAP_TIMER_LENGTH,
701
"Require mysqlslap to run each specific test a certain amount of time in seconds.",
702
(char**) &opt_timer_length, (char**) &opt_timer_length, 0, GET_UINT,
703
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
704
#ifndef DONT_ALLOW_USER_CHANGE
698
705
{"user", 'u', "User for login if not current user.", (char**) &user,
699
(char**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
706
(char**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
701
"More verbose output; you can use this multiple times to get even more "
702
"verbose output.", (char**) &verbose, (char**) &verbose, 0,
703
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
709
"More verbose output; you can use this multiple times to get even more "
710
"verbose output.", (char**) &verbose, (char**) &verbose, 0,
711
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
704
712
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
705
NO_ARG, 0, 0, 0, 0, 0, 0},
713
NO_ARG, 0, 0, 0, 0, 0, 0},
706
714
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
718
#include <help_start.h>
710
720
static void print_version(void)
712
printf("%s Ver %s Distrib %s, for %s-%s (%s)\n",internal::my_progname, SLAP_VERSION,
713
drizzle_version(),HOST_VENDOR,HOST_OS,HOST_CPU);
722
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname, SLAP_VERSION,
723
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
717
727
static void usage(void)
720
puts("Copyright (C) 2008 Sun Microsystems");
730
puts("Copyright (C) 2005 MySQL AB");
721
731
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\
722
732
\nand you are welcome to modify and redistribute it under the GPL \
724
734
puts("Run a query multiple times against the server\n");
725
printf("Usage: %s [OPTIONS]\n",internal::my_progname);
726
internal::print_defaults("drizzle",load_default_groups);
735
printf("Usage: %s [OPTIONS]\n",my_progname);
736
print_defaults("my",load_default_groups);
727
737
my_print_help(my_long_options);
730
static int get_one_option(int optid, const struct option *, char *argument)
740
#include <help_end.h>
743
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
733
uint64_t temp_drizzle_port= 0;
746
DBUG_ENTER("get_one_option");
740
temp_drizzle_port= (uint64_t) strtoul(argument, &endchar, 10);
741
/* if there is an alpha character this is not a valid port */
742
if (strlen(endchar) != 0)
744
fprintf(stderr, _("Non-integer value supplied for port. If you are trying to enter a password please use --password instead.\n"));
745
return EXIT_ARGUMENT_INVALID;
747
/* If the port number is > 65535 it is not a valid port
748
This also helps with potential data loss casting unsigned long to a
750
if ((temp_drizzle_port == 0) || (temp_drizzle_port > 65535))
752
fprintf(stderr, _("Value supplied for port is not valid.\n"));
753
return EXIT_ARGUMENT_INVALID;
757
opt_drizzle_port= (uint32_t) temp_drizzle_port;
763
754
char *start= argument;
766
opt_password = strdup(argument);
767
if (opt_password == NULL)
769
fprintf(stderr, "Memory allocation error while copying password. "
771
return EXIT_OUT_OF_MEMORY;
775
/* Overwriting password with 'x' */
755
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
756
opt_password= my_strdup(argument,MYF(MY_FAE));
757
while (*argument) *argument++= 'x'; /* Destroy argument */
780
/* Cut length of argument */
759
start[1]= 0; /* Cut length of argument */
766
DBUG_PUSH(argument ? argument : default_dbug_option);