diff options
Diffstat (limited to 'ndb/src')
-rw-r--r-- | ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp | 2 | ||||
-rw-r--r-- | ndb/src/mgmsrv/MgmtSrvr.cpp | 5 | ||||
-rw-r--r-- | ndb/src/mgmsrv/main.cpp | 19 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbIndexOperation.cpp | 35 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbOperationSearch.cpp | 36 |
5 files changed, 53 insertions, 44 deletions
diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp index afde88c47a2..8677ae741b3 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp @@ -172,7 +172,7 @@ Dbtux::execTUX_BOUND_INFO(Signal* signal) BoundInfo& b = boundInfo[j][attrId]; if (b.type != -1) { // compare with previous bound - if (b.type != type2 || + if (b.type != (int)type2 || b.size != 2 + dataSize || memcmp(&data[b.offset + 2], &data[offset + 2], dataSize << 2) != 0) { jam(); diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index c93ca168f26..29df10630f3 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -1664,7 +1664,10 @@ MgmtSrvr::setSignalLoggingMode(int processId, LogMode mode, logSpec = TestOrd::InputOutputSignals; break; default: - assert("Unexpected value, MgmtSrvr::setSignalLoggingMode" == 0); + ndbout_c("Unexpected value %d, MgmtSrvr::setSignalLoggingMode, line %d", + (unsigned)mode, __LINE__); + assert(false); + return -1; } NdbApiSignal* signal = getSignal(); diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 51282416c24..5ee48e4cfcc 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -104,24 +104,25 @@ const char *debug_option= 0; struct getargs args[] = { { "version", 'v', arg_flag, &_print_version, - "Print ndb_mgmd version"}, + "Print ndb_mgmd version",""}, { "config-file", 'c', arg_string, &glob.config_filename, - "Specify cluster configuration file (will default use config.ini if available)", "filename" }, + "Specify cluster configuration file (default config.ini if available)", + "filename"}, #ifndef DBUG_OFF { "debug", 0, arg_string, &debug_option, - "Specify debug options e.g. d:t:i:o,out.trace", "options" }, + "Specify debug options e.g. d:t:i:o,out.trace", "options"}, #endif { "daemon", 'd', arg_flag, &glob.daemon, - "Run ndb_mgmd in daemon mode (default)" }, + "Run ndb_mgmd in daemon mode (default)",""}, { NULL, 'l', arg_string, &glob.local_config_filename, - "Specify configuration file connect string (will default use Ndb.cfg if available)", - "filename" }, + "Specify configuration file connect string (default Ndb.cfg if available)", + "filename"}, { "interactive", 0, arg_flag, &glob.interactive, - "Run interactive. Not supported but provided for testing purposes", "" }, + "Run interactive. Not supported but provided for testing purposes", ""}, { "no-nodeid-checks", 0, arg_flag, &g_no_nodeid_checks, - "Do not provide any node id checks", "" }, + "Do not provide any node id checks", ""}, { "nodaemon", 0, arg_flag, &glob.non_interactive, - "Don't run as daemon, but don't read from stdin", "non-interactive" } + "Don't run as daemon, but don't read from stdin", "non-interactive"} }; int num_args = sizeof(args) / sizeof(args[0]); diff --git a/ndb/src/ndbapi/NdbIndexOperation.cpp b/ndb/src/ndbapi/NdbIndexOperation.cpp index 83de6d9ef87..9abde639914 100644 --- a/ndb/src/ndbapi/NdbIndexOperation.cpp +++ b/ndb/src/ndbapi/NdbIndexOperation.cpp @@ -242,6 +242,24 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, m_theIndexDefined[i][2] = true; Uint32 sizeInBytes = tAttrInfo->m_attrSize * tAttrInfo->m_arraySize; + { + /************************************************************************* + * Check if the pointer of the value passed is aligned on a 4 byte + * boundary. If so only assign the pointer to the internal variable + * aValue. If it is not aligned then we start by copying the value to + * tempData and use this as aValue instead. + *************************************************************************/ + const int attributeSize = sizeInBytes; + const int slack = sizeInBytes & 3; + if ((((UintPtr)aValue & 3) != 0) || (slack != 0)){ + memcpy(&tempData[0], aValue, attributeSize); + aValue = (char*)&tempData[0]; + if(slack != 0) { + char * tmp = (char*)&tempData[0]; + memset(&tmp[attributeSize], 0, (4 - slack)); + }//if + }//if + } const char* aValueToWrite = aValue; CHARSET_INFO* cs = tAttrInfo->m_cs; @@ -294,25 +312,8 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, m_theIndexLen = m_theIndexLen + tAttrLenInWords; }//if #endif - - /************************************************************************* - * Check if the pointer of the value passed is aligned on a 4 byte - * boundary. If so only assign the pointer to the internal variable - * aValue. If it is not aligned then we start by copying the value to - * tempData and use this as aValue instead. - *************************************************************************/ - const int attributeSize = sizeInBytes; - const int slack = sizeInBytes & 3; int tDistrKey = tAttrInfo->m_distributionKey; int tDistrGroup = tAttrInfo->m_distributionGroup; - if ((((UintPtr)aValue & 3) != 0) || (slack != 0)){ - memcpy(&tempData[0], aValue, attributeSize); - aValue = (char*)&tempData[0]; - if(slack != 0) { - char * tmp = (char*)&tempData[0]; - memset(&tmp[attributeSize], 0, (4 - slack)); - }//if - }//if OperationType tOpType = theOperationType; if ((tDistrKey != 1) && (tDistrGroup != 1)) { ; diff --git a/ndb/src/ndbapi/NdbOperationSearch.cpp b/ndb/src/ndbapi/NdbOperationSearch.cpp index 0d3130fffd0..69b4e803acd 100644 --- a/ndb/src/ndbapi/NdbOperationSearch.cpp +++ b/ndb/src/ndbapi/NdbOperationSearch.cpp @@ -118,6 +118,25 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo, theTupleKeyDefined[i][2] = true; Uint32 sizeInBytes = tAttrInfo->m_attrSize * tAttrInfo->m_arraySize; + { + /*************************************************************************** + * Check if the pointer of the value passed is aligned on a 4 byte + * boundary. If so only assign the pointer to the internal variable + * aValue. If it is not aligned then we start by copying the value to + * tempData and use this as aValue instead. + *****************************************************************************/ + const int attributeSize = sizeInBytes; + const int slack = sizeInBytes & 3; + + if ((((UintPtr)aValue & 3) != 0) || (slack != 0)){ + memcpy(&tempData[0], aValue, attributeSize); + aValue = (char*)&tempData[0]; + if(slack != 0) { + char * tmp = (char*)&tempData[0]; + memset(&tmp[attributeSize], 0, (4 - slack)); + }//if + }//if + } const char* aValueToWrite = aValue; CHARSET_INFO* cs = tAttrInfo->m_cs; @@ -170,24 +189,9 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo, theTupKeyLen = theTupKeyLen + tAttrLenInWords; }//if #endif - /*************************************************************************** - * Check if the pointer of the value passed is aligned on a 4 byte - * boundary. If so only assign the pointer to the internal variable - * aValue. If it is not aligned then we start by copying the value to - * tempData and use this as aValue instead. - *****************************************************************************/ - const int attributeSize = sizeInBytes; - const int slack = sizeInBytes & 3; + int tDistrKey = tAttrInfo->m_distributionKey; int tDistrGroup = tAttrInfo->m_distributionGroup; - if ((((UintPtr)aValue & 3) != 0) || (slack != 0)){ - memcpy(&tempData[0], aValue, attributeSize); - aValue = (char*)&tempData[0]; - if(slack != 0) { - char * tmp = (char*)&tempData[0]; - memset(&tmp[attributeSize], 0, (4 - slack)); - }//if - }//if OperationType tOpType = theOperationType; if ((tDistrKey != 1) && (tDistrGroup != 1)) { ; |