Commit b0af47bc authored by unknown's avatar unknown

adopted test scripts


ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  added debug printouts
ndb/test/ndbapi/testDict.cpp:
  updated FragmentType tests, removed failing "equal" on the tables since they will not be equal because fragmentation is updated from the kernel
ndb/test/run-test/16node-tests.txt:
  adopted test scripts to new Fragment test name
ndb/test/run-test/basic.txt:
  adopted test scripts to new Fragment test name
ndb/test/run-test/daily-basic-tests.txt:
  adopted test scripts to new Fragment test name
parent 488fb181
......@@ -192,37 +192,38 @@ NdbColumnImpl::~NdbColumnImpl()
bool
NdbColumnImpl::equal(const NdbColumnImpl& col) const
{
DBUG_ENTER("NdbColumnImpl::equal");
if(strcmp(m_name.c_str(), col.m_name.c_str()) != 0){
return false;
DBUG_RETURN(false);
}
if(m_type != col.m_type){
return false;
DBUG_RETURN(false);
}
if(m_pk != col.m_pk){
return false;
DBUG_RETURN(false);
}
if(m_nullable != col.m_nullable){
return false;
DBUG_RETURN(false);
}
if(m_pk){
if(m_distributionKey != col.m_distributionKey){
return false;
DBUG_RETURN(false);
}
}
if (m_precision != col.m_precision ||
m_scale != col.m_scale ||
m_length != col.m_length ||
m_cs != col.m_cs) {
return false;
DBUG_RETURN(false);
}
if (m_autoIncrement != col.m_autoIncrement){
return false;
DBUG_RETURN(false);
}
if(strcmp(m_defaultValue.c_str(), col.m_defaultValue.c_str()) != 0){
return false;
DBUG_RETURN(false);
}
return true;
DBUG_RETURN(true);
}
NdbDictionary::Column *
......@@ -314,49 +315,62 @@ NdbTableImpl::init(){
bool
NdbTableImpl::equal(const NdbTableImpl& obj) const
{
DBUG_ENTER("NdbTableImpl::equal");
if ((m_internalName.c_str() == NULL) ||
(strcmp(m_internalName.c_str(), "") == 0) ||
(obj.m_internalName.c_str() == NULL) ||
(strcmp(obj.m_internalName.c_str(), "") == 0)) {
// Shallow equal
if(strcmp(getName(), obj.getName()) != 0){
return false;
DBUG_PRINT("info",("name %s != %s",getName(),obj.getName()));
DBUG_RETURN(false);
}
} else
// Deep equal
if(strcmp(m_internalName.c_str(), obj.m_internalName.c_str()) != 0){
return false;
{
DBUG_PRINT("info",("m_internalName %s != %s",
m_internalName.c_str(),obj.m_internalName.c_str()));
DBUG_RETURN(false);
}
}
if(m_fragmentType != obj.m_fragmentType){
return false;
DBUG_PRINT("info",("m_fragmentType %d != %d",m_fragmentType,obj.m_fragmentType));
DBUG_RETURN(false);
}
if(m_columns.size() != obj.m_columns.size()){
return false;
DBUG_PRINT("info",("m_columns.size %d != %d",m_columns.size(),obj.m_columns.size()));
DBUG_RETURN(false);
}
for(unsigned i = 0; i<obj.m_columns.size(); i++){
if(!m_columns[i]->equal(* obj.m_columns[i])){
return false;
DBUG_PRINT("info",("m_columns [%d] != [%d]",i,i));
DBUG_RETURN(false);
}
}
if(m_logging != obj.m_logging){
return false;
DBUG_PRINT("info",("m_logging %d != %d",m_logging,obj.m_logging));
DBUG_RETURN(false);
}
if(m_kvalue != obj.m_kvalue){
return false;
DBUG_PRINT("info",("m_kvalue %d != %d",m_kvalue,obj.m_kvalue));
DBUG_RETURN(false);
}
if(m_minLoadFactor != obj.m_minLoadFactor){
return false;
DBUG_PRINT("info",("m_minLoadFactor %d != %d",m_minLoadFactor,obj.m_minLoadFactor));
DBUG_RETURN(false);
}
if(m_maxLoadFactor != obj.m_maxLoadFactor){
return false;
DBUG_PRINT("info",("m_maxLoadFactor %d != %d",m_maxLoadFactor,obj.m_maxLoadFactor));
DBUG_RETURN(false);
}
return true;
DBUG_RETURN(true);
}
void
......
......@@ -534,13 +534,6 @@ int runTestFragmentTypes(NDBT_Context* ctx, NDBT_Step* step){
int result = NDBT_OK;
NdbRestarter restarter;
// enum FragmentType {
// Unknown = 0,
// Single = 1, ///< Only one fragment
// All = 2, ///< Default value. One fragment per node group
// AllLarge = 3 ///< Sixten fragments per node group.
// };
if (pNdb->waitUntilReady(30) != 0){
// Db is not ready, return with failure
return NDBT_FAILED;
......@@ -575,13 +568,17 @@ int runTestFragmentTypes(NDBT_Context* ctx, NDBT_Step* step){
result = NDBT_FAILED;
goto drop_the_tab;
}
/**
This test does not work since fragmentation is
decided by the kernel, hence the fragementation
attribute on the column will differ
if (newTab.equal(*pTab3) == false){
ndbout << "It was not equal" << endl;
result = NDBT_FAILED;
goto drop_the_tab;
}
*/
do {
HugoTransactions hugoTrans(*pTab3);
......@@ -1598,17 +1595,22 @@ TESTCASE("CreateTableWhenDbIsFull",
}
TESTCASE("FragmentTypeSingle",
"Create the table with fragment type Single\n"){
TC_PROPERTY("FragmentType", 1);
TC_PROPERTY("FragmentType", NdbDictionary::Table::FragSingle);
INITIALIZER(runTestFragmentTypes);
}
TESTCASE("FragmentTypeAllSmall",
"Create the table with fragment type AllSmall\n"){
TC_PROPERTY("FragmentType", NdbDictionary::Table::FragAllSmall);
INITIALIZER(runTestFragmentTypes);
}
TESTCASE("FragmentTypeAll",
"Create the table with fragment type All\n"){
TC_PROPERTY("FragmentType", 2);
TESTCASE("FragmentTypeAllMedium",
"Create the table with fragment type AllMedium\n"){
TC_PROPERTY("FragmentType", NdbDictionary::Table::FragAllMedium);
INITIALIZER(runTestFragmentTypes);
}
TESTCASE("FragmentTypeAllLarge",
"Create the table with fragment type AllLarge\n"){
TC_PROPERTY("FragmentType", 3);
TC_PROPERTY("FragmentType", NdbDictionary::Table::FragAllLarge);
INITIALIZER(runTestFragmentTypes);
}
TESTCASE("TemporaryTables",
......
......@@ -377,7 +377,7 @@ args: -n FragmentTypeSingle T1
max-time: 1500
cmd: testDict
args: -n FragmentTypeAll T1 T6 T7 T8
args: -n FragmentTypeAllSmall T1 T6 T7 T8
max-time: 1500
cmd: testDict
......
......@@ -374,7 +374,7 @@ args: -n FragmentTypeSingle T1
max-time: 1500
cmd: testDict
args: -n FragmentTypeAll T1 T6 T7 T8
args: -n FragmentTypeAllSmall T1 T6 T7 T8
max-time: 1500
cmd: testDict
......
......@@ -393,7 +393,7 @@ args: -n FragmentTypeSingle T1
max-time: 1500
cmd: testDict
args: -n FragmentTypeAll T1 T6 T7 T8
args: -n FragmentTypeAllSmall T1 T6 T7 T8
max-time: 1500
cmd: testDict
......
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