~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/mysqltest.cc

  • Committer: Brian Aker
  • Date: 2008-07-13 06:35:46 UTC
  • Revision ID: brian@tangent.org-20080713063546-w1fzi89wzvf6o517
Bool cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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;
108
108
struct st_block
109
109
{
110
110
  int             line; /* Start line of block */
111
 
  my_bool         ok;   /* Should block be executed */
 
111
  bool         ok;   /* Should block be executed */
112
112
  enum block_cmd  cmd;  /* Command owning the block */
113
113
};
114
114
 
364
364
{
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;
 
367
  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;
393
393
              int val_len);
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);
403
403
 
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);
408
408
 
409
409
/* For replace_column */
410
410
static char *replace_column[MAX_COLUMNS];
508
508
#endif /*EMBEDDED_LIBRARY*/
509
509
 
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)
512
512
{
513
513
  const char *p;
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 */
714
714
};
1673
1673
}
1674
1674
 
1675
1675
 
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)
1678
1678
{
1679
1679
  int digit;
1680
1680
  VAR *v;
2310
2310
  if (error > 0)
2311
2311
  {
2312
2312
    uint status= WEXITSTATUS(error), i;
2313
 
    my_bool ok= 0;
 
2313
    bool ok= 0;
2314
2314
 
2315
2315
    if (command->abort_on_error)
2316
2316
    {
2742
2742
}
2743
2743
 
2744
2744
 
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)
2746
2746
{
2747
2747
  static DYNAMIC_STRING ds_content;
2748
2748
  static DYNAMIC_STRING ds_filename;
3499
3499
  used for cpu-independent delays.
3500
3500
*/
3501
3501
 
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)
3503
3503
{
3504
3504
  int error= 0;
3505
3505
  char *p= command->first_argument;
3819
3819
 
3820
3820
static void set_reconnect(MYSQL* mysql, int val)
3821
3821
{
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
4083
4083
{
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;
4088
4088
 
4089
4089
  static DYNAMIC_STRING ds_connection_name;
4291
4291
  const char *expr_start, *expr_end;
4292
4292
  VAR v;
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));
4297
4297
 
4373
4373
}
4374
4374
 
4375
4375
 
4376
 
my_bool match_delimiter(int c, const char *delim, uint length)
 
4376
bool match_delimiter(int c, const char *delim, uint length)
4377
4377
{
4378
4378
  uint i;
4379
4379
  char tmp[MAX_DELIMITER_LENGTH];
4397
4397
}
4398
4398
 
4399
4399
 
4400
 
static my_bool end_of_query(int c)
 
4400
static bool end_of_query(int c)
4401
4401
{
4402
4402
  return match_delimiter(c, delimiter, delimiter_length);
4403
4403
}
5016
5016
}
5017
5017
 
5018
5018
 
5019
 
static my_bool
 
5019
static bool
5020
5020
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
5021
5021
               char *argument)
5022
5022
{
5137
5137
  append - append to file instead of overwriting old file
5138
5138
*/
5139
5139
 
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)
5141
5141
{
5142
5142
  int fd;
5143
5143
  char buff[FN_REFLEN];
5214
5214
*/
5215
5215
 
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)
5218
5218
{
5219
5219
  if (col_idx < max_replace_column && replace_column[col_idx])
5220
5220
  {
5923
5923
int main(int argc, char **argv)
5924
5924
{
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;
6123
6123
      case Q_QUERY:
6124
6124
      case Q_REAP:
6125
6125
      {
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;
6129
6129
 
6566
6566
 
6567
6567
 
6568
6568
typedef struct st_replace {
6569
 
  my_bool found;
 
6569
  bool found;
6570
6570
  struct st_replace *next[256];
6571
6571
} REPLACE;
6572
6572
 
6573
6573
typedef struct st_replace_found {
6574
 
  my_bool found;
 
6574
  bool found;
6575
6575
  char *replace_string;
6576
6576
  uint to_offset;
6577
6577
  int from_offset;