mirror of
https://github.com/MariaDB/server.git
synced 2025-11-03 14:33:32 +03:00
Irix64 mipspro ndb compile fixes
This commit is contained in:
@@ -105,19 +105,19 @@ ConfigValues::getByPos(Uint32 pos, Entry * result) const {
|
|||||||
Uint64 *
|
Uint64 *
|
||||||
ConfigValues::get64(Uint32 index) const {
|
ConfigValues::get64(Uint32 index) const {
|
||||||
assert(index < m_int64Count);
|
assert(index < m_int64Count);
|
||||||
const Uint32 * data = m_values + (m_size << 1);
|
const Uint32 * data = m_values + (m_size << 1);
|
||||||
Uint64 * ptr = (Uint64*)data;
|
Uint64 * ptr = (Uint64*)data;
|
||||||
ptr += index;
|
ptr += index;
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
char **
|
char **
|
||||||
ConfigValues::getString(Uint32 index) const {
|
ConfigValues::getString(Uint32 index) const {
|
||||||
assert(index < m_stringCount);
|
assert(index < m_stringCount);
|
||||||
const Uint32 * data = m_values + (m_size << 1);
|
const Uint32 * data = m_values + (m_size << 1);
|
||||||
char * ptr = (char*)data;
|
char * ptr = (char*)data;
|
||||||
ptr += m_dataSize;
|
ptr += m_dataSize;
|
||||||
ptr -= (index * sizeof(char *));
|
ptr -= (index * sizeof(char *));
|
||||||
return (char**)ptr;
|
return (char**)ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,9 +261,9 @@ directory(Uint32 sz){
|
|||||||
ConfigValuesFactory::ConfigValuesFactory(Uint32 keys, Uint32 data){
|
ConfigValuesFactory::ConfigValuesFactory(Uint32 keys, Uint32 data){
|
||||||
m_sectionCounter = (1 << KP_SECTION_SHIFT);
|
m_sectionCounter = (1 << KP_SECTION_SHIFT);
|
||||||
m_freeKeys = directory(keys);
|
m_freeKeys = directory(keys);
|
||||||
m_freeData = data;
|
m_freeData = ((data + 7) & ~7);
|
||||||
m_currentSection = 0;
|
m_currentSection = 0;
|
||||||
m_cfg = create(m_freeKeys, data);
|
m_cfg = create(m_freeKeys, m_freeData);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigValuesFactory::ConfigValuesFactory(ConfigValues * cfg){
|
ConfigValuesFactory::ConfigValuesFactory(ConfigValues * cfg){
|
||||||
@@ -316,7 +316,8 @@ ConfigValuesFactory::expand(Uint32 fk, Uint32 fs){
|
|||||||
m_freeKeys = (m_freeKeys >= fk ? m_cfg->m_size : fk + m_cfg->m_size);
|
m_freeKeys = (m_freeKeys >= fk ? m_cfg->m_size : fk + m_cfg->m_size);
|
||||||
m_freeData = (m_freeData >= fs ? m_cfg->m_dataSize : fs + m_cfg->m_dataSize);
|
m_freeData = (m_freeData >= fs ? m_cfg->m_dataSize : fs + m_cfg->m_dataSize);
|
||||||
m_freeKeys = directory(m_freeKeys);
|
m_freeKeys = directory(m_freeKeys);
|
||||||
|
m_freeData = ((m_freeData + 7) & ~7);
|
||||||
|
|
||||||
ConfigValues * m_tmp = m_cfg;
|
ConfigValues * m_tmp = m_cfg;
|
||||||
m_cfg = create(m_freeKeys, m_freeData);
|
m_cfg = create(m_freeKeys, m_freeData);
|
||||||
put(* m_tmp);
|
put(* m_tmp);
|
||||||
@@ -333,6 +334,7 @@ ConfigValuesFactory::shrink(){
|
|||||||
m_freeKeys = m_cfg->m_size - m_freeKeys;
|
m_freeKeys = m_cfg->m_size - m_freeKeys;
|
||||||
m_freeData = m_cfg->m_dataSize - m_freeData;
|
m_freeData = m_cfg->m_dataSize - m_freeData;
|
||||||
m_freeKeys = directory(m_freeKeys);
|
m_freeKeys = directory(m_freeKeys);
|
||||||
|
m_freeData = ((m_freeData + 7) & ~7);
|
||||||
|
|
||||||
ConfigValues * m_tmp = m_cfg;
|
ConfigValues * m_tmp = m_cfg;
|
||||||
m_cfg = create(m_freeKeys, m_freeData);
|
m_cfg = create(m_freeKeys, m_freeData);
|
||||||
@@ -462,7 +464,7 @@ ConfigValuesFactory::put(const ConfigValues::Entry & entry){
|
|||||||
case ConfigValues::StringType:{
|
case ConfigValues::StringType:{
|
||||||
Uint32 index = m_cfg->m_stringCount++;
|
Uint32 index = m_cfg->m_stringCount++;
|
||||||
m_cfg->m_values[pos+1] = index;
|
m_cfg->m_values[pos+1] = index;
|
||||||
char ** ref = m_cfg->getString(index);
|
char ** ref = m_cfg->getString(index);
|
||||||
* ref = strdup(entry.m_string ? entry.m_string : "");
|
* ref = strdup(entry.m_string ? entry.m_string : "");
|
||||||
m_freeKeys--;
|
m_freeKeys--;
|
||||||
m_freeData -= sizeof(char *);
|
m_freeData -= sizeof(char *);
|
||||||
|
|||||||
@@ -243,20 +243,17 @@ MgmtSrvr::startEventLog()
|
|||||||
char clusterLog[MAXPATHLEN];
|
char clusterLog[MAXPATHLEN];
|
||||||
NdbConfig_ClusterLogFileName(clusterLog, sizeof(clusterLog));
|
NdbConfig_ClusterLogFileName(clusterLog, sizeof(clusterLog));
|
||||||
|
|
||||||
|
|
||||||
if(ndb_mgm_get_string_parameter(iter, CFG_LOG_DESTINATION, &tmp) == 0){
|
if(ndb_mgm_get_string_parameter(iter, CFG_LOG_DESTINATION, &tmp) == 0){
|
||||||
logdest.assign(tmp);
|
logdest.assign(tmp);
|
||||||
}
|
}
|
||||||
ndb_mgm_destroy_iterator(iter);
|
ndb_mgm_destroy_iterator(iter);
|
||||||
|
|
||||||
if(logdest.length()==0) {
|
if(logdest.length() == 0 || logdest == "") {
|
||||||
logdest.assfmt("FILE:filename=%s,maxsize=1000000,maxfiles=6",
|
logdest.assfmt("FILE:filename=%s,maxsize=1000000,maxfiles=6",
|
||||||
clusterLog);
|
clusterLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!g_EventLogger.addHandler(logdest)) {
|
if(!g_EventLogger.addHandler(logdest)) {
|
||||||
ndbout << "ERROR: cannot parse \"" << logdest << "\"" << endl;
|
ndbout << "Warning: could not add log destination \"" << logdest.c_str() << "\"" << endl;
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -337,7 +337,6 @@ static const tab2 table2[] = {
|
|||||||
const int tab_sz = sizeof(table)/sizeof(table[0]);
|
const int tab_sz = sizeof(table)/sizeof(table[0]);
|
||||||
const int tab2_sz = sizeof(table2)/sizeof(table2[0]);
|
const int tab2_sz = sizeof(table2)/sizeof(table2[0]);
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
int
|
int
|
||||||
matchType(const NdbDictionary::Column * col){
|
matchType(const NdbDictionary::Column * col){
|
||||||
return 1;
|
return 1;
|
||||||
@@ -382,7 +381,7 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!matchType<T>(col)){
|
if(!matchType(col)){
|
||||||
/**
|
/**
|
||||||
* Code not reached
|
* Code not reached
|
||||||
*/
|
*/
|
||||||
@@ -777,3 +776,9 @@ main(void){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
template class Vector<NdbScanFilterImpl::State>;
|
||||||
|
template int NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition, Uint32 attrId, Uint32);
|
||||||
|
template int NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition, Uint32 attrId, Uint64);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,8 @@
|
|||||||
HugoCalculator::HugoCalculator(const NdbDictionary::Table& tab) : m_tab(tab) {
|
HugoCalculator::HugoCalculator(const NdbDictionary::Table& tab) : m_tab(tab) {
|
||||||
|
|
||||||
// The "id" column of this table is found in the first integer column
|
// The "id" column of this table is found in the first integer column
|
||||||
for (int i=0; i<m_tab.getNoOfColumns(); i++){
|
int i;
|
||||||
|
for (i=0; i<m_tab.getNoOfColumns(); i++){
|
||||||
const NdbDictionary::Column* attr = m_tab.getColumn(i);
|
const NdbDictionary::Column* attr = m_tab.getColumn(i);
|
||||||
if (attr->getType() == NdbDictionary::Column::Unsigned){
|
if (attr->getType() == NdbDictionary::Column::Unsigned){
|
||||||
m_idCol = i;
|
m_idCol = i;
|
||||||
@@ -37,7 +38,7 @@ HugoCalculator::HugoCalculator(const NdbDictionary::Table& tab) : m_tab(tab) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The "number of updates" column for this table is found in the last column
|
// The "number of updates" column for this table is found in the last column
|
||||||
for (int i=m_tab.getNoOfColumns()-1; i>=0; i--){
|
for (i=m_tab.getNoOfColumns()-1; i>=0; i--){
|
||||||
const NdbDictionary::Column* attr = m_tab.getColumn(i);
|
const NdbDictionary::Column* attr = m_tab.getColumn(i);
|
||||||
if (attr->getType() == NdbDictionary::Column::Unsigned){
|
if (attr->getType() == NdbDictionary::Column::Unsigned){
|
||||||
m_updatesCol = i;
|
m_updatesCol = i;
|
||||||
@@ -102,7 +103,8 @@ HugoCalculator::calcValue(int record,
|
|||||||
|
|
||||||
// Fill buf with some pattern so that we can detect
|
// Fill buf with some pattern so that we can detect
|
||||||
// anomalies in the area that we don't fill with chars
|
// anomalies in the area that we don't fill with chars
|
||||||
for (int i = 0; i<attr->getLength(); i++)
|
int i;
|
||||||
|
for (i = 0; i<attr->getLength(); i++)
|
||||||
buf[i] = ((i+2) % 255);
|
buf[i] = ((i+2) % 255);
|
||||||
|
|
||||||
// Calculate length of the string to create. We want the string
|
// Calculate length of the string to create. We want the string
|
||||||
@@ -116,7 +118,7 @@ HugoCalculator::calcValue(int record,
|
|||||||
else
|
else
|
||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
for(int i=0; i < len; i++)
|
for(i=0; i < len; i++)
|
||||||
buf[i] = a[((val^i)%25)];
|
buf[i] = a[((val^i)%25)];
|
||||||
buf[len] = 0;
|
buf[len] = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -678,17 +678,18 @@ NdbDictionary::Table*
|
|||||||
NDBT_Tables::getTable(const char* _nam){
|
NDBT_Tables::getTable(const char* _nam){
|
||||||
// Search tables list to find a table
|
// Search tables list to find a table
|
||||||
NDBT_Table* tab = NULL;
|
NDBT_Table* tab = NULL;
|
||||||
for (int i=0; i<numTestTables; i++){
|
int i;
|
||||||
|
for (i=0; i<numTestTables; i++){
|
||||||
if (strcmp(test_tables[i]->getName(), _nam) == 0){
|
if (strcmp(test_tables[i]->getName(), _nam) == 0){
|
||||||
return test_tables[i];
|
return test_tables[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i=0; i<numFailTables; i++){
|
for (i=0; i<numFailTables; i++){
|
||||||
if (strcmp(fail_tables[i]->getName(), _nam) == 0){
|
if (strcmp(fail_tables[i]->getName(), _nam) == 0){
|
||||||
return fail_tables[i];
|
return fail_tables[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i=0; i<numUtilTables; i++){
|
for (i=0; i<numUtilTables; i++){
|
||||||
if (strcmp(util_tables[i]->getName(), _nam) == 0){
|
if (strcmp(util_tables[i]->getName(), _nam) == 0){
|
||||||
return util_tables[i];
|
return util_tables[i];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -336,24 +336,24 @@ NDBT_TestCaseImpl1::NDBT_TestCaseImpl1(NDBT_TestSuite* psuite,
|
|||||||
NDBT_TestCaseImpl1::~NDBT_TestCaseImpl1(){
|
NDBT_TestCaseImpl1::~NDBT_TestCaseImpl1(){
|
||||||
NdbCondition_Destroy(waitThreadsCondPtr);
|
NdbCondition_Destroy(waitThreadsCondPtr);
|
||||||
NdbMutex_Destroy(waitThreadsMutexPtr);
|
NdbMutex_Destroy(waitThreadsMutexPtr);
|
||||||
|
size_t i;
|
||||||
for(size_t i = 0; i < initializers.size(); i++)
|
for(i = 0; i < initializers.size(); i++)
|
||||||
delete initializers[i];
|
delete initializers[i];
|
||||||
initializers.clear();
|
initializers.clear();
|
||||||
for(size_t i = 0; i < verifiers.size(); i++)
|
for(i = 0; i < verifiers.size(); i++)
|
||||||
delete verifiers[i];
|
delete verifiers[i];
|
||||||
verifiers.clear();
|
verifiers.clear();
|
||||||
for(size_t i = 0; i < finalizers.size(); i++)
|
for(i = 0; i < finalizers.size(); i++)
|
||||||
delete finalizers[i];
|
delete finalizers[i];
|
||||||
finalizers.clear();
|
finalizers.clear();
|
||||||
for(size_t i = 0; i < steps.size(); i++)
|
for(i = 0; i < steps.size(); i++)
|
||||||
delete steps[i];
|
delete steps[i];
|
||||||
steps.clear();
|
steps.clear();
|
||||||
results.clear();
|
results.clear();
|
||||||
for(size_t i = 0; i < testTables.size(); i++)
|
for(i = 0; i < testTables.size(); i++)
|
||||||
delete testTables[i];
|
delete testTables[i];
|
||||||
testTables.clear();
|
testTables.clear();
|
||||||
for(size_t i = 0; i < testResults.size(); i++)
|
for(i = 0; i < testResults.size(); i++)
|
||||||
delete testResults[i];
|
delete testResults[i];
|
||||||
testResults.clear();
|
testResults.clear();
|
||||||
|
|
||||||
@@ -487,7 +487,8 @@ void NDBT_TestCaseImpl1::waitSteps(){
|
|||||||
waitThreadsMutexPtr);
|
waitThreadsMutexPtr);
|
||||||
|
|
||||||
unsigned completedSteps = 0;
|
unsigned completedSteps = 0;
|
||||||
for(unsigned i=0; i<steps.size(); i++){
|
unsigned i;
|
||||||
|
for(i=0; i<steps.size(); i++){
|
||||||
if (results[i] != NORESULT){
|
if (results[i] != NORESULT){
|
||||||
completedSteps++;
|
completedSteps++;
|
||||||
if (results[i] == NDBT_OK)
|
if (results[i] == NDBT_OK)
|
||||||
@@ -501,7 +502,7 @@ void NDBT_TestCaseImpl1::waitSteps(){
|
|||||||
|
|
||||||
NdbMutex_Unlock(waitThreadsMutexPtr);
|
NdbMutex_Unlock(waitThreadsMutexPtr);
|
||||||
void *status;
|
void *status;
|
||||||
for(unsigned i=0; i<steps.size();i++){
|
for(i=0; i<steps.size();i++){
|
||||||
NdbThread_WaitFor(threads[i], &status);
|
NdbThread_WaitFor(threads[i], &status);
|
||||||
NdbThread_Destroy(&threads[i]);
|
NdbThread_Destroy(&threads[i]);
|
||||||
}
|
}
|
||||||
@@ -633,12 +634,12 @@ int NDBT_TestCaseImpl1::runSteps(NDBT_Context* ctx){
|
|||||||
numStepsOk = 0;
|
numStepsOk = 0;
|
||||||
numStepsFail = 0;
|
numStepsFail = 0;
|
||||||
numStepsCompleted = 0;
|
numStepsCompleted = 0;
|
||||||
|
unsigned i;
|
||||||
for (unsigned i = 0; i < steps.size(); i++)
|
for (i = 0; i < steps.size(); i++)
|
||||||
startStepInThread(i, ctx);
|
startStepInThread(i, ctx);
|
||||||
waitSteps();
|
waitSteps();
|
||||||
|
|
||||||
for(unsigned i = 0; i < steps.size(); i++)
|
for(i = 0; i < steps.size(); i++)
|
||||||
if (results[i] != NDBT_OK)
|
if (results[i] != NDBT_OK)
|
||||||
res = NDBT_FAILED;
|
res = NDBT_FAILED;
|
||||||
return res;
|
return res;
|
||||||
@@ -1091,20 +1092,20 @@ void NDBT_TestCaseImpl1::print(){
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
unsigned i;
|
||||||
for(unsigned i=0; i<initializers.size(); i++){
|
for(i=0; i<initializers.size(); i++){
|
||||||
ndbout << "Initializers[" << i << "]: " << endl;
|
ndbout << "Initializers[" << i << "]: " << endl;
|
||||||
initializers[i]->print();
|
initializers[i]->print();
|
||||||
}
|
}
|
||||||
for(unsigned i=0; i<steps.size(); i++){
|
for(i=0; i<steps.size(); i++){
|
||||||
ndbout << "Step[" << i << "]: " << endl;
|
ndbout << "Step[" << i << "]: " << endl;
|
||||||
steps[i]->print();
|
steps[i]->print();
|
||||||
}
|
}
|
||||||
for(unsigned i=0; i<verifiers.size(); i++){
|
for(i=0; i<verifiers.size(); i++){
|
||||||
ndbout << "Verifier[" << i << "]: " << endl;
|
ndbout << "Verifier[" << i << "]: " << endl;
|
||||||
verifiers[i]->print();
|
verifiers[i]->print();
|
||||||
}
|
}
|
||||||
for(unsigned i=0; i<finalizers.size(); i++){
|
for(i=0; i<finalizers.size(); i++){
|
||||||
ndbout << "Finalizer[" << i << "]: " << endl;
|
ndbout << "Finalizer[" << i << "]: " << endl;
|
||||||
finalizers[i]->print();
|
finalizers[i]->print();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,8 @@ getStatus(){
|
|||||||
retries++;
|
retries++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < status->no_of_nodes; i++){
|
int count = status->no_of_nodes;
|
||||||
|
for (int i = 0; i < count; i++){
|
||||||
node = &status->node_states[i];
|
node = &status->node_states[i];
|
||||||
switch(node->node_type){
|
switch(node->node_type){
|
||||||
case NDB_MGM_NODE_TYPE_NDB:
|
case NDB_MGM_NODE_TYPE_NDB:
|
||||||
@@ -142,7 +143,7 @@ getStatus(){
|
|||||||
apiNodes.clear();
|
apiNodes.clear();
|
||||||
free(status);
|
free(status);
|
||||||
status = NULL;
|
status = NULL;
|
||||||
i = status->no_of_nodes;
|
count = 0;
|
||||||
|
|
||||||
ndbout << "kalle"<< endl;
|
ndbout << "kalle"<< endl;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user