Commit 8a40c5c7 authored by unknown's avatar unknown
Browse files

corrected error in ndb programs debug switch

parent 45064a4a
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -33,7 +33,11 @@ const char *opt_ndb_connectstring= 0;
const char *opt_connect_str= 0;
const char *opt_ndb_mgmd= 0;
char opt_ndb_constrbuf[1024];
unsigned opt_ndb_constrbuf_len;
unsigned opt_ndb_constrbuf_len= 0;

#ifndef DBUG_OFF
const char *opt_debug= 0;
#endif

#define OPT_NDB_CONNECTSTRING 'c'

@@ -75,7 +79,8 @@ unsigned opt_ndb_constrbuf_len;
#ifndef DBUG_OFF
#define NDB_STD_OPTS(prog_name) \
  { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
    (gptr*) &opt_debug, (gptr*) &opt_debug, \
    0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
  NDB_STD_OPTS_COMMON
#else
#define NDB_STD_OPTS(prog_name) NDB_STD_OPTS_COMMON
@@ -101,15 +106,21 @@ enum ndb_std_options {
static my_bool
ndb_std_get_one_option(int optid,
		       const struct my_option *opt __attribute__((unused)),
		       const char *argument)
		       char *argument)
{
  switch (optid) {
#ifndef DBUG_OFF
  case '#':
    if (argument)
    if (opt_debug)
    {
      DBUG_PUSH(argument);
      DBUG_PUSH(opt_debug);
    }
    else
    {
      DBUG_PUSH("d:t");
    }
    break;
#endif
  case 'V':
    ndb_std_print_version();
    exit(0);
+5 −8
Original line number Diff line number Diff line
@@ -88,13 +88,6 @@ static void usage()
  my_print_help(my_long_options);
  my_print_variables(my_long_options);
}
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
	       char *argument)
{
  return ndb_std_get_one_option(optid, opt,
				argument ? argument : "d:t:O,/tmp/ndbd.trace");
}

bool
Configuration::init(int argc, char** argv)
@@ -103,7 +96,11 @@ Configuration::init(int argc, char** argv)
  load_defaults("my",load_default_groups,&argc,&argv);

  int ho_error;
  if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
#ifndef DBUG_OFF
  opt_debug= "d:t:O,/tmp/ndbd.trace";
#endif
  if ((ho_error=handle_options(&argc, &argv, my_long_options,
			       ndb_std_get_one_option)))
    exit(ho_error);

  if (_no_daemon) {
+5 −8
Original line number Diff line number Diff line
@@ -87,13 +87,6 @@ static void usage()
  my_print_help(my_long_options);
  my_print_variables(my_long_options);
}
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
	       char *argument)
{
  return ndb_std_get_one_option(optid, opt, argument ? argument :
				"d:t:O,/tmp/ndb_mgm.trace");
}

static int 
read_and_execute(int _try_reconnect) 
@@ -136,7 +129,11 @@ int main(int argc, char** argv){

  load_defaults("my",load_default_groups,&argc,&argv);
  int ho_error;
  if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
#ifndef DBUG_OFF
  opt_debug= "d:t:O,/tmp/ndb_mgm.trace";
#endif
  if ((ho_error=handle_options(&argc, &argv, my_long_options,
			       ndb_std_get_one_option)))
    exit(ho_error);

  char buf[MAXHOSTNAMELEN+10];
+5 −9
Original line number Diff line number Diff line
@@ -175,14 +175,6 @@ static void usage()
  my_print_help(my_long_options);
  my_print_variables(my_long_options);
}
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
	       char *argument)
{
  ndb_std_get_one_option(optid, opt, argument ? argument :
			 "d:t:O,/tmp/ndb_mgmd.trace");
  return 0;
}

/*
 *  MAIN 
@@ -206,7 +198,11 @@ int main(int argc, char** argv)
  load_defaults("my",load_default_groups,&argc,&argv);

  int ho_error;
  if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
#ifndef DBUG_OFF
  opt_debug= "d:t:O,/tmp/ndb_mgmd.trace";
#endif
  if ((ho_error=handle_options(&argc, &argv, my_long_options, 
			       ndb_std_get_one_option)))
    exit(ho_error);

  if (glob.interactive ||
+3 −22
Original line number Diff line number Diff line
@@ -8,35 +8,16 @@
static const char* _dbname = "TEST_DB";
static int g_loops = 7;

static void print_version()
{
  printf("MySQL distrib %s, for %s (%s)\n",
	 MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
}
static void usage()
{
  char desc[] = 
    "tabname\n"\
    "This program list all properties of table(s) in NDB Cluster.\n"\
    "  ex: desc T1 T2 T4\n";  
  print_version();
  ndb_std_print_version();
}
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
	       char *argument)
{
  switch (optid) {
  case '#':
    DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_desc.trace");
    break;
  case 'V':
    print_version();
    exit(0);
  case '?':
    usage();
    exit(0);
  }
  return 0;
  return ndb_std_get_one_option(optid, opt, argument ? argument :
				"d:t:O,/tmp/testBitfield.trace");
}

static const NdbDictionary::Table* create_random_table(Ndb*);
Loading