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