511
512
0, 0, 0, 0, 0, 0},
512
513
{"auto-generate-sql", 'a',
513
514
"Generate SQL where not supplied by file or command line.",
514
(uchar**) &auto_generate_sql, (uchar**) &auto_generate_sql,
515
&auto_generate_sql, &auto_generate_sql,
515
516
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
516
517
{"auto-generate-sql-add-autoincrement", OPT_SLAP_AUTO_GENERATE_ADD_AUTO,
517
518
"Add an AUTO_INCREMENT column to auto-generated tables.",
518
(uchar**) &auto_generate_sql_autoincrement,
519
(uchar**) &auto_generate_sql_autoincrement,
519
&auto_generate_sql_autoincrement,
520
&auto_generate_sql_autoincrement,
520
521
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
521
522
{"auto-generate-sql-execute-number", OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES,
522
523
"Set this number to generate a set number of queries to run.",
523
(uchar**) &auto_actual_queries, (uchar**) &auto_actual_queries,
524
&auto_actual_queries, &auto_actual_queries,
524
525
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
525
526
{"auto-generate-sql-guid-primary", OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY,
526
527
"Add GUID based primary keys to auto-generated tables.",
527
(uchar**) &auto_generate_sql_guid_primary,
528
(uchar**) &auto_generate_sql_guid_primary,
528
&auto_generate_sql_guid_primary,
529
&auto_generate_sql_guid_primary,
529
530
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
530
531
{"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE,
531
532
"Specify test load type: mixed, update, write, key, or read; default is mixed.",
532
(uchar**) &auto_generate_sql_type, (uchar**) &auto_generate_sql_type,
533
&auto_generate_sql_type, &auto_generate_sql_type,
533
534
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
534
535
{"auto-generate-sql-secondary-indexes",
535
536
OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES,
536
537
"Number of secondary indexes to add to auto-generated tables.",
537
(uchar**) &auto_generate_sql_secondary_indexes,
538
(uchar**) &auto_generate_sql_secondary_indexes, 0,
538
&auto_generate_sql_secondary_indexes,
539
&auto_generate_sql_secondary_indexes, 0,
539
540
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
540
541
{"auto-generate-sql-unique-query-number",
541
542
OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM,
542
543
"Number of unique queries to generate for automatic tests.",
543
(uchar**) &auto_generate_sql_unique_query_number,
544
(uchar**) &auto_generate_sql_unique_query_number,
544
&auto_generate_sql_unique_query_number,
545
&auto_generate_sql_unique_query_number,
545
546
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
546
547
{"auto-generate-sql-unique-write-number",
547
548
OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM,
548
549
"Number of unique queries to generate for auto-generate-sql-write-number.",
549
(uchar**) &auto_generate_sql_unique_write_number,
550
(uchar**) &auto_generate_sql_unique_write_number,
550
&auto_generate_sql_unique_write_number,
551
&auto_generate_sql_unique_write_number,
551
552
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
552
553
{"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
553
554
"Number of row inserts to perform for each thread (default is 100).",
554
(uchar**) &auto_generate_sql_number, (uchar**) &auto_generate_sql_number,
555
&auto_generate_sql_number, &auto_generate_sql_number,
555
556
0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
556
557
{"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.",
557
(uchar**) &commit_rate, (uchar**) &commit_rate, 0, GET_UINT, REQUIRED_ARG,
558
&commit_rate, &commit_rate, 0, GET_UINT, REQUIRED_ARG,
558
559
0, 0, 0, 0, 0, 0},
559
560
{"compress", 'C', "Use compression in server/client protocol.",
560
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
561
&opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
562
563
{"concurrency", 'c', "Number of clients to simulate for query to run.",
563
(uchar**) &concurrency_str, (uchar**) &concurrency_str, 0, GET_STR,
564
&concurrency_str, &concurrency_str, 0, GET_STR,
564
565
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
565
566
{"create", OPT_SLAP_CREATE_STRING, "File or string to use create tables.",
566
(uchar**) &create_string, (uchar**) &create_string, 0, GET_STR, REQUIRED_ARG,
567
&create_string, &create_string, 0, GET_STR, REQUIRED_ARG,
567
568
0, 0, 0, 0, 0, 0},
568
569
{"create-schema", OPT_CREATE_SLAP_SCHEMA, "Schema to run tests in.",
569
(uchar**) &create_schema_string, (uchar**) &create_schema_string, 0, GET_STR,
570
&create_schema_string, &create_schema_string, 0, GET_STR,
570
571
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
571
572
{"csv", OPT_SLAP_CSV,
572
573
"Generate CSV output to named file or to stdout if no file is named.",
576
577
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
578
579
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
579
(uchar**) &default_dbug_option, (uchar**) &default_dbug_option, 0, GET_STR,
580
&default_dbug_option, &default_dbug_option, 0, GET_STR,
580
581
OPT_ARG, 0, 0, 0, 0, 0, 0},
582
583
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
583
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
584
&debug_check_flag, &debug_check_flag, 0,
584
585
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
585
{"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,
586
(uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
586
{"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
587
&debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
587
588
{"delimiter", 'F',
588
589
"Delimiter to use in SQL statements supplied in file or command line.",
589
(uchar**) &delimiter, (uchar**) &delimiter, 0, GET_STR, REQUIRED_ARG,
590
&delimiter, &delimiter, 0, GET_STR, REQUIRED_ARG,
590
591
0, 0, 0, 0, 0, 0},
591
592
{"detach", OPT_SLAP_DETACH,
592
593
"Detach (close and reopen) connections after X number of requests.",
593
(uchar**) &detach_rate, (uchar**) &detach_rate, 0, GET_UINT, REQUIRED_ARG,
594
&detach_rate, &detach_rate, 0, GET_UINT, REQUIRED_ARG,
594
595
0, 0, 0, 0, 0, 0},
595
596
{"engine", 'e', "Storage engine to use for creating the table.",
596
(uchar**) &default_engine, (uchar**) &default_engine, 0,
597
&default_engine, &default_engine, 0,
597
598
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
598
{"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
599
{"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
599
600
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
600
{"iterations", 'i', "Number of times to run the tests.", (uchar**) &iterations,
601
(uchar**) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
601
{"iterations", 'i', "Number of times to run the tests.", &iterations,
602
&iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
603
{"no-drop", OPT_SLAP_NO_DROP, "Do not drop the schema after the test.",
604
&opt_no_drop, &opt_no_drop, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
602
605
{"number-char-cols", 'x',
603
606
"Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
604
(uchar**) &num_char_cols_opt, (uchar**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
607
&num_char_cols_opt, &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
605
608
0, 0, 0, 0, 0, 0},
606
609
{"number-int-cols", 'y',
607
610
"Number of INT columns to create in table if specifying --auto-generate-sql.",
608
(uchar**) &num_int_cols_opt, (uchar**) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG,
611
&num_int_cols_opt, &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG,
609
612
0, 0, 0, 0, 0, 0},
610
613
{"number-of-queries", OPT_MYSQL_NUMBER_OF_QUERY,
611
614
"Limit each client to this number of queries (this is not exact).",
612
(uchar**) &num_of_query, (uchar**) &num_of_query, 0,
615
&num_of_query, &num_of_query, 0,
613
616
GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
614
617
{"only-print", OPT_MYSQL_ONLY_PRINT,
615
"This causes mysqlslap to not connect to the databases, but instead print "
616
"out what it would have done instead.",
617
(uchar**) &opt_only_print, (uchar**) &opt_only_print, 0, GET_BOOL, NO_ARG,
618
"Do not connect to the databases, but instead print out what would have "
620
&opt_only_print, &opt_only_print, 0, GET_BOOL, NO_ARG,
618
621
0, 0, 0, 0, 0, 0},
619
622
{"password", 'p',
620
623
"Password to use when connecting to server. If password is not given it's "
623
626
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
624
627
NO_ARG, 0, 0, 0, 0, 0, 0},
626
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
627
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
629
{"port", 'P', "Port number to use for connection.", &opt_mysql_port,
630
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
629
632
{"post-query", OPT_SLAP_POST_QUERY,
630
633
"Query to run or file containing query to execute after tests have completed.",
631
(uchar**) &user_supplied_post_statements,
632
(uchar**) &user_supplied_post_statements,
634
&user_supplied_post_statements, &user_supplied_post_statements,
633
635
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
634
636
{"post-system", OPT_SLAP_POST_SYSTEM,
635
637
"system() string to execute after tests have completed.",
636
(uchar**) &post_system,
637
(uchar**) &post_system,
638
&post_system, &post_system,
638
639
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
639
640
{"pre-query", OPT_SLAP_PRE_QUERY,
640
641
"Query to run or file containing query to execute before running tests.",
641
(uchar**) &user_supplied_pre_statements,
642
(uchar**) &user_supplied_pre_statements,
642
&user_supplied_pre_statements, &user_supplied_pre_statements,
643
643
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
644
644
{"pre-system", OPT_SLAP_PRE_SYSTEM,
645
645
"system() string to execute before running tests.",
646
(uchar**) &pre_system,
647
(uchar**) &pre_system,
646
&pre_system, &pre_system,
648
647
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
649
648
{"protocol", OPT_MYSQL_PROTOCOL,
650
"The protocol of connection (tcp,socket,pipe,memory).",
649
"The protocol to use for connection (tcp, socket, pipe, memory).",
651
650
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
652
651
{"query", 'q', "Query to run or file containing query to run.",
653
(uchar**) &user_supplied_query, (uchar**) &user_supplied_query,
652
&user_supplied_query, &user_supplied_query,
654
653
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
656
655
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
657
"Base name of shared memory.", (uchar**) &shared_memory_base_name,
658
(uchar**) &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
656
"Base name of shared memory.", &shared_memory_base_name,
657
&shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
659
658
0, 0, 0, 0, 0, 0},
661
660
{"silent", 's', "Run program in silent mode - no output.",
662
(uchar**) &opt_silent, (uchar**) &opt_silent, 0, GET_BOOL, NO_ARG,
661
&opt_silent, &opt_silent, 0, GET_BOOL, NO_ARG,
663
662
0, 0, 0, 0, 0, 0},
664
{"socket", 'S', "Socket file to use for connection.",
665
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
663
{"socket", 'S', "The socket file to use for connection.",
664
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
666
665
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
667
666
#include <sslopt-longopts.h>
668
667
#ifndef DONT_ALLOW_USER_CHANGE
669
{"user", 'u', "User for login if not current user.", (uchar**) &user,
670
(uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
668
{"user", 'u', "User for login if not current user.", &user,
669
&user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
673
"More verbose output; you can use this multiple times to get even more "
674
"verbose output.", (uchar**) &verbose, (uchar**) &verbose, 0,
675
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
676
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
677
NO_ARG, 0, 0, 0, 0, 0, 0},
672
"More verbose output; you can use this multiple times to get even more "
673
"verbose output.", &verbose, &verbose, 0, GET_NO_ARG, NO_ARG,
675
{"version", 'V', "Output version information and exit.", 0, 0, 0,
676
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
678
677
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}