~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzlecheck.c

MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#define EX_MYSQLERR 2
29
29
 
30
30
static MYSQL mysql_connection, *sock = 0;
31
 
static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
 
31
static bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
32
32
               opt_compress = 0, opt_databases = 0, opt_fast = 0,
33
33
               opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0,
34
34
               opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0,
85
85
   "To check several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames.",
86
86
   (char**) &opt_databases, (char**) &opt_databases, 0, GET_BOOL, NO_ARG,
87
87
   0, 0, 0, 0, 0, 0},
88
 
#ifdef DBUG_OFF
89
 
  {"debug", '#', "This is a non-debug version. Catch this and exit.",
90
 
   0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
91
 
#else
92
 
  {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
93
 
   0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
94
 
#endif
95
88
  {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
96
89
   (char**) &debug_check_flag, (char**) &debug_check_flag, 0,
97
90
   GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
238
231
 
239
232
#include <help_end.h>
240
233
 
241
 
static my_bool
 
234
static bool
242
235
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
243
236
               char *argument)
244
237
{
294
287
    what_to_do= DO_CHECK;
295
288
    opt_upgrade= 1;
296
289
    break;
297
 
  case '#':
298
 
    DBUG_PUSH(argument ? argument : "d:t:o");
299
 
    debug_check_flag= 1;
300
 
    break;
301
290
  case OPT_TABLES:
302
291
    opt_databases = 0;
303
292
    break;
686
675
  MYSQL_ROW row;
687
676
  char prev[NAME_LEN*2+2];
688
677
  uint i;
689
 
  my_bool found_error=0;
 
678
  bool found_error=0;
690
679
 
691
680
  res = mysql_use_result(sock);
692
681
 
694
683
  for (i = 0; (row = mysql_fetch_row(res)); i++)
695
684
  {
696
685
    int changed = strcmp(prev, row[0]);
697
 
    my_bool status = !strcmp(row[2], "status");
 
686
    bool status = !strcmp(row[2], "status");
698
687
 
699
688
    if (status)
700
689
    {
732
721
 
733
722
static int dbConnect(char *host, char *user, char *passwd)
734
723
{
735
 
  DBUG_ENTER("dbConnect");
 
724
 
736
725
  if (verbose)
737
726
  {
738
727
    fprintf(stderr, "# Connecting to %s...\n", host ? host : "localhost");
767
756
 
768
757
static void DBerror(MYSQL *mysql, const char *when)
769
758
{
770
 
  DBUG_ENTER("DBerror");
771
759
  my_printf_error(0,"Got error: %d: %s %s", MYF(0),
772
760
                  mysql_errno(mysql), mysql_error(mysql), when);
773
761
  safe_exit(EX_MYSQLERR);
774
 
  DBUG_VOID_RETURN;
 
762
  return;
775
763
} /* DBerror */
776
764
 
777
765