524
512
static struct my_option my_long_options[] =
526
514
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
528
516
{"auto-generate-sql-select-columns", OPT_SLAP_AUTO_GENERATE_SELECT_COLUMNS,
529
"Provide a string to use for the select fields used in auto tests.",
530
(char**) &auto_generate_selected_columns_opt,
531
(char**) &auto_generate_selected_columns_opt,
532
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
517
"Provide a string to use for the select fields used in auto tests.",
518
(char**) &auto_generate_selected_columns_opt,
519
(char**) &auto_generate_selected_columns_opt,
520
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
533
521
{"auto-generate-sql", 'a',
534
"Generate SQL where not supplied by file or command line.",
535
(char**) &auto_generate_sql, (char**) &auto_generate_sql,
536
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
522
"Generate SQL where not supplied by file or command line.",
523
(char**) &auto_generate_sql, (char**) &auto_generate_sql,
524
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
537
525
{"auto-generate-sql-add-autoincrement", OPT_SLAP_AUTO_GENERATE_ADD_AUTO,
538
"Add an AUTO_INCREMENT column to auto-generated tables.",
539
(char**) &auto_generate_sql_autoincrement,
540
(char**) &auto_generate_sql_autoincrement,
541
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
526
"Add an AUTO_INCREMENT column to auto-generated tables.",
527
(char**) &auto_generate_sql_autoincrement,
528
(char**) &auto_generate_sql_autoincrement,
529
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
542
530
{"auto-generate-sql-execute-number", OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES,
543
"Set this number to generate a set number of queries to run.",
544
(char**) &auto_actual_queries, (char**) &auto_actual_queries,
545
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
531
"Set this number to generate a set number of queries to run.",
532
(char**) &auto_actual_queries, (char**) &auto_actual_queries,
533
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
546
534
{"auto-generate-sql-guid-primary", OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY,
547
"Add GUID based primary keys to auto-generated tables.",
548
(char**) &auto_generate_sql_guid_primary,
549
(char**) &auto_generate_sql_guid_primary,
550
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
535
"Add GUID based primary keys to auto-generated tables.",
536
(char**) &auto_generate_sql_guid_primary,
537
(char**) &auto_generate_sql_guid_primary,
538
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
551
539
{"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE,
552
"Specify test load type: mixed, update, write, key, or read; default is mixed.",
553
(char**) &opt_auto_generate_sql_type, (char**) &opt_auto_generate_sql_type,
554
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
540
"Specify test load type: mixed, update, write, key, or read; default is mixed.",
541
(char**) &opt_auto_generate_sql_type, (char**) &opt_auto_generate_sql_type,
542
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
555
543
{"auto-generate-sql-secondary-indexes",
556
OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES,
557
"Number of secondary indexes to add to auto-generated tables.",
558
(char**) &auto_generate_sql_secondary_indexes,
559
(char**) &auto_generate_sql_secondary_indexes, 0,
560
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
544
OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES,
545
"Number of secondary indexes to add to auto-generated tables.",
546
(char**) &auto_generate_sql_secondary_indexes,
547
(char**) &auto_generate_sql_secondary_indexes, 0,
548
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
561
549
{"auto-generate-sql-unique-query-number",
562
OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM,
563
"Number of unique queries to generate for automatic tests.",
564
(char**) &auto_generate_sql_unique_query_number,
565
(char**) &auto_generate_sql_unique_query_number,
566
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
550
OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM,
551
"Number of unique queries to generate for automatic tests.",
552
(char**) &auto_generate_sql_unique_query_number,
553
(char**) &auto_generate_sql_unique_query_number,
554
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
567
555
{"auto-generate-sql-unique-write-number",
568
OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM,
569
"Number of unique queries to generate for auto-generate-sql-write-number.",
570
(char**) &auto_generate_sql_unique_write_number,
571
(char**) &auto_generate_sql_unique_write_number,
572
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
556
OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM,
557
"Number of unique queries to generate for auto-generate-sql-write-number.",
558
(char**) &auto_generate_sql_unique_write_number,
559
(char**) &auto_generate_sql_unique_write_number,
560
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
573
561
{"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
574
"Number of row inserts to perform for each thread (default is 100).",
575
(char**) &auto_generate_sql_number, (char**) &auto_generate_sql_number,
576
0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
562
"Number of row inserts to perform for each thread (default is 100).",
563
(char**) &auto_generate_sql_number, (char**) &auto_generate_sql_number,
564
0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
577
565
{"burnin", OPT_SLAP_BURNIN, "Run full test case in infinite loop.",
578
(char**) &opt_burnin, (char**) &opt_burnin, 0, GET_BOOL, NO_ARG, 0, 0, 0,
566
(char**) &opt_burnin, (char**) &opt_burnin, 0, GET_BOOL, NO_ARG, 0, 0, 0,
580
568
{"ignore-sql-errors", OPT_SLAP_IGNORE_SQL_ERRORS,
581
"Ignore SQL erros in query run.",
582
(char**) &opt_ignore_sql_errors,
583
(char**) &opt_ignore_sql_errors,
584
0, GET_BOOL, NO_ARG, 0, 0, 0,
569
"Ignore SQL erros in query run.",
570
(char**) &opt_ignore_sql_errors,
571
(char**) &opt_ignore_sql_errors,
572
0, GET_BOOL, NO_ARG, 0, 0, 0,
586
574
{"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.",
587
(char**) &commit_rate, (char**) &commit_rate, 0, GET_UINT, REQUIRED_ARG,
575
(char**) &commit_rate, (char**) &commit_rate, 0, GET_UINT, REQUIRED_ARG,
589
577
{"compress", 'C', "Use compression in server/client protocol.",
590
(char**) &opt_compress, (char**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
578
(char**) &opt_compress, (char**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
592
580
{"concurrency", 'c', "Number of clients to simulate for query to run.",
593
(char**) &concurrency_str, (char**) &concurrency_str, 0, GET_STR,
594
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
581
(char**) &concurrency_str, (char**) &concurrency_str, 0, GET_STR,
582
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
595
583
{"create", OPT_SLAP_CREATE_STRING, "File or string to use create tables.",
596
(char**) &create_string, (char**) &create_string, 0, GET_STR, REQUIRED_ARG,
584
(char**) &create_string, (char**) &create_string, 0, GET_STR, REQUIRED_ARG,
598
586
{"create-schema", OPT_CREATE_SLAP_SCHEMA, "Schema to run tests in.",
599
(char**) &create_schema_string, (char**) &create_schema_string, 0, GET_STR,
600
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
587
(char**) &create_schema_string, (char**) &create_schema_string, 0, GET_STR,
588
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
601
589
{"csv", OPT_SLAP_CSV,
602
"Generate CSV output to named file or to stdout if no file is named.",
603
(char**) &opt_csv_str, (char**) &opt_csv_str, 0, GET_STR,
604
OPT_ARG, 0, 0, 0, 0, 0, 0},
590
"Generate CSV output to named file or to stdout if no file is named.",
591
(char**) &opt_csv_str, (char**) &opt_csv_str, 0, GET_STR,
592
OPT_ARG, 0, 0, 0, 0, 0, 0},
605
593
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
606
(char**) &debug_check_flag, (char**) &debug_check_flag, 0,
607
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
594
(char**) &debug_check_flag, (char**) &debug_check_flag, 0,
595
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
608
596
{"debug-info", 'T', "Print some debug info at exit.", (char**) &debug_info_flag,
609
(char**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
597
(char**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
610
598
{"delayed-start", OPT_SLAP_DELAYED_START,
611
"Delay the startup of threads by a random number of microsends (the maximum of the delay)",
612
(char**) &opt_delayed_start, (char**) &opt_delayed_start, 0, GET_UINT,
613
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
599
"Delay the startup of threads by a random number of microsends (the maximum of the delay)",
600
(char**) &opt_delayed_start, (char**) &opt_delayed_start, 0, GET_UINT,
601
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
614
602
{"delimiter", 'F',
615
"Delimiter to use in SQL statements supplied in file or command line.",
616
(char**) &delimiter, (char**) &delimiter, 0, GET_STR, REQUIRED_ARG,
603
"Delimiter to use in SQL statements supplied in file or command line.",
604
(char**) &delimiter, (char**) &delimiter, 0, GET_STR, REQUIRED_ARG,
618
606
{"detach", OPT_SLAP_DETACH,
619
"Detach (close and reopen) connections after X number of requests.",
620
(char**) &detach_rate, (char**) &detach_rate, 0, GET_UINT, REQUIRED_ARG,
607
"Detach (close and reopen) connections after X number of requests.",
608
(char**) &detach_rate, (char**) &detach_rate, 0, GET_UINT, REQUIRED_ARG,
622
610
{"engine", 'e', "Storage engine to use for creating the table.",
623
(char**) &default_engine, (char**) &default_engine, 0,
624
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
611
(char**) &default_engine, (char**) &default_engine, 0,
612
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
625
613
{"host", 'h', "Connect to host.", (char**) &host, (char**) &host, 0, GET_STR,
626
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
614
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
627
615
{"iterations", 'i', "Number of times to run the tests.", (char**) &iterations,
628
(char**) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
616
(char**) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
629
617
{"label", OPT_SLAP_LABEL, "Label to use for print and csv output.",
630
(char**) &opt_label, (char**) &opt_label, 0,
631
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
618
(char**) &opt_label, (char**) &opt_label, 0,
619
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
632
620
{"number-blob-cols", OPT_SLAP_BLOB_COL,
633
"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. ",
634
(char**) &num_blob_cols_opt, (char**) &num_blob_cols_opt, 0, GET_STR, REQUIRED_ARG,
621
"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. ",
622
(char**) &num_blob_cols_opt, (char**) &num_blob_cols_opt, 0, GET_STR, REQUIRED_ARG,
636
624
{"number-char-cols", 'x',
637
"Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
638
(char**) &num_char_cols_opt, (char**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
625
"Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
626
(char**) &num_char_cols_opt, (char**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
640
628
{"number-int-cols", 'y',
641
"Number of INT columns to create in table if specifying --auto-generate-sql.",
642
(char**) &num_int_cols_opt, (char**) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG,
629
"Number of INT columns to create in table if specifying --auto-generate-sql.",
630
(char**) &num_int_cols_opt, (char**) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG,
644
632
{"number-of-queries", OPT_DRIZZLE_NUMBER_OF_QUERY,
645
"Limit each client to this number of queries (this is not exact).",
646
(char**) &num_of_query, (char**) &num_of_query, 0,
647
GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
633
"Limit each client to this number of queries (this is not exact).",
634
(char**) &num_of_query, (char**) &num_of_query, 0,
635
GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
648
636
{"only-print", OPT_DRIZZLE_ONLY_PRINT,
649
"This causes drizzleslap to not connect to the databases, but instead print "
650
"out what it would have done instead.",
651
(char**) &opt_only_print, (char**) &opt_only_print, 0, GET_BOOL, NO_ARG,
654
"Password to use when connecting to server. If password is not given it's "
655
"asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
656
{"port", 'p', "Port number to use for connection.",
657
0, 0, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
637
"This causes drizzleslap to not connect to the databases, but instead print "
638
"out what it would have done instead.",
639
(char**) &opt_only_print, (char**) &opt_only_print, 0, GET_BOOL, NO_ARG,
642
"Password to use when connecting to server. If password is not given it's "
643
"asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
644
{"port", 'P', "Port number to use for connection.", (char**) &opt_drizzle_port,
645
(char**) &opt_drizzle_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
658
647
{"post-query", OPT_SLAP_POST_QUERY,
659
"Query to run or file containing query to execute after tests have completed.",
660
(char**) &user_supplied_post_statements,
661
(char**) &user_supplied_post_statements,
662
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
648
"Query to run or file containing query to execute after tests have completed.",
649
(char**) &user_supplied_post_statements,
650
(char**) &user_supplied_post_statements,
651
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
663
652
{"post-system", OPT_SLAP_POST_SYSTEM,
664
"system() string to execute after tests have completed.",
665
(char**) &post_system,
666
(char**) &post_system,
667
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
653
"system() string to execute after tests have completed.",
654
(char**) &post_system,
655
(char**) &post_system,
656
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
668
657
{"pre-query", OPT_SLAP_PRE_QUERY,
669
"Query to run or file containing query to execute before running tests.",
670
(char**) &user_supplied_pre_statements,
671
(char**) &user_supplied_pre_statements,
672
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
658
"Query to run or file containing query to execute before running tests.",
659
(char**) &user_supplied_pre_statements,
660
(char**) &user_supplied_pre_statements,
661
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
673
662
{"pre-system", OPT_SLAP_PRE_SYSTEM,
674
"system() string to execute before running tests.",
675
(char**) &pre_system,
676
(char**) &pre_system,
677
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
663
"system() string to execute before running tests.",
664
(char**) &pre_system,
665
(char**) &pre_system,
666
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
678
667
{"protocol", OPT_DRIZZLE_PROTOCOL,
679
"The protocol of connection (tcp,socket,pipe,memory).",
680
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
668
"The protocol of connection (tcp,socket,pipe,memory).",
669
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
681
670
{"query", 'q', "Query to run or file containing query to run.",
682
(char**) &user_supplied_query, (char**) &user_supplied_query,
683
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
671
(char**) &user_supplied_query, (char**) &user_supplied_query,
672
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
684
673
{"set-random-seed", OPT_SLAP_SET_RANDOM_SEED,
685
"Seed for random number generator (srandom(3))",
686
(char**)&opt_set_random_seed,
687
(char**)&opt_set_random_seed,0,
688
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
674
"Seed for random number generator (srandom(3))",
675
(char**)&opt_set_random_seed,
676
(char**)&opt_set_random_seed,0,
677
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
689
678
{"silent", 's', "Run program in silent mode - no output.",
690
(char**) &opt_silent, (char**) &opt_silent, 0, GET_BOOL, NO_ARG,
679
(char**) &opt_silent, (char**) &opt_silent, 0, GET_BOOL, NO_ARG,
692
681
{"socket", 'S', "Socket file to use for connection.",
693
(char**) &opt_drizzle_unix_port, (char**) &opt_drizzle_unix_port, 0, GET_STR,
694
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
682
(char**) &opt_drizzle_unix_port, (char**) &opt_drizzle_unix_port, 0, GET_STR,
683
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
695
684
{"timer-length", OPT_SLAP_TIMER_LENGTH,
696
"Require drizzleslap to run each specific test a certain amount of time in seconds.",
697
(char**) &opt_timer_length, (char**) &opt_timer_length, 0, GET_UINT,
698
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
685
"Require drizzleslap to run each specific test a certain amount of time in seconds.",
686
(char**) &opt_timer_length, (char**) &opt_timer_length, 0, GET_UINT,
687
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
699
688
#ifndef DONT_ALLOW_USER_CHANGE
700
689
{"user", 'u', "User for login if not current user.", (char**) &user,
701
(char**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
690
(char**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
704
"More verbose output; you can use this multiple times to get even more "
705
"verbose output.", (char**) &verbose, (char**) &verbose, 0,
706
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
693
"More verbose output; you can use this multiple times to get even more "
694
"verbose output.", (char**) &verbose, (char**) &verbose, 0,
695
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
707
696
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
708
NO_ARG, 0, 0, 0, 0, 0, 0},
697
NO_ARG, 0, 0, 0, 0, 0, 0},
709
698
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}