19 #include <ndb_global.h>
28 #include <UtilTransactions.hpp>
31 int main(
int argc,
const char** argv){
33 int _parallelism = 240;
34 const char* _tabname = NULL;
35 const char* _indexname = NULL;
39 {
"parallelism",
's', arg_integer, &_parallelism,
"parallelism",
"parallelism" },
40 {
"usage",
'?', arg_flag, &_help,
"Print help",
"" }
42 int num_args =
sizeof(args) /
sizeof(args[0]);
45 "tabname indexname\n"\
46 "This program will verify the index [indexname] and compare it to data\n"
47 "in table [tablename]\n";
49 if(getarg(args, num_args, argc, argv, &optind) ||
50 argv[optind] == NULL || argv[optind+1] == NULL || _help) {
51 arg_printusage(args, num_args, argv[0], desc);
52 return NDBT_ProgramExit(NDBT_WRONGARGS);
54 _tabname = argv[optind];
55 _indexname = argv[optind+1];
61 return NDBT_ProgramExit(NDBT_FAILED);
63 Ndb MyNdb(&con,
"TEST_DB" );
65 if(MyNdb.init() != 0){
66 ERR(MyNdb.getNdbError());
67 return NDBT_ProgramExit(NDBT_FAILED);
71 while(MyNdb.waitUntilReady() != 0)
72 ndbout <<
"Waiting for ndb to become ready..." << endl;
77 ndbout <<
" Table " << _tabname <<
" does not exist!" << endl;
78 return NDBT_ProgramExit(NDBT_FAILED);
82 if (utilTrans.verifyIndex(&MyNdb,
85 return NDBT_ProgramExit(NDBT_FAILED);
88 return NDBT_ProgramExit(NDBT_OK);