Commit 0f5cf864 authored by unknown's avatar unknown

NdbRepStress.cpp:

  Updated with suggestions from Magnus and other fixes and adjustments I found along the way
DbUtil.hpp, DbUtil.cpp:
  fixes and adjustments I found along the way


storage/ndb/test/ndbapi/acrt/NdbRepStress.cpp:
  Updated with suggestions from Magnus and other fixes and adjustments I found along the way
storage/ndb/test/src/DbUtil.cpp:
  fixes and adjustments I found along the way
storage/ndb/test/include/DbUtil.hpp:
  fixes and adjustments I found along the way
parent e3eadd61
......@@ -89,7 +89,8 @@ public:
void mysqlCloseStmHandle(MYSQL_STMT *my_stmt);
int connect();
int select_DB();
int selectDb();
int selectDb(const char * m_db);
int doQuery(char * stm);
int doQuery(const char * stm);
int getErrorNumber();
......
This diff is collapsed.
......@@ -215,23 +215,57 @@ DbUtil::printStError(MYSQL_STMT *stmt, const char *msg)
/* Select which database to use */
int
DbUtil::select_DB()
DbUtil::selectDb()
{
return mysql_select_db(this->getMysql(), this->getDbName());
if ((this->getDbName()) != NULL)
{
if(mysql_select_db(this->getMysql(), this->getDbName()))
{
this->printError("mysql_select_db failed");
return DBU_FAILED;
}
return DBU_OK;
}
this->printError("getDbName() == NULL");
return DBU_FAILED;
}
int
DbUtil::selectDb(const char * m_db)
{
{
if(mysql_select_db(this->getMysql(), m_db))
{
this->printError("mysql_select_db failed");
return DBU_FAILED;
}
return DBU_OK;
}
}
/* Run Simple Queries */
int
DbUtil::doQuery(char * stm)
{
return mysql_query(this->getMysql(), stm);
if(mysql_query(this->getMysql(), stm))
{
this->printError(stm);
return DBU_FAILED;
}
return DBU_OK;
}
int
DbUtil::doQuery(const char * stm)
{
return mysql_query(this->getMysql(), stm);
if(mysql_query(this->getMysql(), stm))
{
this->printError(stm);
return DBU_FAILED;
}
return DBU_OK;
}
/* Return MySQL Error String */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment