70
70
const char *opt_include= 0, *opt_charsets_dir;
71
71
static int opt_port= 0;
72
72
static int opt_max_connect_retries;
73
static my_bool opt_compress= 0, silent= 0, verbose= 0;
74
static my_bool debug_info_flag= 0, debug_check_flag= 0;
75
static my_bool tty_password= 0;
76
static my_bool opt_mark_progress= 0;
77
static my_bool parsing_disabled= 0;
78
static my_bool display_result_vertically= FALSE,
73
static bool opt_compress= 0, silent= 0, verbose= 0;
74
static bool debug_info_flag= 0, debug_check_flag= 0;
75
static bool tty_password= 0;
76
static bool opt_mark_progress= 0;
77
static bool parsing_disabled= 0;
78
static bool display_result_vertically= FALSE,
79
79
display_metadata= FALSE, display_result_sorted= FALSE;
80
static my_bool disable_query_log= 0, disable_result_log= 0;
81
static my_bool disable_warnings= 0;
82
static my_bool disable_info= 1;
83
static my_bool abort_on_error= 1;
84
static my_bool server_initialized= 0;
85
static my_bool is_windows= 0;
80
static bool disable_query_log= 0, disable_result_log= 0;
81
static bool disable_warnings= 0;
82
static bool disable_info= 1;
83
static bool abort_on_error= 1;
84
static bool server_initialized= 0;
85
static bool is_windows= 0;
86
86
static char **default_argv;
87
87
static const char *load_default_groups[]= { "mysqltest", "client", 0 };
88
88
static char line_buffer[MAX_DELIMITER_LENGTH], *line_buffer_pos= line_buffer;
365
365
char *query, *query_buf,*first_argument,*last_argument,*end;
366
366
int first_word_len, query_len;
367
my_bool abort_on_error;
368
368
struct st_expected_errors expected_errors;
369
369
char require_file[FN_REFLEN];
370
370
enum enum_commands type;
394
394
void var_free(void* v);
395
395
VAR* var_get(const char *var_name, const char** var_name_end,
396
my_bool raw, my_bool ignore_not_existing);
396
bool raw, bool ignore_not_existing);
397
397
void eval_expr(VAR* v, const char *p, const char** p_end);
398
my_bool match_delimiter(int c, const char *delim, uint length);
398
bool match_delimiter(int c, const char *delim, uint length);
399
399
void dump_result_to_reject_file(char *buf, int size);
400
400
void dump_result_to_log_file(char *buf, int size);
401
401
void dump_warning_messages(void);
402
402
void dump_progress(void);
404
404
void do_eval(DYNAMIC_STRING *query_eval, const char *query,
405
const char *query_end, my_bool pass_through_escape_chars);
405
const char *query_end, bool pass_through_escape_chars);
406
406
void str_to_file(const char *fname, char *str, int size);
407
void str_to_file2(const char *fname, char *str, int size, my_bool append);
407
void str_to_file2(const char *fname, char *str, int size, bool append);
409
409
/* For replace_column */
410
410
static char *replace_column[MAX_COLUMNS];
508
508
#endif /*EMBEDDED_LIBRARY*/
510
510
void do_eval(DYNAMIC_STRING *query_eval, const char *query,
511
const char *query_end, my_bool pass_through_escape_chars)
511
const char *query_end, bool pass_through_escape_chars)
514
514
register char c, next_c;
708
708
struct command_arg {
709
709
const char *argname; /* Name of argument */
710
710
enum arg_type type; /* Type of argument */
711
my_bool required; /* Argument required */
711
bool required; /* Argument required */
712
712
DYNAMIC_STRING *ds; /* Storage for argument */
713
713
const char *description; /* Description of the argument */
1676
VAR* var_get(const char *var_name, const char **var_name_end, my_bool raw,
1677
my_bool ignore_not_existing)
1676
VAR* var_get(const char *var_name, const char **var_name_end, bool raw,
1677
bool ignore_not_existing)
2745
static void do_write_file_command(struct st_command *command, my_bool append)
2745
static void do_write_file_command(struct st_command *command, bool append)
2747
2747
static DYNAMIC_STRING ds_content;
2748
2748
static DYNAMIC_STRING ds_filename;
3499
3499
used for cpu-independent delays.
3502
static int do_sleep(struct st_command *command, my_bool real_sleep)
3502
static int do_sleep(struct st_command *command, bool real_sleep)
3505
3505
char *p= command->first_argument;
3820
3820
static void set_reconnect(MYSQL* mysql, int val)
3822
my_bool reconnect= val;
3822
bool reconnect= val;
3823
3823
DBUG_ENTER("set_reconnect");
3824
3824
DBUG_PRINT("info", ("val: %d", val));
3825
3825
#if MYSQL_VERSION_ID < 50000
4084
4084
int con_port= opt_port;
4085
4085
char *con_options;
4086
my_bool con_ssl= 0, con_compress= 0;
4086
bool con_ssl= 0, con_compress= 0;
4087
4087
struct st_connection* con_slot;
4089
4089
static DYNAMIC_STRING ds_connection_name;
4291
4291
const char *expr_start, *expr_end;
4293
4293
const char *cmd_name= (cmd == cmd_while ? "while" : "if");
4294
my_bool not_expr= FALSE;
4294
bool not_expr= FALSE;
4295
4295
DBUG_ENTER("do_block");
4296
4296
DBUG_PRINT("enter", ("%s", cmd_name));
4376
my_bool match_delimiter(int c, const char *delim, uint length)
4376
bool match_delimiter(int c, const char *delim, uint length)
4379
4379
char tmp[MAX_DELIMITER_LENGTH];
5137
5137
append - append to file instead of overwriting old file
5140
void str_to_file2(const char *fname, char *str, int size, my_bool append)
5140
void str_to_file2(const char *fname, char *str, int size, bool append)
5143
5143
char buff[FN_REFLEN];
5216
5216
static void append_field(DYNAMIC_STRING *ds, uint col_idx, MYSQL_FIELD* field,
5217
const char* val, ulonglong len, my_bool is_null)
5217
const char* val, ulonglong len, bool is_null)
5219
5219
if (col_idx < max_replace_column && replace_column[col_idx])
5923
5923
int main(int argc, char **argv)
5925
5925
struct st_command *command;
5926
my_bool q_send_flag= 0, abort_flag= 0;
5926
bool q_send_flag= 0, abort_flag= 0;
5927
5927
uint command_executed= 0, last_command_executed= 0;
5928
5928
char save_file[FN_REFLEN];
5929
5929
struct stat res_info;
6126
my_bool old_display_result_vertically= display_result_vertically;
6126
bool old_display_result_vertically= display_result_vertically;
6127
6127
/* Default is full query, both reap and send */
6128
6128
int flags= QUERY_REAP_FLAG | QUERY_SEND_FLAG;