18 #include <ndb_global.h> 
   25 static const char* _dbname = 
"TEST_DB";
 
   27 const char *load_default_groups[]= { 
"mysql_cluster",0 };
 
   29 static struct my_option my_long_options[] =
 
   31   NDB_STD_OPTS(
"ndb_desc"),
 
   32   { 
"database", 
'd', 
"Name of database table is in",
 
   33     (uchar**) &_dbname, (uchar**) &_dbname, 0,
 
   34     GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
 
   35   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 
   38 static void short_usage_sub(
void)
 
   40   ndb_short_usage_sub(NULL);
 
   45   ndb_usage(short_usage_sub, load_default_groups, my_long_options);
 
   48 int main(
int argc, 
char** argv){
 
   50   ndb_opt_set_usage_funcs(short_usage_sub, usage);
 
   51   load_defaults(
"my",load_default_groups,&argc,&argv);
 
   53   if ((ho_error=handle_options(&argc, &argv, my_long_options,
 
   54                                ndb_std_get_one_option)))
 
   55     return NDBT_ProgramExit(NDBT_WRONGARGS);
 
   58     return NDBT_ProgramExit(NDBT_WRONGARGS);
 
   65     return NDBT_ProgramExit(NDBT_FAILED);
 
   69     ndbout << 
"Cluster nodes not ready in 30 seconds." << endl;
 
   70     return NDBT_ProgramExit(NDBT_FAILED);
 
   73   Ndb MyNdb(&con, _dbname );
 
   74   if(MyNdb.init() != 0){
 
   75     ERR(MyNdb.getNdbError());
 
   76     return NDBT_ProgramExit(NDBT_FAILED);
 
   80   for(
int i = 0; 
i+1<argc; 
i += 2){
 
   81     ndbout << 
"Dropping index " << argv[
i] << 
"/" << argv[
i+1] << 
"...";
 
   83     if((tmp = MyNdb.getDictionary()->dropIndex(argv[
i+1], argv[
i])) != 0){
 
   84       ndbout << endl << MyNdb.getDictionary()->getNdbError() << endl;
 
   87       ndbout << 
"OK" << endl;
 
   92     return NDBT_ProgramExit(NDBT_FAILED);
 
   95   return NDBT_ProgramExit(NDBT_OK);