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() ...@@ -192,37 +192,38 @@ NdbColumnImpl::~NdbColumnImpl()
bool bool
NdbColumnImpl::equal(const NdbColumnImpl& col) const NdbColumnImpl::equal(const NdbColumnImpl& col) const
{ {
DBUG_ENTER("NdbColumnImpl::equal");
if(strcmp(m_name.c_str(), col.m_name.c_str()) != 0){ if(strcmp(m_name.c_str(), col.m_name.c_str()) != 0){
return false; DBUG_RETURN(false);
} }
if(m_type != col.m_type){ if(m_type != col.m_type){
return false; DBUG_RETURN(false);
} }
if(m_pk != col.m_pk){ if(m_pk != col.m_pk){
return false; DBUG_RETURN(false);
} }
if(m_nullable != col.m_nullable){ if(m_nullable != col.m_nullable){
return false; DBUG_RETURN(false);
} }
if(m_pk){ if(m_pk){
if(m_distributionKey != col.m_distributionKey){ if(m_distributionKey != col.m_distributionKey){
return false; DBUG_RETURN(false);
} }
} }
if (m_precision != col.m_precision || if (m_precision != col.m_precision ||
m_scale != col.m_scale || m_scale != col.m_scale ||
m_length != col.m_length || m_length != col.m_length ||
m_cs != col.m_cs) { m_cs != col.m_cs) {
return false; DBUG_RETURN(false);
} }
if (m_autoIncrement != col.m_autoIncrement){ if (m_autoIncrement != col.m_autoIncrement){
return false; DBUG_RETURN(false);
} }
if(strcmp(m_defaultValue.c_str(), col.m_defaultValue.c_str()) != 0){ if(strcmp(m_defaultValue.c_str(), col.m_defaultValue.c_str()) != 0){
return false; DBUG_RETURN(false);
} }
return true; DBUG_RETURN(true);
} }
NdbDictionary::Column * NdbDictionary::Column *
...@@ -314,49 +315,62 @@ NdbTableImpl::init(){ ...@@ -314,49 +315,62 @@ NdbTableImpl::init(){
bool bool
NdbTableImpl::equal(const NdbTableImpl& obj) const NdbTableImpl::equal(const NdbTableImpl& obj) const
{ {
DBUG_ENTER("NdbTableImpl::equal");
if ((m_internalName.c_str() == NULL) || if ((m_internalName.c_str() == NULL) ||
(strcmp(m_internalName.c_str(), "") == 0) || (strcmp(m_internalName.c_str(), "") == 0) ||
(obj.m_internalName.c_str() == NULL) || (obj.m_internalName.c_str() == NULL) ||
(strcmp(obj.m_internalName.c_str(), "") == 0)) { (strcmp(obj.m_internalName.c_str(), "") == 0)) {
// Shallow equal // Shallow equal
if(strcmp(getName(), obj.getName()) != 0){ if(strcmp(getName(), obj.getName()) != 0){
return false; DBUG_PRINT("info",("name %s != %s",getName(),obj.getName()));
DBUG_RETURN(false);
} }
} else } else
// Deep equal // Deep equal
if(strcmp(m_internalName.c_str(), obj.m_internalName.c_str()) != 0){ 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){ 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()){ 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++){ for(unsigned i = 0; i<obj.m_columns.size(); i++){
if(!m_columns[i]->equal(* obj.m_columns[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){ 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){ 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){ 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){ 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 void
......
...@@ -534,13 +534,6 @@ int runTestFragmentTypes(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -534,13 +534,6 @@ int runTestFragmentTypes(NDBT_Context* ctx, NDBT_Step* step){
int result = NDBT_OK; int result = NDBT_OK;
NdbRestarter restarter; 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){ if (pNdb->waitUntilReady(30) != 0){
// Db is not ready, return with failure // Db is not ready, return with failure
return NDBT_FAILED; return NDBT_FAILED;
...@@ -575,13 +568,17 @@ int runTestFragmentTypes(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -575,13 +568,17 @@ int runTestFragmentTypes(NDBT_Context* ctx, NDBT_Step* step){
result = NDBT_FAILED; result = NDBT_FAILED;
goto drop_the_tab; 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){ if (newTab.equal(*pTab3) == false){
ndbout << "It was not equal" << endl; ndbout << "It was not equal" << endl;
result = NDBT_FAILED; result = NDBT_FAILED;
goto drop_the_tab; goto drop_the_tab;
} }
*/
do { do {
HugoTransactions hugoTrans(*pTab3); HugoTransactions hugoTrans(*pTab3);
...@@ -1598,17 +1595,22 @@ TESTCASE("CreateTableWhenDbIsFull", ...@@ -1598,17 +1595,22 @@ TESTCASE("CreateTableWhenDbIsFull",
} }
TESTCASE("FragmentTypeSingle", TESTCASE("FragmentTypeSingle",
"Create the table with fragment type Single\n"){ "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); INITIALIZER(runTestFragmentTypes);
} }
TESTCASE("FragmentTypeAll", TESTCASE("FragmentTypeAllMedium",
"Create the table with fragment type All\n"){ "Create the table with fragment type AllMedium\n"){
TC_PROPERTY("FragmentType", 2); TC_PROPERTY("FragmentType", NdbDictionary::Table::FragAllMedium);
INITIALIZER(runTestFragmentTypes); INITIALIZER(runTestFragmentTypes);
} }
TESTCASE("FragmentTypeAllLarge", TESTCASE("FragmentTypeAllLarge",
"Create the table with fragment type AllLarge\n"){ "Create the table with fragment type AllLarge\n"){
TC_PROPERTY("FragmentType", 3); TC_PROPERTY("FragmentType", NdbDictionary::Table::FragAllLarge);
INITIALIZER(runTestFragmentTypes); INITIALIZER(runTestFragmentTypes);
} }
TESTCASE("TemporaryTables", TESTCASE("TemporaryTables",
......
...@@ -377,7 +377,7 @@ args: -n FragmentTypeSingle T1 ...@@ -377,7 +377,7 @@ args: -n FragmentTypeSingle T1
max-time: 1500 max-time: 1500
cmd: testDict cmd: testDict
args: -n FragmentTypeAll T1 T6 T7 T8 args: -n FragmentTypeAllSmall T1 T6 T7 T8
max-time: 1500 max-time: 1500
cmd: testDict cmd: testDict
......
...@@ -374,7 +374,7 @@ args: -n FragmentTypeSingle T1 ...@@ -374,7 +374,7 @@ args: -n FragmentTypeSingle T1
max-time: 1500 max-time: 1500
cmd: testDict cmd: testDict
args: -n FragmentTypeAll T1 T6 T7 T8 args: -n FragmentTypeAllSmall T1 T6 T7 T8
max-time: 1500 max-time: 1500
cmd: testDict cmd: testDict
......
...@@ -393,7 +393,7 @@ args: -n FragmentTypeSingle T1 ...@@ -393,7 +393,7 @@ args: -n FragmentTypeSingle T1
max-time: 1500 max-time: 1500
cmd: testDict cmd: testDict
args: -n FragmentTypeAll T1 T6 T7 T8 args: -n FragmentTypeAllSmall T1 T6 T7 T8
max-time: 1500 max-time: 1500
cmd: testDict 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