mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
added skip create option to bank test program
This commit is contained in:
parent
0bdfbfe8da
commit
47e831ca1f
3 changed files with 7 additions and 2 deletions
|
@ -29,6 +29,7 @@ public:
|
|||
|
||||
Bank(Ndb_cluster_connection&, bool init = true, const char *dbase="BANK");
|
||||
|
||||
int setSkipCreate(bool skip) { m_skip_create = skip; }
|
||||
int createAndLoadBank(bool overWrite, bool disk= false, int num_accounts=10);
|
||||
int dropBank();
|
||||
|
||||
|
@ -140,6 +141,7 @@ private:
|
|||
Ndb m_ndb;
|
||||
int m_maxAccount;
|
||||
bool m_initialized;
|
||||
bool m_skip_create;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -58,7 +58,7 @@ int Bank::createAndLoadBank(bool ovrWrt, bool disk, int num_accounts){
|
|||
m_ndb.init();
|
||||
if (m_ndb.waitUntilReady() != 0)
|
||||
return NDBT_FAILED;
|
||||
|
||||
|
||||
const NdbDictionary::Table* pSysValTab =
|
||||
m_ndb.getDictionary()->getTable("SYSTEM_VALUES");
|
||||
if (pSysValTab != NULL){
|
||||
|
@ -69,7 +69,7 @@ int Bank::createAndLoadBank(bool ovrWrt, bool disk, int num_accounts){
|
|||
}
|
||||
}
|
||||
|
||||
if (createTables(disk) != NDBT_OK)
|
||||
if (!m_skip_create && createTables(disk) != NDBT_OK)
|
||||
return NDBT_FAILED;
|
||||
|
||||
if (clearTables() != NDBT_OK)
|
||||
|
|
|
@ -31,10 +31,12 @@ int main(int argc, const char** argv){
|
|||
int _help = 0;
|
||||
char * _database = "BANK";
|
||||
int disk = 0;
|
||||
int skip_create = 0;
|
||||
|
||||
struct getargs args[] = {
|
||||
{ "database", 'd', arg_string, &_database, "Database name", ""},
|
||||
{ "disk", 0, arg_flag, &disk, "Use disk tables", "" },
|
||||
{ "skip-create", 0, arg_flag, &skip_create, "Skip create", "" },
|
||||
{ "usage", '?', arg_flag, &_help, "Print help", "" }
|
||||
};
|
||||
int num_args = sizeof(args) / sizeof(args[0]);
|
||||
|
@ -55,6 +57,7 @@ int main(int argc, const char** argv){
|
|||
|
||||
Bank bank(con,_database);
|
||||
int overWriteExisting = true;
|
||||
bank.setSkipCreate(skip_create);
|
||||
if (bank.createAndLoadBank(overWriteExisting, disk) != NDBT_OK)
|
||||
return NDBT_ProgramExit(NDBT_FAILED);
|
||||
return NDBT_ProgramExit(NDBT_OK);
|
||||
|
|
Loading…
Add table
Reference in a new issue