diff --git a/CMakeLists.txt b/CMakeLists.txt index 5511bfd6c..196e13309 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -250,7 +250,7 @@ IF (MASK_LONGDOUBLE) ENDIF() if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-deprecated-enum-enum-conversion -Wno-register -Wno-typedef-redefinition") + MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-deprecated-enum-enum-conversion -Wno-register -Wno-typedef-redefinition -Wno-cast-function-type-strict") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-register") endif() diff --git a/build/bootstrap_mcs.sh b/build/bootstrap_mcs.sh index 3e67da34e..ed6239c33 100755 --- a/build/bootstrap_mcs.sh +++ b/build/bootstrap_mcs.sh @@ -262,6 +262,7 @@ construct_cmake_flags() { -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=$MCS_BUILD_TYPE -DPLUGIN_GSSAPI=NO + -DMYSQL_MAINTAINER_MODE=NO ) if [[ $SKIP_UNIT_TESTS = true ]]; then diff --git a/datatypes/mcs_datatype.cpp b/datatypes/mcs_datatype.cpp index f1a7414de..4941be977 100644 --- a/datatypes/mcs_datatype.cpp +++ b/datatypes/mcs_datatype.cpp @@ -616,27 +616,29 @@ int TypeHandlerBinary::storeValueToField(rowgroup::Row &row, int pos, /****************************************************************************/ -string TypeHandlerDate::format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const +string TypeHandlerDate::format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& /*attr*/) const { return DataConvert::dateToString(v.toSInt64()); } -string TypeHandlerDatetime::format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const +string TypeHandlerDatetime::format(const SimpleValue& v, + const SystemCatalog::TypeAttributesStd& /*attr*/) const { return DataConvert::datetimeToString(v.toSInt64()); } -string TypeHandlerTimestamp::format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const +string TypeHandlerTimestamp::format(const SimpleValue& v, + const SystemCatalog::TypeAttributesStd& /*attr*/) const { return DataConvert::timestampToString(v.toSInt64(), v.timeZone()); } -string TypeHandlerTime::format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const +string TypeHandlerTime::format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& /*attr*/) const { return DataConvert::timeToString(v.toSInt64()); } -string TypeHandlerChar::format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const +string TypeHandlerChar::format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& /*attr*/) const { // swap again to retain the string byte order ostringstream oss; @@ -645,7 +647,8 @@ string TypeHandlerChar::format(const SimpleValue& v, const SystemCatalog::TypeAt return oss.str(); } -string TypeHandlerVarchar::format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const +string TypeHandlerVarchar::format(const SimpleValue& v, + const SystemCatalog::TypeAttributesStd& /*attr*/) const { // swap again to retain the string byte order ostringstream oss; @@ -654,21 +657,24 @@ string TypeHandlerVarchar::format(const SimpleValue& v, const SystemCatalog::Typ return oss.str(); } -string TypeHandlerInt::formatSInt64(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const +string TypeHandlerInt::formatSInt64(const SimpleValue& v, + const SystemCatalog::TypeAttributesStd& /*attr*/) const { ostringstream oss; oss << v.toSInt64(); return oss.str(); } -string TypeHandlerInt::formatUInt64(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const +string TypeHandlerInt::formatUInt64(const SimpleValue& v, + const SystemCatalog::TypeAttributesStd& /*attr*/) const { ostringstream oss; oss << static_cast(v.toSInt64()); return oss.str(); } -string TypeHandlerVarbinary::format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const +string TypeHandlerVarbinary::format(const SimpleValue& /*v*/, + const SystemCatalog::TypeAttributesStd& /*attr*/) const { return "N/A"; } @@ -839,7 +845,7 @@ execplan::SimpleColumn* TypeHandlerSInt64::newSimpleColumn(const DatabaseQualifi } execplan::SimpleColumn* TypeHandlerUInt8::newSimpleColumn(const DatabaseQualifiedColumnName& name, - SystemCatalog::TypeHolderStd& ct, + SystemCatalog::TypeHolderStd& /*ct*/, const SimpleColumnParam& prm) const { // QQ: why scale is not checked (unlike SInt1)? @@ -848,7 +854,7 @@ execplan::SimpleColumn* TypeHandlerUInt8::newSimpleColumn(const DatabaseQualifie } execplan::SimpleColumn* TypeHandlerUInt16::newSimpleColumn(const DatabaseQualifiedColumnName& name, - SystemCatalog::TypeHolderStd& ct, + SystemCatalog::TypeHolderStd& /*ct*/, const SimpleColumnParam& prm) const { return new execplan::SimpleColumn_UINT<2>(name.db(), name.table(), name.column(), prm.columnStore(), @@ -856,7 +862,7 @@ execplan::SimpleColumn* TypeHandlerUInt16::newSimpleColumn(const DatabaseQualifi } execplan::SimpleColumn* TypeHandlerUInt24::newSimpleColumn(const DatabaseQualifiedColumnName& name, - SystemCatalog::TypeHolderStd& ct, + SystemCatalog::TypeHolderStd& /*ct*/, const SimpleColumnParam& prm) const { return new execplan::SimpleColumn_UINT<4>(name.db(), name.table(), name.column(), prm.columnStore(), @@ -864,7 +870,7 @@ execplan::SimpleColumn* TypeHandlerUInt24::newSimpleColumn(const DatabaseQualifi } execplan::SimpleColumn* TypeHandlerUInt32::newSimpleColumn(const DatabaseQualifiedColumnName& name, - SystemCatalog::TypeHolderStd& ct, + SystemCatalog::TypeHolderStd& /*ct*/, const SimpleColumnParam& prm) const { return new execplan::SimpleColumn_UINT<4>(name.db(), name.table(), name.column(), prm.columnStore(), @@ -872,7 +878,7 @@ execplan::SimpleColumn* TypeHandlerUInt32::newSimpleColumn(const DatabaseQualifi } execplan::SimpleColumn* TypeHandlerUInt64::newSimpleColumn(const DatabaseQualifiedColumnName& name, - SystemCatalog::TypeHolderStd& ct, + SystemCatalog::TypeHolderStd& /*ct*/, const SimpleColumnParam& prm) const { return new execplan::SimpleColumn_UINT<8>(name.db(), name.table(), name.column(), prm.columnStore(), @@ -880,7 +886,7 @@ execplan::SimpleColumn* TypeHandlerUInt64::newSimpleColumn(const DatabaseQualifi } execplan::SimpleColumn* TypeHandlerReal::newSimpleColumn(const DatabaseQualifiedColumnName& name, - SystemCatalog::TypeHolderStd& ct, + SystemCatalog::TypeHolderStd& /*ct*/, const SimpleColumnParam& prm) const { // QQ @@ -889,7 +895,7 @@ execplan::SimpleColumn* TypeHandlerReal::newSimpleColumn(const DatabaseQualified } execplan::SimpleColumn* TypeHandlerXDecimal::newSimpleColumn(const DatabaseQualifiedColumnName& name, - SystemCatalog::TypeHolderStd& ct, + SystemCatalog::TypeHolderStd& /*ct*/, const SimpleColumnParam& prm) const { // QQ @@ -898,7 +904,7 @@ execplan::SimpleColumn* TypeHandlerXDecimal::newSimpleColumn(const DatabaseQuali } execplan::SimpleColumn* TypeHandlerStr::newSimpleColumn(const DatabaseQualifiedColumnName& name, - SystemCatalog::TypeHolderStd& ct, + SystemCatalog::TypeHolderStd& /*ct*/, const SimpleColumnParam& prm) const { // QQ @@ -907,7 +913,7 @@ execplan::SimpleColumn* TypeHandlerStr::newSimpleColumn(const DatabaseQualifiedC } execplan::SimpleColumn* TypeHandlerTemporal::newSimpleColumn(const DatabaseQualifiedColumnName& name, - SystemCatalog::TypeHolderStd& ct, + SystemCatalog::TypeHolderStd& /*ct*/, const SimpleColumnParam& prm) const { // QQ @@ -1038,42 +1044,42 @@ SimpleValue toSimpleValueUInt(const SessionParam& sp, const TypeHandler* h, SimpleValue TypeHandlerUInt8::toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, - round_style_t& rf) const + round_style_t& /*rf*/) const { return toSimpleValueUInt(sp, this, attr, str); } SimpleValue TypeHandlerUInt16::toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, - round_style_t& rf) const + round_style_t& /*rf*/) const { return toSimpleValueUInt(sp, this, attr, str); } SimpleValue TypeHandlerUInt24::toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, - round_style_t& rf) const + round_style_t& /*rf*/) const { return toSimpleValueUInt(sp, this, attr, str); } SimpleValue TypeHandlerUInt32::toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, - round_style_t& rf) const + round_style_t& /*rf*/) const { return toSimpleValueUInt(sp, this, attr, str); } SimpleValue TypeHandlerUInt64::toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, - round_style_t& rf) const + round_style_t& /*rf*/) const { return toSimpleValueUInt(sp, this, attr, str); } SimpleValue TypeHandlerDate::toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, - round_style_t& rf) const + round_style_t& /*rf*/) const { idbassert(attr.colWidth <= SystemCatalog::EIGHT_BYTE); SimpleConverter anyVal(sp, this, attr, str); @@ -1082,7 +1088,7 @@ SimpleValue TypeHandlerDate::toSimpleValue(const SessionParam& sp, SimpleValue TypeHandlerDatetime::toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, - round_style_t& rf) const + round_style_t& /*rf*/) const { idbassert(attr.colWidth <= SystemCatalog::EIGHT_BYTE); SimpleConverter anyVal(sp, this, attr, str); @@ -1091,7 +1097,7 @@ SimpleValue TypeHandlerDatetime::toSimpleValue(const SessionParam& sp, SimpleValue TypeHandlerTimestamp::toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, - round_style_t& rf) const + round_style_t& /*rf*/) const { idbassert(attr.colWidth <= SystemCatalog::EIGHT_BYTE); SimpleConverter anyVal(sp, this, attr, str); @@ -1100,7 +1106,7 @@ SimpleValue TypeHandlerTimestamp::toSimpleValue(const SessionParam& sp, SimpleValue TypeHandlerTime::toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, - round_style_t& rf) const + round_style_t& /*rf*/) const { idbassert(attr.colWidth <= SystemCatalog::EIGHT_BYTE); SimpleConverter anyVal(sp, this, attr, str); @@ -1157,7 +1163,7 @@ MinMaxPartitionInfo::MinMaxPartitionInfo(const BRM::EMEntry& entry) { } -MinMaxPartitionInfo TypeHandler::getExtentPartitionInfo(const SystemCatalog::TypeAttributesStd& attr, +MinMaxPartitionInfo TypeHandler::getExtentPartitionInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, BRM::DBRM& em, const BRM::EMEntry& entry, int* state) const { @@ -1168,7 +1174,8 @@ MinMaxPartitionInfo TypeHandler::getExtentPartitionInfo(const SystemCatalog::Typ } MinMaxPartitionInfo TypeHandlerXDecimal::getExtentPartitionInfo64( - const SystemCatalog::TypeAttributesStd& attr, BRM::DBRM& em, const BRM::EMEntry& entry, int* state) const + const SystemCatalog::TypeAttributesStd& /*attr*/, BRM::DBRM& em, const BRM::EMEntry& entry, + int* state) const { int32_t seqNum; MinMaxPartitionInfo partInfo(entry); @@ -1177,7 +1184,8 @@ MinMaxPartitionInfo TypeHandlerXDecimal::getExtentPartitionInfo64( } MinMaxPartitionInfo TypeHandlerXDecimal::getExtentPartitionInfo128( - const SystemCatalog::TypeAttributesStd& attr, BRM::DBRM& em, const BRM::EMEntry& entry, int* state) const + const SystemCatalog::TypeAttributesStd& /*attr*/, BRM::DBRM& em, const BRM::EMEntry& entry, + int* state) const { int32_t seqNum; MinMaxPartitionInfo partInfo(entry); @@ -1273,70 +1281,70 @@ string TypeHandlerXDecimal::PrintPartitionValue128(const SystemCatalog::TypeAttr /****************************************************************************/ -boost::any TypeHandlerSInt8::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerSInt8::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { char tinyintvalue = joblist::TINYINTNULL; boost::any value = tinyintvalue; return value; } -boost::any TypeHandlerUInt8::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerUInt8::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { uint8_t utinyintvalue = joblist::UTINYINTNULL; boost::any value = utinyintvalue; return value; } -boost::any TypeHandlerSInt16::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerSInt16::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { short smallintvalue = joblist::SMALLINTNULL; boost::any value = smallintvalue; return value; } -boost::any TypeHandlerUInt16::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerUInt16::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { uint16_t usmallintvalue = joblist::USMALLINTNULL; boost::any value = usmallintvalue; return value; } -boost::any TypeHandlerSInt24::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerSInt24::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { int intvalue = joblist::INTNULL; boost::any value = intvalue; return value; } -boost::any TypeHandlerSInt32::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerSInt32::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { int intvalue = joblist::INTNULL; boost::any value = intvalue; return value; } -boost::any TypeHandlerUInt24::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerUInt24::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { uint32_t uintvalue = joblist::UINTNULL; boost::any value = uintvalue; return value; } -boost::any TypeHandlerUInt32::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerUInt32::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { uint32_t uintvalue = joblist::UINTNULL; boost::any value = uintvalue; return value; } -boost::any TypeHandlerSInt64::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerSInt64::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { long long bigint = joblist::BIGINTNULL; boost::any value = bigint; return value; } -boost::any TypeHandlerUInt64::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerUInt64::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { uint64_t ubigint = joblist::UBIGINTNULL; boost::any value = ubigint; @@ -1381,7 +1389,7 @@ boost::any TypeHandlerXDecimal::getNullValueForType(const SystemCatalog::TypeAtt return value; } -boost::any TypeHandlerSFloat::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerSFloat::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { uint32_t jlfloatnull = joblist::FLOATNULL; float* fp = reinterpret_cast(&jlfloatnull); @@ -1389,7 +1397,7 @@ boost::any TypeHandlerSFloat::getNullValueForType(const SystemCatalog::TypeAttri return value; } -boost::any TypeHandlerUFloat::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerUFloat::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { uint32_t jlfloatnull = joblist::FLOATNULL; float* fp = reinterpret_cast(&jlfloatnull); @@ -1397,7 +1405,7 @@ boost::any TypeHandlerUFloat::getNullValueForType(const SystemCatalog::TypeAttri return value; } -boost::any TypeHandlerSDouble::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerSDouble::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { uint64_t jldoublenull = joblist::DOUBLENULL; double* dp = reinterpret_cast(&jldoublenull); @@ -1405,7 +1413,7 @@ boost::any TypeHandlerSDouble::getNullValueForType(const SystemCatalog::TypeAttr return value; } -boost::any TypeHandlerUDouble::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerUDouble::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { uint64_t jldoublenull = joblist::DOUBLENULL; double* dp = reinterpret_cast(&jldoublenull); @@ -1413,28 +1421,28 @@ boost::any TypeHandlerUDouble::getNullValueForType(const SystemCatalog::TypeAttr return value; } -boost::any TypeHandlerDate::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerDate::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { uint32_t d = joblist::DATENULL; boost::any value = d; return value; } -boost::any TypeHandlerDatetime::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerDatetime::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { uint64_t d = joblist::DATETIMENULL; boost::any value = d; return value; } -boost::any TypeHandlerTime::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerTime::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { int64_t d = joblist::TIMENULL; boost::any value = d; return value; } -boost::any TypeHandlerTimestamp::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerTimestamp::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { uint64_t d = joblist::TIMESTAMPNULL; boost::any value = d; @@ -1518,14 +1526,14 @@ boost::any TypeHandlerStr::getNullValueForTypeVarcharText(const SystemCatalog::T return value; } -boost::any TypeHandlerBlob::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerBlob::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { WriteEngine::Token nullToken; boost::any value = nullToken; return value; } -boost::any TypeHandlerVarbinary::getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const +boost::any TypeHandlerVarbinary::getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { WriteEngine::Token nullToken; boost::any value = nullToken; @@ -1637,56 +1645,56 @@ boost::any TypeHandlerUInt64::convertFromString(const SystemCatalog::TypeAttribu return value; } -boost::any TypeHandlerSFloat::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, - bool& pushWarning) const +boost::any TypeHandlerSFloat::convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/, + const ConvertFromStringParam& /*prm*/, + const std::string& data, bool& pushWarning) const { return dataconvert::DataConvert::StringToFloat(SystemCatalog::FLOAT, data, pushWarning); } -boost::any TypeHandlerUFloat::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, - bool& pushWarning) const +boost::any TypeHandlerUFloat::convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/, + const ConvertFromStringParam& /*prm*/, + const std::string& data, bool& pushWarning) const { return dataconvert::DataConvert::StringToFloat(SystemCatalog::UFLOAT, data, pushWarning); } -boost::any TypeHandlerSDouble::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, - bool& pushWarning) const +boost::any TypeHandlerSDouble::convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/, + const ConvertFromStringParam& /*prm*/, + const std::string& data, bool& pushWarning) const { return dataconvert::DataConvert::StringToDouble(SystemCatalog::DOUBLE, data, pushWarning); } -boost::any TypeHandlerUDouble::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, - bool& pushWarning) const +boost::any TypeHandlerUDouble::convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/, + const ConvertFromStringParam& /*prm*/, + const std::string& data, bool& pushWarning) const { return dataconvert::DataConvert::StringToDouble(SystemCatalog::UDOUBLE, data, pushWarning); } -boost::any TypeHandlerDate::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, +boost::any TypeHandlerDate::convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/, + const ConvertFromStringParam& /*prm*/, const std::string& data, bool& pushWarning) const { return dataconvert::DataConvert::StringToDate(data, pushWarning); } -boost::any TypeHandlerDatetime::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, - bool& pushWarning) const +boost::any TypeHandlerDatetime::convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/, + const ConvertFromStringParam& /*prm*/, + const std::string& data, bool& pushWarning) const { return dataconvert::DataConvert::StringToDatetime(data, pushWarning); } boost::any TypeHandlerTime::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, + const ConvertFromStringParam& /*prm*/, const std::string& data, bool& pushWarning) const { return dataconvert::DataConvert::StringToTime(colType, data, pushWarning); } -boost::any TypeHandlerTimestamp::convertFromString(const SystemCatalog::TypeAttributesStd& colType, +boost::any TypeHandlerTimestamp::convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/, const ConvertFromStringParam& prm, const std::string& data, bool& pushWarning) const { @@ -1694,45 +1702,45 @@ boost::any TypeHandlerTimestamp::convertFromString(const SystemCatalog::TypeAttr } boost::any TypeHandlerChar::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, + const ConvertFromStringParam& /*prm*/, const std::string& data, bool& pushWarning) const { return dataconvert::DataConvert::StringToString(colType, data, pushWarning); } boost::any TypeHandlerVarchar::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, - bool& pushWarning) const + const ConvertFromStringParam& /*prm*/, + const std::string& data, bool& pushWarning) const { return dataconvert::DataConvert::StringToString(colType, data, pushWarning); } boost::any TypeHandlerText::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, + const ConvertFromStringParam& /*prm*/, const std::string& data, bool& pushWarning) const { return dataconvert::DataConvert::StringToString(colType, data, pushWarning); } -boost::any TypeHandlerClob::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, - bool& pushWarning) const +boost::any TypeHandlerClob::convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/, + const ConvertFromStringParam& /*prm*/, const std::string& data, + bool& /*pushWarning*/) const { boost::any value = data; return value; } -boost::any TypeHandlerBlob::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, - bool& pushWarning) const +boost::any TypeHandlerBlob::convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/, + const ConvertFromStringParam& /*prm*/, const std::string& data, + bool& /*pushWarning*/) const { boost::any value = data; return value; } -boost::any TypeHandlerVarbinary::convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& data, - bool& pushWarning) const +boost::any TypeHandlerVarbinary::convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/, + const ConvertFromStringParam& /*prm*/, + const std::string& data, bool& /*pushWarning*/) const { boost::any value = data; return value; @@ -1773,7 +1781,7 @@ const uint8_t* getEmptyTypeHandlerSInt8() return &TINYINTEMPTYROW; } -const uint8_t* TypeHandlerSInt8::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& attr) const +const uint8_t* TypeHandlerSInt8::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { return getEmptyTypeHandlerSInt8(); } @@ -1784,7 +1792,7 @@ const uint8_t* getEmptyTypeHandlerSInt16() return reinterpret_cast(&SMALLINTEMPTYROW); } -const uint8_t* TypeHandlerSInt16::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& attr) const +const uint8_t* TypeHandlerSInt16::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { return getEmptyTypeHandlerSInt16(); } @@ -1795,12 +1803,12 @@ const uint8_t* getEmptyTypeHandlerSInt32() return reinterpret_cast(&INTEMPTYROW); } -const uint8_t* TypeHandlerSInt24::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& attr) const +const uint8_t* TypeHandlerSInt24::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { return getEmptyTypeHandlerSInt32(); } -const uint8_t* TypeHandlerSInt32::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& attr) const +const uint8_t* TypeHandlerSInt32::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { return getEmptyTypeHandlerSInt32(); } @@ -1811,18 +1819,18 @@ const uint8_t* getEmptyTypeHandlerSInt64() return reinterpret_cast(&BIGINTEMPTYROW); } -const uint8_t* TypeHandlerSInt64::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& attr) const +const uint8_t* TypeHandlerSInt64::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { return getEmptyTypeHandlerSInt64(); } -const uint8_t* TypeHandlerUInt8::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& attr) const +const uint8_t* TypeHandlerUInt8::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { const static uint8_t UTINYINTEMPTYROW = joblist::UTINYINTEMPTYROW; return reinterpret_cast(&UTINYINTEMPTYROW); } -const uint8_t* TypeHandlerUInt16::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& attr) const +const uint8_t* TypeHandlerUInt16::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { const static uint16_t USMALLINTEMPTYROW = joblist::USMALLINTEMPTYROW; return reinterpret_cast(&USMALLINTEMPTYROW); @@ -1834,23 +1842,23 @@ const uint8_t* getEmptyTypeHandlerUInt32() return reinterpret_cast(&UINTEMPTYROW); } -const uint8_t* TypeHandlerUInt24::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& attr) const +const uint8_t* TypeHandlerUInt24::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { return getEmptyTypeHandlerUInt32(); } -const uint8_t* TypeHandlerUInt32::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& attr) const +const uint8_t* TypeHandlerUInt32::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { return getEmptyTypeHandlerUInt32(); } -const uint8_t* TypeHandlerUInt64::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& attr) const +const uint8_t* TypeHandlerUInt64::getEmptyValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const { const static uint64_t UBIGINTEMPTYROW = joblist::UBIGINTEMPTYROW; return reinterpret_cast(&UBIGINTEMPTYROW); } -const uint8_t* getEmptyTypeHandlerFloat(const SystemCatalog::TypeAttributesStd& attr) +const uint8_t* getEmptyTypeHandlerFloat(const SystemCatalog::TypeAttributesStd& /*attr*/) { const static uint32_t FLOATEMPTYROW = joblist::FLOATEMPTYROW; return reinterpret_cast(&FLOATEMPTYROW); @@ -1866,7 +1874,7 @@ const uint8_t* TypeHandlerSFloat::getEmptyValueForType(const SystemCatalog::Type return getEmptyTypeHandlerFloat(attr); } -const uint8_t* getEmptyTypeHandlerDouble(const SystemCatalog::TypeAttributesStd& attr) +const uint8_t* getEmptyTypeHandlerDouble(const SystemCatalog::TypeAttributesStd& /*attr*/) { const static uint64_t DOUBLEEMPTYROW = joblist::DOUBLEEMPTYROW; return reinterpret_cast(&DOUBLEEMPTYROW); @@ -1936,13 +1944,13 @@ const uint8_t* TypeHandlerUDecimal64::getEmptyValueForType(const SystemCatalog:: } const uint8_t* TypeHandlerSDecimal128::getEmptyValueForType( - const SystemCatalog::TypeAttributesStd& attr) const + const SystemCatalog::TypeAttributesStd& /*attr*/) const { return reinterpret_cast(&datatypes::Decimal128Empty); } const uint8_t* TypeHandlerUDecimal128::getEmptyValueForType( - const SystemCatalog::TypeAttributesStd& attr) const + const SystemCatalog::TypeAttributesStd& /*attr*/) const { return reinterpret_cast(&datatypes::Decimal128Empty); } @@ -1950,4 +1958,3 @@ const uint8_t* TypeHandlerUDecimal128::getEmptyValueForType( /****************************************************************************/ } // end of namespace datatypes - diff --git a/datatypes/mcs_datatype.h b/datatypes/mcs_datatype.h index d6b050146..2f01010f3 100644 --- a/datatypes/mcs_datatype.h +++ b/datatypes/mcs_datatype.h @@ -1020,16 +1020,16 @@ class TypeHandler virtual ~TypeHandler() = default; virtual const string& name() const = 0; - virtual const string print(const SystemCatalog::TypeAttributesStd& attr) const + virtual const string print(const SystemCatalog::TypeAttributesStd& /*attr*/) const { return name(); } virtual code_t code() const = 0; - virtual bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const + virtual bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const { return false; } - virtual uint8_t PartitionValueCharLength(const SystemCatalog::TypeAttributesStd& attr) const + virtual uint8_t PartitionValueCharLength(const SystemCatalog::TypeAttributesStd& /*attr*/) const { return 30; } @@ -1054,7 +1054,7 @@ class TypeHandler } virtual SimpleValue toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, round_style_t& rf) const = 0; - virtual MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& attr, const MinMaxInfo& a, + virtual MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxInfo& a, const MinMaxInfo& b) const { return MinMaxInfo::widenSInt64(a, b); @@ -1069,7 +1069,7 @@ class TypeHandler { return PrintPartitionValueSInt64(attr, partInfo, startVal, rfMin, endVal, rfMax); } - virtual bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& attr, + virtual bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxPartitionInfo& part, const SimpleValue& startVal, round_style_t rfMin, const SimpleValue& endVal, round_style_t rfMax) const { @@ -1091,50 +1091,51 @@ class TypeHandlerBit : public TypeHandler { return SystemCatalog::BIT; } - size_t ColWriteBatch(WriteBatchField* field, const unsigned char* buf, bool nullVal, - ColBatchWriter& writer) const override + size_t ColWriteBatch(WriteBatchField* /*field*/, const unsigned char* /*buf*/, bool /*nullVal*/, + ColBatchWriter& /*writer*/) const override { idbassert(0); // QQ return 0; } - int storeValueToField(rowgroup::Row& row, int pos, StoreField* f) const override + int storeValueToField(rowgroup::Row& /*row*/, int /*pos*/, StoreField* /*f*/) const override { idbassert(0); // QQ return 1; } - std::string format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const override + std::string format(const SimpleValue& /*v*/, const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return "0"; // QQ } - std::string formatPartitionInfo(const SystemCatalog::TypeAttributesStd& attr, - const MinMaxInfo& i) const override + std::string formatPartitionInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, + const MinMaxInfo& /*i*/) const override { idbassert(0); return "Error"; } - execplan::SimpleColumn* newSimpleColumn(const DatabaseQualifiedColumnName& name, - SystemCatalog::TypeHolderStd& ct, - const SimpleColumnParam& prm) const override + execplan::SimpleColumn* newSimpleColumn(const DatabaseQualifiedColumnName& /*name*/, + SystemCatalog::TypeHolderStd& /*ct*/, + const SimpleColumnParam& /*prm*/) const override { idbassert(0); return nullptr; } - SimpleValue toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, - const char* str, round_style_t& rf) const override + SimpleValue toSimpleValue(const SessionParam& /*sp*/, const SystemCatalog::TypeAttributesStd& /*attr*/, + const char* /*str*/, round_style_t& /*rf*/) const override { idbassert(0); return {}; } - boost::any getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const override + boost::any getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { // TODO: How to communicate with write engine? return {}; } - boost::any convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& str, - bool& pushWarning) const override; - const uint8_t* getEmptyValueForType(const SystemCatalog::TypeAttributesStd& attr) const override + boost::any convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/, + const ConvertFromStringParam& /*prm*/, const std::string& /*str*/, + bool& /*pushWarning*/) const override; + +const uint8_t* getEmptyValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { idbassert(0); return nullptr; @@ -1158,7 +1159,7 @@ class TypeHandlerSInt8 : public TypeHandlerInt { return SystemCatalog::TINYINT; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -1205,7 +1206,7 @@ class TypeHandlerSInt16 : public TypeHandlerInt { return SystemCatalog::SMALLINT; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -1251,7 +1252,7 @@ class TypeHandlerSInt24 : public TypeHandlerInt { return SystemCatalog::MEDINT; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -1300,7 +1301,7 @@ class TypeHandlerSInt32 : public TypeHandlerInt { return SystemCatalog::INT; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -1349,7 +1350,7 @@ class TypeHandlerSInt64 : public TypeHandlerInt { return SystemCatalog::BIGINT; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -1395,7 +1396,7 @@ class TypeHandlerUInt8 : public TypeHandlerInt { return SystemCatalog::UTINYINT; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -1428,7 +1429,7 @@ class TypeHandlerUInt8 : public TypeHandlerInt } SimpleValue toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, round_style_t& rf) const override; - MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& attr, const MinMaxInfo& a, + MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxInfo& a, const MinMaxInfo& b) const override { return MinMaxInfo::widenUInt64(a, b); @@ -1440,7 +1441,7 @@ class TypeHandlerUInt8 : public TypeHandlerInt { return PrintPartitionValueUInt64(attr, partInfo, startVal, rfMin, endVal, rfMax); } - bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& attr, const MinMaxPartitionInfo& part, + bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxPartitionInfo& part, const SimpleValue& startVal, round_style_t rfMin, const SimpleValue& endVal, round_style_t rfMax) const override { @@ -1460,7 +1461,7 @@ class TypeHandlerUInt16 : public TypeHandlerInt { return SystemCatalog::USMALLINT; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -1492,7 +1493,7 @@ class TypeHandlerUInt16 : public TypeHandlerInt } SimpleValue toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, round_style_t& rf) const override; - MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& attr, const MinMaxInfo& a, + MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxInfo& a, const MinMaxInfo& b) const override { return MinMaxInfo::widenUInt64(a, b); @@ -1504,7 +1505,7 @@ class TypeHandlerUInt16 : public TypeHandlerInt { return PrintPartitionValueUInt64(attr, partInfo, startVal, rfMin, endVal, rfMax); } - bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& attr, const MinMaxPartitionInfo& part, + bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxPartitionInfo& part, const SimpleValue& startVal, round_style_t rfMin, const SimpleValue& endVal, round_style_t rfMax) const override { @@ -1524,7 +1525,7 @@ class TypeHandlerUInt24 : public TypeHandlerInt { return SystemCatalog::UMEDINT; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -1559,7 +1560,7 @@ class TypeHandlerUInt24 : public TypeHandlerInt } SimpleValue toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, round_style_t& rf) const override; - MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& attr, const MinMaxInfo& a, + MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxInfo& a, const MinMaxInfo& b) const override { return MinMaxInfo::widenUInt64(a, b); @@ -1571,7 +1572,7 @@ class TypeHandlerUInt24 : public TypeHandlerInt { return PrintPartitionValueUInt64(attr, partInfo, startVal, rfMin, endVal, rfMax); } - bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& attr, const MinMaxPartitionInfo& part, + bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxPartitionInfo& part, const SimpleValue& startVal, round_style_t rfMin, const SimpleValue& endVal, round_style_t rfMax) const override { @@ -1591,7 +1592,7 @@ class TypeHandlerUInt32 : public TypeHandlerInt { return SystemCatalog::UINT; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -1626,7 +1627,7 @@ class TypeHandlerUInt32 : public TypeHandlerInt } SimpleValue toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, round_style_t& rf) const override; - MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& attr, const MinMaxInfo& a, + MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxInfo& a, const MinMaxInfo& b) const override { return MinMaxInfo::widenUInt64(a, b); @@ -1638,7 +1639,7 @@ class TypeHandlerUInt32 : public TypeHandlerInt { return PrintPartitionValueUInt64(attr, partInfo, startVal, rfMin, endVal, rfMax); } - bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& attr, const MinMaxPartitionInfo& part, + bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxPartitionInfo& part, const SimpleValue& startVal, round_style_t rfMin, const SimpleValue& endVal, round_style_t rfMax) const override { @@ -1658,7 +1659,7 @@ class TypeHandlerUInt64 : public TypeHandlerInt { return SystemCatalog::BIGINT; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -1690,7 +1691,7 @@ class TypeHandlerUInt64 : public TypeHandlerInt } SimpleValue toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, const char* str, round_style_t& rf) const override; - MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& attr, const MinMaxInfo& a, + MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxInfo& a, const MinMaxInfo& b) const override { return MinMaxInfo::widenUInt64(a, b); @@ -1702,7 +1703,7 @@ class TypeHandlerUInt64 : public TypeHandlerInt { return PrintPartitionValueUInt64(attr, partInfo, startVal, rfMin, endVal, rfMax); } - bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& attr, const MinMaxPartitionInfo& part, + bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxPartitionInfo& part, const SimpleValue& startVal, round_style_t rfMin, const SimpleValue& endVal, round_style_t rfMax) const override { @@ -1763,11 +1764,11 @@ class TypeHandlerSDecimal64 : public TypeHandlerXDecimal { return SystemCatalog::DECIMAL; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } - uint8_t PartitionValueCharLength(const SystemCatalog::TypeAttributesStd& attr) const override + uint8_t PartitionValueCharLength(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return 30; } @@ -1792,7 +1793,7 @@ class TypeHandlerSDecimal64 : public TypeHandlerXDecimal { return SimpleValueSInt64(std::numeric_limits::max()); } - MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& attr, const MinMaxInfo& a, + MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxInfo& a, const MinMaxInfo& b) const override { return MinMaxInfo::widenSInt64(a, b); @@ -1809,7 +1810,7 @@ class TypeHandlerSDecimal64 : public TypeHandlerXDecimal { return PrintPartitionValueSInt64(attr, partInfo, startVal, rfMin, endVal, rfMax); } - bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& attr, const MinMaxPartitionInfo& part, + bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxPartitionInfo& part, const SimpleValue& startVal, round_style_t rfMin, const SimpleValue& endVal, round_style_t rfMax) const override { @@ -1829,11 +1830,11 @@ class TypeHandlerUDecimal64 : public TypeHandlerXDecimal { return SystemCatalog::UDECIMAL; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } - uint8_t PartitionValueCharLength(const SystemCatalog::TypeAttributesStd& attr) const override + uint8_t PartitionValueCharLength(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return 30; } @@ -1858,7 +1859,7 @@ class TypeHandlerUDecimal64 : public TypeHandlerXDecimal { return SimpleValueUInt64(std::numeric_limits::max()); } - MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& attr, const MinMaxInfo& a, + MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxInfo& a, const MinMaxInfo& b) const override { return MinMaxInfo::widenSInt64(a, b); @@ -1875,7 +1876,7 @@ class TypeHandlerUDecimal64 : public TypeHandlerXDecimal { return PrintPartitionValueSInt64(attr, partInfo, startVal, rfMin, endVal, rfMax); } - bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& attr, const MinMaxPartitionInfo& part, + bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxPartitionInfo& part, const SimpleValue& startVal, round_style_t rfMin, const SimpleValue& endVal, round_style_t rfMax) const override { @@ -1895,11 +1896,11 @@ class TypeHandlerSDecimal128 : public TypeHandlerXDecimal { return SystemCatalog::DECIMAL; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } - uint8_t PartitionValueCharLength(const SystemCatalog::TypeAttributesStd& attr) const override + uint8_t PartitionValueCharLength(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return Decimal::MAXLENGTH16BYTES; } @@ -1924,7 +1925,7 @@ class TypeHandlerSDecimal128 : public TypeHandlerXDecimal { return {std::numeric_limits::max(), datatypes::maxInt128, 0}; } - MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& attr, const MinMaxInfo& a, + MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxInfo& a, const MinMaxInfo& b) const override { return MinMaxInfo::widenSInt128(a, b); @@ -1941,7 +1942,7 @@ class TypeHandlerSDecimal128 : public TypeHandlerXDecimal { return PrintPartitionValue128(attr, partInfo, startVal, rfMin, endVal, rfMax); } - bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& attr, const MinMaxPartitionInfo& part, + bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxPartitionInfo& part, const SimpleValue& startVal, round_style_t rfMin, const SimpleValue& endVal, round_style_t rfMax) const override { @@ -1961,11 +1962,11 @@ class TypeHandlerUDecimal128 : public TypeHandlerXDecimal { return SystemCatalog::UDECIMAL; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } - uint8_t PartitionValueCharLength(const SystemCatalog::TypeAttributesStd& attr) const override + uint8_t PartitionValueCharLength(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return Decimal::MAXLENGTH16BYTES; } @@ -1990,7 +1991,7 @@ class TypeHandlerUDecimal128 : public TypeHandlerXDecimal { return SimpleValueSInt128(-1); } - MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& attr, const MinMaxInfo& a, + MinMaxInfo widenMinMaxInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxInfo& a, const MinMaxInfo& b) const override { return MinMaxInfo::widenSInt128(a, b); @@ -2007,7 +2008,7 @@ class TypeHandlerUDecimal128 : public TypeHandlerXDecimal { return PrintPartitionValue128(attr, partInfo, startVal, rfMin, endVal, rfMax); } - bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& attr, const MinMaxPartitionInfo& part, + bool isSuitablePartition(const SystemCatalog::TypeAttributesStd& /*attr*/, const MinMaxPartitionInfo& part, const SimpleValue& startVal, round_style_t rfMin, const SimpleValue& endVal, round_style_t rfMax) const override { @@ -2027,12 +2028,12 @@ class TypeHandlerReal : public TypeHandler execplan::SimpleColumn* newSimpleColumn(const DatabaseQualifiedColumnName& name, SystemCatalog::TypeHolderStd& ct, const SimpleColumnParam& prm) const override; - SimpleValue toSimpleValue(const SessionParam& sp, const SystemCatalog::TypeAttributesStd& attr, - const char* str, round_style_t& rf) const override + SimpleValue toSimpleValue(const SessionParam& /*sp*/, const SystemCatalog::TypeAttributesStd& /*attr*/, + const char* /*str*/, round_style_t& /*rf*/) const override { return {}; // QQ: real types were not handled in IDB_format() } - std::string format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const override + std::string format(const SimpleValue& /*v*/, const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return "0"; // QQ } @@ -2163,25 +2164,25 @@ class TypeHandlerSLongDouble : public TypeHandlerReal return field->ColWriteBatchSLongDouble(buf, nullVal, writer); } int storeValueToField(rowgroup::Row& row, int pos, StoreField* f) const override; - std::string formatPartitionInfo(const SystemCatalog::TypeAttributesStd& attr, - const MinMaxInfo& i) const override + std::string formatPartitionInfo(const SystemCatalog::TypeAttributesStd& /*attr*/, + const MinMaxInfo& /*i*/) const override { idbassert(0); return "Error"; } - boost::any getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const override + boost::any getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { // QQ: DDLPackageProcessor::getNullValueForType() did not handle LONGDOUBLE return {}; } - boost::any convertFromString(const SystemCatalog::TypeAttributesStd& colType, - const ConvertFromStringParam& prm, const std::string& str, - bool& pushWarning) const override + boost::any convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/, + const ConvertFromStringParam& /*prm*/, const std::string& /*str*/, + bool& /*pushWarning*/) const override { throw logging::QueryDataExcept("convertColumnData: unknown column data type.", logging::dataTypeErr); return {}; } - const uint8_t* getEmptyValueForType(const SystemCatalog::TypeAttributesStd& attr) const override + const uint8_t* getEmptyValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { idbassert(0); return nullptr; @@ -2328,7 +2329,7 @@ class TypeHandlerBlob : public TypeHandlerStr { return storeValueToFieldBlobText(row, pos, f); } - std::string format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const override + std::string format(const SimpleValue& /*v*/, const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return "0"; // QQ } @@ -2354,7 +2355,7 @@ class TypeHandlerText : public TypeHandlerStr { return storeValueToFieldBlobText(row, pos, f); } - std::string format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const override + std::string format(const SimpleValue& /*v*/, const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return "0"; // QQ } @@ -2374,22 +2375,22 @@ class TypeHandlerClob : public TypeHandlerStr { return SystemCatalog::CLOB; } - size_t ColWriteBatch(WriteBatchField* field, const unsigned char* buf, bool nullVal, - ColBatchWriter& writer) const override + size_t ColWriteBatch(WriteBatchField* /*field*/, const unsigned char* /*buf*/, bool /*nullVal*/, + ColBatchWriter& /*writer*/) const override { idbassert(0); // QQ return 0; } - int storeValueToField(rowgroup::Row& row, int pos, StoreField* f) const override + int storeValueToField(rowgroup::Row& /*row*/, int /*pos*/, StoreField* /*f*/) const override { idbassert(0); // QQ return 1; } - std::string format(const SimpleValue& v, const SystemCatalog::TypeAttributesStd& attr) const override + std::string format(const SimpleValue& /*v*/, const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return "0"; // QQ } - boost::any getNullValueForType(const SystemCatalog::TypeAttributesStd& attr) const override + boost::any getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return {}; // QQ } @@ -2422,7 +2423,7 @@ class TypeHandlerDate : public TypeHandlerTemporal { return SystemCatalog::DATE; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -2448,7 +2449,7 @@ class TypeHandlerDatetime : public TypeHandlerTemporal { return SystemCatalog::DATETIME; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -2474,7 +2475,7 @@ class TypeHandlerTime : public TypeHandlerTemporal { return SystemCatalog::TIME; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } @@ -2500,7 +2501,7 @@ class TypeHandlerTimestamp : public TypeHandlerTemporal { return SystemCatalog::TIMESTAMP; } - bool CP_type(const SystemCatalog::TypeAttributesStd& attr) const override + bool CP_type(const SystemCatalog::TypeAttributesStd& /*attr*/) const override { return true; } diff --git a/datatypes/mcs_decimal.cpp b/datatypes/mcs_decimal.cpp index fe5ae5e02..5f25e369c 100644 --- a/datatypes/mcs_decimal.cpp +++ b/datatypes/mcs_decimal.cpp @@ -77,7 +77,7 @@ void addSubtractExecute(const Decimal& l, const Decimal& r, Decimal& result, Bin template void divisionExecute(const Decimal& l, const Decimal& r, Decimal& result, OpOverflowCheck opOverflowCheck, - MultiplicationOverflowCheck mulOverflowCheck) + MultiplicationOverflowCheck /*mulOverflowCheck*/) { int128_t lValue = Decimal::isWideDecimalTypeByPrecision(l.precision) ? l.s128Value : l.value; int128_t rValue = Decimal::isWideDecimalTypeByPrecision(r.precision) ? r.s128Value : r.value; @@ -109,7 +109,7 @@ void divisionExecute(const Decimal& l, const Decimal& r, Decimal& result, OpOver template void multiplicationExecute(const Decimal& l, const Decimal& r, Decimal& result, - OpOverflowCheck opOverflowCheck, MultiplicationOverflowCheck mulOverflowCheck) + OpOverflowCheck opOverflowCheck, MultiplicationOverflowCheck /*mulOverflowCheck*/) { int128_t lValue = Decimal::isWideDecimalTypeByPrecision(l.precision) ? l.s128Value : l.value; int128_t rValue = Decimal::isWideDecimalTypeByPrecision(r.precision) ? r.s128Value : r.value; diff --git a/datatypes/mcs_decimal.h b/datatypes/mcs_decimal.h index 6326bf03c..66f33c6b5 100644 --- a/datatypes/mcs_decimal.h +++ b/datatypes/mcs_decimal.h @@ -1008,7 +1008,7 @@ struct SubtractionOverflowCheck */ struct NoOverflowCheck { - void operator()(const int128_t& x, const int128_t& y) + void operator()(const int128_t& /*x*/, const int128_t& /*y*/) { } }; diff --git a/dbcon/ddlpackage/ddl.y b/dbcon/ddlpackage/ddl.y index 8e6206848..8aaa0307e 100644 --- a/dbcon/ddlpackage/ddl.y +++ b/dbcon/ddlpackage/ddl.y @@ -322,8 +322,8 @@ drop_table_statement: ; opt_if_exists: - IDB_IF EXISTS {$$ = NULL;} - | {$$ = NULL;} + IDB_IF EXISTS {$$ = true;} + | {$$ = true;} ; drop_index_statement: diff --git a/dbcon/ddlpackage/ddlpkg.h b/dbcon/ddlpackage/ddlpkg.h index 8b6149b0d..be98572f6 100644 --- a/dbcon/ddlpackage/ddlpkg.h +++ b/dbcon/ddlpackage/ddlpkg.h @@ -481,7 +481,7 @@ struct TableDef : public SchemaObject * ctor */ TableDef(QualifiedName* name, ColumnDefList columns, TableConstraintDefList constraints, - int tableWithAutoinc) + int /*tableWithAutoinc*/) : fQualifiedName(name), fColumns(columns), fConstraints(constraints) { @@ -1042,7 +1042,7 @@ struct ColumnDef : public SchemaObject /** @brief ColumnDef ctor. * ctor */ ColumnDef(const char* name, ColumnType* type, ColumnConstraintList constraints, - ColumnDefaultValue* defaultValue = nullptr, const char* comment = nullptr) + ColumnDefaultValue* defaultValue = nullptr, const char* /*comment*/ = nullptr) : SchemaObject(name), fType(type), fConstraints(constraints), fDefaultValue(defaultValue) { } diff --git a/dbcon/ddlpackageproc/altertableprocessor.cpp b/dbcon/ddlpackageproc/altertableprocessor.cpp index 107b2409b..29e27a97f 100644 --- a/dbcon/ddlpackageproc/altertableprocessor.cpp +++ b/dbcon/ddlpackageproc/altertableprocessor.cpp @@ -1252,7 +1252,7 @@ void AlterTableProcessor::addColumn(uint32_t sessionID, execplan::CalpontSystemC } void AlterTableProcessor::dropColumn(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, - DDLResult& result, ddlpackage::AtaDropColumn& ataDropColumn, + DDLResult& /*result*/, ddlpackage::AtaDropColumn& ataDropColumn, ddlpackage::QualifiedName& fTableName, const uint64_t uniqueId) { // 1. Get the OIDs for the column @@ -1650,10 +1650,11 @@ void AlterTableProcessor::dropColumns(uint32_t sessionID, execplan::CalpontSyste } } -void AlterTableProcessor::addTableConstraint(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, - DDLResult& result, +void AlterTableProcessor::addTableConstraint(uint32_t /*sessionID*/, + execplan::CalpontSystemCatalog::SCN /*txnID*/, + DDLResult& /*result*/, ddlpackage::AtaAddTableConstraint& ataAddTableConstraint, - ddlpackage::QualifiedName& fTableName) + ddlpackage::QualifiedName& /*fTableName*/) { /*TODO: Check if existing row satisfy the constraint. If not, the constraint will not be added. */ @@ -1683,7 +1684,7 @@ void AlterTableProcessor::addTableConstraint(uint32_t sessionID, execplan::Calpo } void AlterTableProcessor::setColumnDefault(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, - DDLResult& result, + DDLResult& /*result*/, ddlpackage::AtaSetColumnDefault& ataSetColumnDefault, ddlpackage::QualifiedName& fTableName, const uint64_t uniqueId) { @@ -1772,7 +1773,7 @@ void AlterTableProcessor::setColumnDefault(uint32_t sessionID, execplan::Calpont throw std::runtime_error(errorMsg); } void AlterTableProcessor::dropColumnDefault(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, - DDLResult& result, + DDLResult& /*result*/, ddlpackage::AtaDropColumnDefault& ataDropColumnDefault, ddlpackage::QualifiedName& fTableName, const uint64_t uniqueId) { @@ -1946,7 +1947,7 @@ void AlterTableProcessor::dropTableConstraint (uint32_t sessionID, execplan::Cal #endif void AlterTableProcessor::renameTable(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, - DDLResult& result, ddlpackage::AtaRenameTable& ataRenameTable, + DDLResult& /*result*/, ddlpackage::AtaRenameTable& ataRenameTable, ddlpackage::QualifiedName& fTableName, const uint64_t uniqueId) { /*Steps: @@ -2115,8 +2116,8 @@ void AlterTableProcessor::renameTable(uint32_t sessionID, execplan::CalpontSyste throw std::runtime_error(errorMsg); } -void AlterTableProcessor::tableComment(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, - DDLResult& result, ddlpackage::AtaTableComment& ataTableComment, +void AlterTableProcessor::tableComment(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN /*txnID*/, + DDLResult& /*result*/, ddlpackage::AtaTableComment& ataTableComment, ddlpackage::QualifiedName& fTableName, const uint64_t uniqueId) { // Currently only process autoincrement values in table comments during alter @@ -2329,7 +2330,7 @@ void AlterTableProcessor::tableComment(uint32_t sessionID, execplan::CalpontSyst } void AlterTableProcessor::renameColumn(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, - DDLResult& result, ddlpackage::AtaRenameColumn& ataRenameColumn, + DDLResult& /*result*/, ddlpackage::AtaRenameColumn& ataRenameColumn, ddlpackage::QualifiedName& fTableName, const uint64_t uniqueId) { /*Steps: diff --git a/dbcon/ddlpackageproc/ddlpackageprocessor.cpp b/dbcon/ddlpackageproc/ddlpackageprocessor.cpp index 07a663b51..e4b8786d8 100644 --- a/dbcon/ddlpackageproc/ddlpackageprocessor.cpp +++ b/dbcon/ddlpackageproc/ddlpackageprocessor.cpp @@ -21,7 +21,7 @@ #include #include #include -//#define NDEBUG +// #define NDEBUG #include using namespace std; @@ -1144,7 +1144,7 @@ DDLPackageProcessor::DDLResult DDLPackageProcessor::processPackage(SqlStatement* return result; } -DDLPackageProcessor::DDLResult DDLPackageProcessor::processPackageInternal(SqlStatement* sqlStmt) +DDLPackageProcessor::DDLResult DDLPackageProcessor::processPackageInternal(SqlStatement* /*sqlStmt*/) { // This should not be called. DDLPackageProcessor::DDLResult result; @@ -1383,7 +1383,7 @@ int DDLPackageProcessor::rollBackTransaction(uint64_t uniqueId, BRM::TxnID txnID return rc; } -int DDLPackageProcessor::commitTransaction(uint64_t uniqueId, BRM::TxnID txnID) +int DDLPackageProcessor::commitTransaction(uint64_t /*uniqueId*/, BRM::TxnID txnID) { int rc = fDbrm->vbCommit(txnID.id); return rc; diff --git a/dbcon/dmlpackage/commanddmlpackage.h b/dbcon/dmlpackage/commanddmlpackage.h index 11bb7f413..7b70097a6 100644 --- a/dbcon/dmlpackage/commanddmlpackage.h +++ b/dbcon/dmlpackage/commanddmlpackage.h @@ -66,7 +66,7 @@ class CommandDMLPackage : public CalpontDMLPackage * @param columns the number of columns in the buffer * @param rows the number of rows in the buffer */ - inline int buildFromBuffer(std::string& buffer, int columns = 0, int rows = 0) override + inline int buildFromBuffer(std::string& /*buffer*/, int /*columns*/ = 0, int /*rows*/ = 0) override { return 1; }; @@ -80,8 +80,8 @@ class CommandDMLPackage : public CalpontDMLPackage * @param colNameList, tableValuesMap * @param rows the number of rows in the buffer */ - int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, int rows, - NullValuesBitset& nullValues) override + int buildFromMysqlBuffer(ColNameList& /*colNameList*/, TableValuesMap& /*tableValuesMap*/, int /*columns*/, int /*rows*/, + NullValuesBitset& /*nullValues*/) override { return 1; }; diff --git a/dbcon/dmlpackage/deletedmlpackage.cpp b/dbcon/dmlpackage/deletedmlpackage.cpp index cdbce4a94..3e1c875f9 100644 --- a/dbcon/dmlpackage/deletedmlpackage.cpp +++ b/dbcon/dmlpackage/deletedmlpackage.cpp @@ -143,7 +143,7 @@ int DeleteDMLPackage::buildFromSqlStatement(SqlStatement& sqlStatement) /** * */ -int DeleteDMLPackage::buildFromBuffer(std::string& buffer, int columns, int rows) +int DeleteDMLPackage::buildFromBuffer(std::string& buffer, int /*columns*/, int rows) { #ifdef DML_PACKAGE_DEBUG // cout << "The data buffer received: " << buffer << endl; @@ -200,8 +200,8 @@ int DeleteDMLPackage::buildFromBuffer(std::string& buffer, int columns, int rows return retval; } -int DeleteDMLPackage::buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, - int columns, int rows, NullValuesBitset& nullValues) +int DeleteDMLPackage::buildFromMysqlBuffer(ColNameList& /*colNameList*/, TableValuesMap& /*tableValuesMap*/, + int /*columns*/, int /*rows*/, NullValuesBitset& /*nullValues*/) { int retval = 1; diff --git a/dbcon/dmlpackage/dmlparser.cpp b/dbcon/dmlpackage/dmlparser.cpp index 1e189e9a9..5c879e3c7 100644 --- a/dbcon/dmlpackage/dmlparser.cpp +++ b/dbcon/dmlpackage/dmlparser.cpp @@ -62,7 +62,7 @@ DMLParser::~DMLParser() void DMLParser::setDebug(bool debug) { - fDebug = true; + fDebug = debug; } int DMLParser::parse(const char* dmltext) diff --git a/dbcon/dmlpackage/insertdmlpackage.cpp b/dbcon/dmlpackage/insertdmlpackage.cpp index 35f28ed46..796657578 100644 --- a/dbcon/dmlpackage/insertdmlpackage.cpp +++ b/dbcon/dmlpackage/insertdmlpackage.cpp @@ -203,7 +203,7 @@ int InsertDMLPackage::buildFromBuffer(std::string& buffer, int columns, int rows } int InsertDMLPackage::buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, - int columns, int rows, NullValuesBitset& nullValues) + int columns, int /*rows*/, NullValuesBitset& nullValues) { int retval = 1; diff --git a/dbcon/dmlpackage/updatedmlpackage.cpp b/dbcon/dmlpackage/updatedmlpackage.cpp index 488b42964..325b44220 100644 --- a/dbcon/dmlpackage/updatedmlpackage.cpp +++ b/dbcon/dmlpackage/updatedmlpackage.cpp @@ -223,7 +223,7 @@ int UpdateDMLPackage::buildFromBuffer(std::string& buffer, int columns, int rows return retval; } int UpdateDMLPackage::buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, - int columns, int rows, NullValuesBitset& nullValues) + int columns, int /*rows*/, NullValuesBitset& nullValues) { int retval = 1; diff --git a/dbcon/dmlpackageproc/deletepackageprocessor.cpp b/dbcon/dmlpackageproc/deletepackageprocessor.cpp index 42e3b4ee4..2653fd68d 100644 --- a/dbcon/dmlpackageproc/deletepackageprocessor.cpp +++ b/dbcon/dmlpackageproc/deletepackageprocessor.cpp @@ -801,7 +801,7 @@ bool DeletePackageProcessor::processRowgroup(ByteStream& aRowGroup, DMLResult& r } bool DeletePackageProcessor::receiveAll(DMLResult& result, const uint64_t uniqueId, std::vector& fPMs, - std::map& pmStateDel, const uint32_t tableOid) + std::map& pmStateDel, const uint32_t /*tableOid*/) { // check how many message we need to receive uint32_t messagesNotReceived = 0; diff --git a/dbcon/dmlpackageproc/dmlpackageprocessor.cpp b/dbcon/dmlpackageproc/dmlpackageprocessor.cpp index e5d288d0d..307ba1d39 100644 --- a/dbcon/dmlpackageproc/dmlpackageprocessor.cpp +++ b/dbcon/dmlpackageproc/dmlpackageprocessor.cpp @@ -210,7 +210,7 @@ void DMLPackageProcessor::convertRidToColumn(uint64_t& rid, unsigned& dbRoot, un unsigned& segment, unsigned filesPerColumnPartition, unsigned extentsPerSegmentFile, unsigned extentRows, unsigned startDBRoot, unsigned dbrootCnt, - const unsigned startPartitionNum) + const unsigned /*startPartitionNum*/) { partition = rid / (filesPerColumnPartition * extentsPerSegmentFile * extentRows); @@ -260,7 +260,7 @@ bool DMLPackageProcessor::validateVarbinaryVal(std::string& inStr) return invalid; } -int DMLPackageProcessor::commitTransaction(uint64_t uniqueId, BRM::TxnID txnID) +int DMLPackageProcessor::commitTransaction(uint64_t /*uniqueId*/, BRM::TxnID txnID) { int rc = fDbrm->vbCommit(txnID.id); return rc; @@ -587,7 +587,7 @@ int DMLPackageProcessor::commitBatchAutoOnTransaction(uint64_t uniqueId, BRM::Tx return rc; } -int DMLPackageProcessor::rollBackBatchAutoOnTransaction(uint64_t uniqueId, BRM::TxnID txnID, +int DMLPackageProcessor::rollBackBatchAutoOnTransaction(uint64_t uniqueId, BRM::TxnID /*txnID*/, uint32_t sessionID, const uint32_t tableOid, std::string& errorMsg) { @@ -720,7 +720,7 @@ int DMLPackageProcessor::rollBackBatchAutoOnTransaction(uint64_t uniqueId, BRM:: return rc; } -int DMLPackageProcessor::commitBatchAutoOffTransaction(uint64_t uniqueId, BRM::TxnID txnID, +int DMLPackageProcessor::commitBatchAutoOffTransaction(uint64_t uniqueId, BRM::TxnID /*txnID*/, const uint32_t tableOid, std::string& errorMsg) { std::vector tableLocks; @@ -853,7 +853,7 @@ int DMLPackageProcessor::rollBackBatchAutoOffTransaction(uint64_t uniqueId, BRM: return rc; } -int DMLPackageProcessor::flushDataFiles(int rcIn, std::map& columnOids, uint64_t uniqueId, +int DMLPackageProcessor::flushDataFiles(int rcIn, std::map& /*columnOids*/, uint64_t uniqueId, BRM::TxnID txnID, uint32_t tableOid) { // cout <<"in flushDataFiles" << endl; diff --git a/dbcon/dmlpackageproc/updatepackageprocessor.cpp b/dbcon/dmlpackageproc/updatepackageprocessor.cpp index ab2127721..651779a58 100644 --- a/dbcon/dmlpackageproc/updatepackageprocessor.cpp +++ b/dbcon/dmlpackageproc/updatepackageprocessor.cpp @@ -22,7 +22,7 @@ #include #include #include -//#define NDEBUG +// #define NDEBUG #include #include #include @@ -57,7 +57,7 @@ using namespace messageqcpp; using namespace BRM; using namespace oam; -//#define PROFILE 1 +// #define PROFILE 1 namespace dmlpackageprocessor { // StopWatch timer; @@ -118,9 +118,9 @@ DMLPackageProcessor::DMLResult UpdatePackageProcessor::processPackageInternal( fWEClient->addQueue(uniqueId); execplan::CalpontSystemCatalog::ROPair roPair; - //#ifdef PROFILE + // #ifdef PROFILE // StopWatch timer; - //#endif + // #endif try { LoggingID logid(DMLLoggingId, fSessionID, txnid.id); @@ -903,7 +903,7 @@ bool UpdatePackageProcessor::processRowgroup(ByteStream& aRowGroup, DMLResult& r } bool UpdatePackageProcessor::receiveAll(DMLResult& result, const uint64_t uniqueId, std::vector& fPMs, - std::map& pmState, const uint32_t tableOid) + std::map& pmState, const uint32_t /*tableOid*/) { // check how many message we need to receive uint32_t messagesNotReceived = 0; diff --git a/dbcon/execplan/arithmeticcolumn.h b/dbcon/execplan/arithmeticcolumn.h index a2b8fa923..77c7ff927 100644 --- a/dbcon/execplan/arithmeticcolumn.h +++ b/dbcon/execplan/arithmeticcolumn.h @@ -274,7 +274,7 @@ class ArithmeticColumn : public ReturnedColumn private: ParseTree* fExpression = nullptr; using TreeNode::evaluate; - void evaluate(rowgroup::Row& row) + void evaluate(rowgroup::Row& /*row*/) { } }; diff --git a/dbcon/execplan/calpontsystemcatalog.cpp b/dbcon/execplan/calpontsystemcatalog.cpp index e9ff42ed4..685c66b37 100644 --- a/dbcon/execplan/calpontsystemcatalog.cpp +++ b/dbcon/execplan/calpontsystemcatalog.cpp @@ -75,7 +75,6 @@ using namespace rowgroup; #include #include - #undef BAIL_IF_0 #if 1 // We are unlikely to ever get anything more out of this connection, so bail out @@ -341,14 +340,14 @@ bool CalpontSystemCatalog::TableAliasName::operator<(const TableAliasName& rhs) else if (view == rhs.view) { if (partitions < rhs.partitions) - { + { return true; - } - if (partitions == rhs.partitions) - { + } + if (partitions == rhs.partitions) + { if (fisColumnStore < rhs.fisColumnStore) return true; - } + } } } } @@ -853,7 +852,7 @@ void CalpontSystemCatalog::getSysData(CalpontSelectExecutionPlan& csep, NJLSysDa } void CalpontSystemCatalog::getSysData_EC(CalpontSelectExecutionPlan& csep, NJLSysDataList& sysDataList, - const string& sysTableName) + const string& /*sysTableName*/) { DEBUG << "Enter getSysData_EC " << fSessionID << endl; @@ -3236,7 +3235,8 @@ const CalpontSystemCatalog::RIDList CalpontSystemCatalog::columnRIDs(const Table for (int i = 0; i < (*it)->dataCount(); i++) { - TableColName tcn = make_tcn(aTableName.schema, aTableName.table, (*it)->GetStringData(i).safeString("")); + TableColName tcn = + make_tcn(aTableName.schema, aTableName.table, (*it)->GetStringData(i).safeString("")); fOIDmap[tcn] = rl[i].objnum; if (fIdentity == EC) @@ -3681,15 +3681,11 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::tableAUXColumnOID(const TableNam CalpontSelectExecutionPlan::FilterTokenList filterTokenList; CalpontSelectExecutionPlan::ColumnMap colMap; - static const std::string sysCatSchemaTablePrefix = - CALPONT_SCHEMA + "." + SYSTABLE_TABLE + "."; + static const std::string sysCatSchemaTablePrefix = CALPONT_SCHEMA + "." + SYSTABLE_TABLE + "."; - SimpleColumn* c1 = - new SimpleColumn(sysCatSchemaTablePrefix + AUXCOLUMNOID_COL, fSessionID); - SimpleColumn* c2 = - new SimpleColumn(sysCatSchemaTablePrefix + SCHEMA_COL, fSessionID); - SimpleColumn* c3 = - new SimpleColumn(sysCatSchemaTablePrefix + TABLENAME_COL, fSessionID); + SimpleColumn* c1 = new SimpleColumn(sysCatSchemaTablePrefix + AUXCOLUMNOID_COL, fSessionID); + SimpleColumn* c2 = new SimpleColumn(sysCatSchemaTablePrefix + SCHEMA_COL, fSessionID); + SimpleColumn* c3 = new SimpleColumn(sysCatSchemaTablePrefix + TABLENAME_COL, fSessionID); SRCP srcp; srcp.reset(c1); @@ -3793,13 +3789,10 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::isAUXColumnOID(const OID& oid) CalpontSelectExecutionPlan::FilterTokenList filterTokenList; CalpontSelectExecutionPlan::ColumnMap colMap; - static const std::string sysCatSchemaTablePrefix = - CALPONT_SCHEMA + "." + SYSTABLE_TABLE + "."; + static const std::string sysCatSchemaTablePrefix = CALPONT_SCHEMA + "." + SYSTABLE_TABLE + "."; - SimpleColumn* c1 = - new SimpleColumn(sysCatSchemaTablePrefix + OBJECTID_COL, fSessionID); - SimpleColumn* c2 = - new SimpleColumn(sysCatSchemaTablePrefix + AUXCOLUMNOID_COL, fSessionID); + SimpleColumn* c1 = new SimpleColumn(sysCatSchemaTablePrefix + OBJECTID_COL, fSessionID); + SimpleColumn* c2 = new SimpleColumn(sysCatSchemaTablePrefix + AUXCOLUMNOID_COL, fSessionID); SRCP srcp; srcp.reset(c1); colMap.insert(CMVT_(sysCatSchemaTablePrefix + OBJECTID_COL, srcp)); @@ -3820,8 +3813,7 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::isAUXColumnOID(const OID& oid) csep.filterTokenList(filterTokenList); ostringstream oss; - oss << "select objectid from systable where auxcolumnoid='" << oid - << "' --isAUXColumnOID/"; + oss << "select objectid from systable where auxcolumnoid='" << oid << "' --isAUXColumnOID/"; if (fIdentity == EC) oss << "EC"; @@ -5961,122 +5953,146 @@ void CalpontSystemCatalog::buildSysColinfomap() DictOID notDict; // @bug 4433 - Increase object width from 64 to 128 for schema names, table names, and column names. - fColinfomap[OID_SYSTABLE_TABLENAME] = ColType(129, scale, precision, NOTNULL_CONSTRAINT, - DictOID(DICTOID_SYSTABLE_TABLENAME, LISTOID_SYSTABLE_TABLENAME, TREEOID_SYSTABLE_TABLENAME, compressionType), - colPosition++, compressionType, OID_SYSTABLE_TABLENAME, VARCHAR); + fColinfomap[OID_SYSTABLE_TABLENAME] = + ColType(129, scale, precision, NOTNULL_CONSTRAINT, + DictOID(DICTOID_SYSTABLE_TABLENAME, LISTOID_SYSTABLE_TABLENAME, TREEOID_SYSTABLE_TABLENAME, + compressionType), + colPosition++, compressionType, OID_SYSTABLE_TABLENAME, VARCHAR); - fColinfomap[OID_SYSTABLE_SCHEMA] = ColType(129, scale, precision, NOTNULL_CONSTRAINT, - DictOID(DICTOID_SYSTABLE_SCHEMA, LISTOID_SYSTABLE_SCHEMA, TREEOID_SYSTABLE_SCHEMA, compressionType), - colPosition++, compressionType, OID_SYSTABLE_SCHEMA, VARCHAR); + fColinfomap[OID_SYSTABLE_SCHEMA] = ColType( + 129, scale, precision, NOTNULL_CONSTRAINT, + DictOID(DICTOID_SYSTABLE_SCHEMA, LISTOID_SYSTABLE_SCHEMA, TREEOID_SYSTABLE_SCHEMA, compressionType), + colPosition++, compressionType, OID_SYSTABLE_SCHEMA, VARCHAR); - fColinfomap[OID_SYSTABLE_OBJECTID] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSTABLE_OBJECTID, INT); + fColinfomap[OID_SYSTABLE_OBJECTID] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, + colPosition++, compressionType, OID_SYSTABLE_OBJECTID, INT); - fColinfomap[OID_SYSTABLE_CREATEDATE] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSTABLE_CREATEDATE, DATE); + fColinfomap[OID_SYSTABLE_CREATEDATE] = + ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, colPosition++, compressionType, + OID_SYSTABLE_CREATEDATE, DATE); - fColinfomap[OID_SYSTABLE_LASTUPDATE] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSTABLE_LASTUPDATE, DATE); + fColinfomap[OID_SYSTABLE_LASTUPDATE] = + ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, colPosition++, compressionType, + OID_SYSTABLE_LASTUPDATE, DATE); - fColinfomap[OID_SYSTABLE_INIT] = ColType(4, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSTABLE_INIT, INT); + fColinfomap[OID_SYSTABLE_INIT] = ColType(4, scale, precision, NO_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSTABLE_INIT, INT); - fColinfomap[OID_SYSTABLE_NEXT] = ColType(4, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSTABLE_NEXT, INT); + fColinfomap[OID_SYSTABLE_NEXT] = ColType(4, scale, precision, NO_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSTABLE_NEXT, INT); - fColinfomap[OID_SYSTABLE_NUMOFROWS] = ColType(4, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSTABLE_NUMOFROWS, INT); + fColinfomap[OID_SYSTABLE_NUMOFROWS] = ColType(4, scale, precision, NO_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSTABLE_NUMOFROWS, INT); - fColinfomap[OID_SYSTABLE_AVGROWLEN] = ColType(4, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSTABLE_AVGROWLEN, INT); + fColinfomap[OID_SYSTABLE_AVGROWLEN] = ColType(4, scale, precision, NO_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSTABLE_AVGROWLEN, INT); - fColinfomap[OID_SYSTABLE_NUMOFBLOCKS] = ColType(4, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSTABLE_NUMOFBLOCKS, INT); + fColinfomap[OID_SYSTABLE_NUMOFBLOCKS] = ColType(4, scale, precision, NO_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSTABLE_NUMOFBLOCKS, INT); - fColinfomap[OID_SYSTABLE_AUTOINCREMENT] = ColType(4, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSTABLE_AUTOINCREMENT, INT); + fColinfomap[OID_SYSTABLE_AUTOINCREMENT] = + ColType(4, scale, precision, NO_CONSTRAINT, notDict, colPosition++, compressionType, + OID_SYSTABLE_AUTOINCREMENT, INT); - fColinfomap[OID_SYSTABLE_AUXCOLUMNOID] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSTABLE_AUXCOLUMNOID, INT); + fColinfomap[OID_SYSTABLE_AUXCOLUMNOID] = + ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, colPosition++, compressionType, + OID_SYSTABLE_AUXCOLUMNOID, INT); fTablemap[make_table(CALPONT_SCHEMA, SYSCOLUMN_TABLE)] = SYSCOLUMN_BASE; colPosition = 0; - fColinfomap[OID_SYSCOLUMN_SCHEMA] = ColType(129, scale, precision, NOTNULL_CONSTRAINT, - DictOID(DICTOID_SYSCOLUMN_SCHEMA, LISTOID_SYSCOLUMN_SCHEMA, TREEOID_SYSCOLUMN_SCHEMA, compressionType), - colPosition++, compressionType, OID_SYSCOLUMN_SCHEMA, VARCHAR); + fColinfomap[OID_SYSCOLUMN_SCHEMA] = ColType( + 129, scale, precision, NOTNULL_CONSTRAINT, + DictOID(DICTOID_SYSCOLUMN_SCHEMA, LISTOID_SYSCOLUMN_SCHEMA, TREEOID_SYSCOLUMN_SCHEMA, compressionType), + colPosition++, compressionType, OID_SYSCOLUMN_SCHEMA, VARCHAR); - fColinfomap[OID_SYSCOLUMN_TABLENAME] = ColType(129, scale, precision, NOTNULL_CONSTRAINT, - DictOID(DICTOID_SYSCOLUMN_TABLENAME, LISTOID_SYSCOLUMN_TABLENAME, TREEOID_SYSCOLUMN_TABLENAME, compressionType), - colPosition++, compressionType, OID_SYSCOLUMN_TABLENAME, VARCHAR); + fColinfomap[OID_SYSCOLUMN_TABLENAME] = + ColType(129, scale, precision, NOTNULL_CONSTRAINT, + DictOID(DICTOID_SYSCOLUMN_TABLENAME, LISTOID_SYSCOLUMN_TABLENAME, TREEOID_SYSCOLUMN_TABLENAME, + compressionType), + colPosition++, compressionType, OID_SYSCOLUMN_TABLENAME, VARCHAR); - fColinfomap[OID_SYSCOLUMN_COLNAME] = ColType(129, scale, precision, NOTNULL_CONSTRAINT, - DictOID(DICTOID_SYSCOLUMN_COLNAME, LISTOID_SYSCOLUMN_COLNAME, TREEOID_SYSCOLUMN_COLNAME, compressionType), - colPosition++, compressionType, OID_SYSCOLUMN_COLNAME, VARCHAR); + fColinfomap[OID_SYSCOLUMN_COLNAME] = + ColType(129, scale, precision, NOTNULL_CONSTRAINT, + DictOID(DICTOID_SYSCOLUMN_COLNAME, LISTOID_SYSCOLUMN_COLNAME, TREEOID_SYSCOLUMN_COLNAME, + compressionType), + colPosition++, compressionType, OID_SYSCOLUMN_COLNAME, VARCHAR); - fColinfomap[OID_SYSCOLUMN_OBJECTID] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_OBJECTID, INT); + fColinfomap[OID_SYSCOLUMN_OBJECTID] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, + colPosition++, compressionType, OID_SYSCOLUMN_OBJECTID, INT); - fColinfomap[OID_SYSCOLUMN_DICTOID] = ColType(4, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_DICTOID, INT); + fColinfomap[OID_SYSCOLUMN_DICTOID] = ColType(4, scale, precision, NO_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSCOLUMN_DICTOID, INT); - fColinfomap[OID_SYSCOLUMN_LISTOBJID] = ColType(4, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_LISTOBJID, INT); + fColinfomap[OID_SYSCOLUMN_LISTOBJID] = ColType(4, scale, precision, NO_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSCOLUMN_LISTOBJID, INT); - fColinfomap[OID_SYSCOLUMN_TREEOBJID] = ColType(4, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_TREEOBJID, INT); + fColinfomap[OID_SYSCOLUMN_TREEOBJID] = ColType(4, scale, precision, NO_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSCOLUMN_TREEOBJID, INT); - fColinfomap[OID_SYSCOLUMN_DATATYPE] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_DATATYPE, INT); + fColinfomap[OID_SYSCOLUMN_DATATYPE] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, + colPosition++, compressionType, OID_SYSCOLUMN_DATATYPE, INT); - fColinfomap[OID_SYSCOLUMN_COLUMNLEN] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_COLUMNLEN, INT); + fColinfomap[OID_SYSCOLUMN_COLUMNLEN] = + ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, colPosition++, compressionType, + OID_SYSCOLUMN_COLUMNLEN, INT); - fColinfomap[OID_SYSCOLUMN_COLUMNPOS] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_COLUMNPOS, INT); + fColinfomap[OID_SYSCOLUMN_COLUMNPOS] = + ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, colPosition++, compressionType, + OID_SYSCOLUMN_COLUMNPOS, INT); - fColinfomap[OID_SYSCOLUMN_LASTUPDATE] = ColType(4, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_LASTUPDATE, DATE); + fColinfomap[OID_SYSCOLUMN_LASTUPDATE] = ColType(4, scale, precision, NO_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSCOLUMN_LASTUPDATE, DATE); - fColinfomap[OID_SYSCOLUMN_DEFAULTVAL] = ColType(64, scale, precision, NO_CONSTRAINT, - DictOID(DICTOID_SYSCOLUMN_DEFAULTVAL, LISTOID_SYSCOLUMN_DEFAULTVAL, TREEOID_SYSCOLUMN_DEFAULTVAL, compressionType), - colPosition++, compressionType, OID_SYSCOLUMN_DEFAULTVAL, VARCHAR); + fColinfomap[OID_SYSCOLUMN_DEFAULTVAL] = + ColType(64, scale, precision, NO_CONSTRAINT, + DictOID(DICTOID_SYSCOLUMN_DEFAULTVAL, LISTOID_SYSCOLUMN_DEFAULTVAL, + TREEOID_SYSCOLUMN_DEFAULTVAL, compressionType), + colPosition++, compressionType, OID_SYSCOLUMN_DEFAULTVAL, VARCHAR); - fColinfomap[OID_SYSCOLUMN_NULLABLE] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_NULLABLE, INT); + fColinfomap[OID_SYSCOLUMN_NULLABLE] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, + colPosition++, compressionType, OID_SYSCOLUMN_NULLABLE, INT); - fColinfomap[OID_SYSCOLUMN_SCALE] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_SCALE, INT); + fColinfomap[OID_SYSCOLUMN_SCALE] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSCOLUMN_SCALE, INT); - fColinfomap[OID_SYSCOLUMN_PRECISION] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_PRECISION, INT); + fColinfomap[OID_SYSCOLUMN_PRECISION] = + ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, colPosition++, compressionType, + OID_SYSCOLUMN_PRECISION, INT); - fColinfomap[OID_SYSCOLUMN_AUTOINC] = ColType(1, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_AUTOINC, CHAR); + fColinfomap[OID_SYSCOLUMN_AUTOINC] = ColType(1, scale, precision, NO_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSCOLUMN_AUTOINC, CHAR); - fColinfomap[OID_SYSCOLUMN_DISTCOUNT] = ColType(4, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_DISTCOUNT, INT); + fColinfomap[OID_SYSCOLUMN_DISTCOUNT] = ColType(4, scale, precision, NO_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSCOLUMN_DISTCOUNT, INT); - fColinfomap[OID_SYSCOLUMN_NULLCOUNT] = ColType(4, scale, precision, NO_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_NULLCOUNT, INT); + fColinfomap[OID_SYSCOLUMN_NULLCOUNT] = ColType(4, scale, precision, NO_CONSTRAINT, notDict, colPosition++, + compressionType, OID_SYSCOLUMN_NULLCOUNT, INT); - fColinfomap[OID_SYSCOLUMN_MINVALUE] = ColType(65, scale, precision, NO_CONSTRAINT, - DictOID(DICTOID_SYSCOLUMN_MINVALUE, LISTOID_SYSCOLUMN_MINVALUE, TREEOID_SYSCOLUMN_MINVALUE, compressionType), - colPosition++, compressionType, OID_SYSCOLUMN_MINVALUE, VARCHAR); + fColinfomap[OID_SYSCOLUMN_MINVALUE] = + ColType(65, scale, precision, NO_CONSTRAINT, + DictOID(DICTOID_SYSCOLUMN_MINVALUE, LISTOID_SYSCOLUMN_MINVALUE, TREEOID_SYSCOLUMN_MINVALUE, + compressionType), + colPosition++, compressionType, OID_SYSCOLUMN_MINVALUE, VARCHAR); - fColinfomap[OID_SYSCOLUMN_MAXVALUE] = ColType(65, scale, precision, NO_CONSTRAINT, - DictOID(DICTOID_SYSCOLUMN_MAXVALUE, LISTOID_SYSCOLUMN_MAXVALUE, TREEOID_SYSCOLUMN_MAXVALUE, compressionType), - colPosition++, compressionType, OID_SYSCOLUMN_MAXVALUE, VARCHAR); + fColinfomap[OID_SYSCOLUMN_MAXVALUE] = + ColType(65, scale, precision, NO_CONSTRAINT, + DictOID(DICTOID_SYSCOLUMN_MAXVALUE, LISTOID_SYSCOLUMN_MAXVALUE, TREEOID_SYSCOLUMN_MAXVALUE, + compressionType), + colPosition++, compressionType, OID_SYSCOLUMN_MAXVALUE, VARCHAR); - fColinfomap[OID_SYSCOLUMN_COMPRESSIONTYPE] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_COMPRESSIONTYPE, INT); + fColinfomap[OID_SYSCOLUMN_COMPRESSIONTYPE] = + ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, colPosition++, compressionType, + OID_SYSCOLUMN_COMPRESSIONTYPE, INT); - fColinfomap[OID_SYSCOLUMN_NEXTVALUE] = ColType(8, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_NEXTVALUE, UBIGINT); + fColinfomap[OID_SYSCOLUMN_NEXTVALUE] = + ColType(8, scale, precision, NOTNULL_CONSTRAINT, notDict, colPosition++, compressionType, + OID_SYSCOLUMN_NEXTVALUE, UBIGINT); - fColinfomap[OID_SYSCOLUMN_CHARSETNUM] = ColType(4, scale, precision, NOTNULL_CONSTRAINT, - notDict, colPosition++, compressionType, OID_SYSCOLUMN_CHARSETNUM, INT); + fColinfomap[OID_SYSCOLUMN_CHARSETNUM] = + ColType(4, scale, precision, NOTNULL_CONSTRAINT, notDict, colPosition++, compressionType, + OID_SYSCOLUMN_CHARSETNUM, INT); } void CalpontSystemCatalog::buildSysOIDmap() @@ -6170,13 +6186,14 @@ CalpontSystemCatalog::ColType::ColType(const ColType& rhs) : TypeHolderStd(rhs) } CalpontSystemCatalog::ColType::ColType(int32_t colWidth_, int32_t scale_, int32_t precision_, - const ConstraintType& constraintType_, const DictOID& ddn_, int32_t colPosition_, - int32_t compressionType_, OID columnOID_, const ColDataType& colDataType_) - : constraintType(constraintType_), - ddn(ddn_), - colPosition(colPosition_), - compressionType(compressionType_), - columnOID(columnOID_) + const ConstraintType& constraintType_, const DictOID& ddn_, + int32_t colPosition_, int32_t compressionType_, OID columnOID_, + const ColDataType& colDataType_) + : constraintType(constraintType_) + , ddn(ddn_) + , colPosition(colPosition_) + , compressionType(compressionType_) + , columnOID(columnOID_) { colWidth = colWidth_; scale = scale_; @@ -6251,8 +6268,7 @@ boost::any CalpontSystemCatalog::ColType::convertColumnData(const NullString& da } CalpontSystemCatalog::ColType CalpontSystemCatalog::ColType::convertUnionColType( - vector& types, - unsigned int& rc) + vector& types, unsigned int& rc) { idbassert(types.size()); CalpontSystemCatalog::ColType unionedType = types[0]; @@ -6328,7 +6344,7 @@ bool ctListSort(const CalpontSystemCatalog::ColType& a, const CalpontSystemCatal return a.colPosition < b.colPosition; } -bool operator <(const Partitions& a, const Partitions& b) +bool operator<(const Partitions& a, const Partitions& b) { // lexicographic order. uint32_t l = std::min(a.fPartNames.size(), b.fPartNames.size()); @@ -6353,7 +6369,7 @@ bool operator <(const Partitions& a, const Partitions& b) } return false; } -bool operator ==(const Partitions& a, const Partitions& b) +bool operator==(const Partitions& a, const Partitions& b) { if (a.fPartNames.size() != b.fPartNames.size()) { @@ -6370,7 +6386,7 @@ bool operator ==(const Partitions& a, const Partitions& b) return true; } -bool operator !=(const Partitions& a, const Partitions& b) +bool operator!=(const Partitions& a, const Partitions& b) { return !(a == b); } diff --git a/dbcon/execplan/calpontsystemcatalog.h b/dbcon/execplan/calpontsystemcatalog.h index ebb910fc6..1963e7999 100644 --- a/dbcon/execplan/calpontsystemcatalog.h +++ b/dbcon/execplan/calpontsystemcatalog.h @@ -1010,7 +1010,7 @@ const CalpontSystemCatalog::TableAliasName make_aliasview(const std::string& s, const bool fisColumnStore = true, int lower_case_table_names = 0); -inline bool isNull(int128_t val, const execplan::CalpontSystemCatalog::ColType& ct) +inline bool isNull(int128_t val, const execplan::CalpontSystemCatalog::ColType& /*ct*/) { return datatypes::Decimal::isWideDecimalNullValue(val); } diff --git a/dbcon/execplan/constantcolumn.cpp b/dbcon/execplan/constantcolumn.cpp index 83d73353a..85eb4dea0 100644 --- a/dbcon/execplan/constantcolumn.cpp +++ b/dbcon/execplan/constantcolumn.cpp @@ -349,13 +349,11 @@ void RollupMarkColumn::unserialize(messageqcpp::ByteStream& b) b >> (uint8_t&)fResult.decimalVal.precision; } static utils::NullString ns; -const utils::NullString& RollupMarkColumn::getStrVal(rowgroup::Row& row, bool& isNull) +const utils::NullString& RollupMarkColumn::getStrVal(rowgroup::Row& /*row*/, bool& /*isNull*/) { return ns; } - - bool ConstantColumn::operator==(const ConstantColumn& t) const { const ReturnedColumn *rc1, *rc2; diff --git a/dbcon/execplan/constantcolumn.h b/dbcon/execplan/constantcolumn.h index 3094f8b8d..74ad9d7a5 100644 --- a/dbcon/execplan/constantcolumn.h +++ b/dbcon/execplan/constantcolumn.h @@ -262,13 +262,13 @@ class ConstantColumn : public ReturnedColumn * F&E */ using ReturnedColumn::evaluate; - virtual void evaluate(rowgroup::Row& row) + virtual void evaluate(rowgroup::Row& /*row*/) { } /** * F&E */ - bool getBoolVal(rowgroup::Row& row, bool& isNull) override + bool getBoolVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = isNull || (fType == NULLDATA); return TreeNode::getBoolVal(); @@ -276,7 +276,7 @@ class ConstantColumn : public ReturnedColumn /** * F&E */ - const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override + const utils::NullString& getStrVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = isNull || (fType == NULLDATA); return fResult.strVal; @@ -284,7 +284,7 @@ class ConstantColumn : public ReturnedColumn /** * F&E */ - int64_t getIntVal(rowgroup::Row& row, bool& isNull) override + int64_t getIntVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = isNull || (fType == NULLDATA); return fResult.intVal; @@ -292,7 +292,7 @@ class ConstantColumn : public ReturnedColumn /** * F&E */ - uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override + uint64_t getUintVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = isNull || (fType == NULLDATA); return fResult.uintVal; @@ -300,7 +300,7 @@ class ConstantColumn : public ReturnedColumn /** * F&E */ - float getFloatVal(rowgroup::Row& row, bool& isNull) override + float getFloatVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = isNull || (fType == NULLDATA); return fResult.floatVal; @@ -308,7 +308,7 @@ class ConstantColumn : public ReturnedColumn /** * F&E */ - double getDoubleVal(rowgroup::Row& row, bool& isNull) override + double getDoubleVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = isNull || (fType == NULLDATA); return fResult.doubleVal; @@ -316,7 +316,7 @@ class ConstantColumn : public ReturnedColumn /** * F&E */ - IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override + IDB_Decimal getDecimalVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = isNull || (fType == NULLDATA); return fResult.decimalVal; @@ -324,7 +324,7 @@ class ConstantColumn : public ReturnedColumn /** * F&E */ - int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override + int32_t getDateIntVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = isNull || (fType == NULLDATA); @@ -339,7 +339,7 @@ class ConstantColumn : public ReturnedColumn /** * F&E */ - int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override + int64_t getDatetimeIntVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = isNull || (fType == NULLDATA); @@ -355,7 +355,7 @@ class ConstantColumn : public ReturnedColumn /** * F&E */ - int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override + int64_t getTimestampIntVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = isNull || (fType == NULLDATA); @@ -371,7 +371,7 @@ class ConstantColumn : public ReturnedColumn /** * F&E */ - int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override + int64_t getTimeIntVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = isNull || (fType == NULLDATA); @@ -509,7 +509,7 @@ class RollupMarkColumn : public ReturnedColumn /** * accessor */ - void data(const std::string data) override + void data(const std::string /*data*/) override { idbassert(0); } @@ -521,7 +521,7 @@ class RollupMarkColumn : public ReturnedColumn return "RollupMarkColumn"; } - std::string toCppCode(IncludeSet& includes) const override + std::string toCppCode(IncludeSet& /*includes*/) const override { idbassert(0); } @@ -551,7 +551,7 @@ class RollupMarkColumn : public ReturnedColumn * Do a deep, strict (as opposed to semantic) equivalence test. * @return true iff every member of t is a duplicate copy of every member of this; false otherwise */ - bool operator==(const TreeNode* t) const override + bool operator==(const TreeNode* /*t*/) const override { return false; } @@ -561,7 +561,7 @@ class RollupMarkColumn : public ReturnedColumn * Do a deep, strict (as opposed to semantic) equivalence test. * @return true iff every member of t is a duplicate copy of every member of this; false otherwise */ - bool operator==(const RollupMarkColumn& t) const + bool operator==(const RollupMarkColumn& /*t*/) const { return true; } @@ -571,7 +571,7 @@ class RollupMarkColumn : public ReturnedColumn * Do a deep, strict (as opposed to semantic) equivalence test. * @return false iff every member of t is a duplicate copy of every member of this; true otherwise */ - bool operator!=(const TreeNode* t) const override + bool operator!=(const TreeNode* /*t*/) const override { return true; } @@ -581,7 +581,7 @@ class RollupMarkColumn : public ReturnedColumn * Do a deep, strict (as opposed to semantic) equivalence test. * @return false iff every member of t is a duplicate copy of every member of this; true otherwise */ - bool operator!=(const RollupMarkColumn& t) const + bool operator!=(const RollupMarkColumn& /*t*/) const { return false; } @@ -611,13 +611,13 @@ class RollupMarkColumn : public ReturnedColumn ***********************************************************/ public: using ReturnedColumn::evaluate; - virtual void evaluate(rowgroup::Row& row) + virtual void evaluate(rowgroup::Row& /*row*/) { } /** * F&E */ - bool getBoolVal(rowgroup::Row& row, bool& isNull) override + bool getBoolVal(rowgroup::Row& /*row*/, bool& /*isNull*/) override { return true; } @@ -628,7 +628,7 @@ class RollupMarkColumn : public ReturnedColumn /** * F&E */ - int64_t getIntVal(rowgroup::Row& row, bool& isNull) override + int64_t getIntVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = false; return 0x12340000UL; @@ -657,7 +657,7 @@ class RollupMarkColumn : public ReturnedColumn /** * F&E */ - IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override + IDB_Decimal getDecimalVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = false; return fResult.decimalVal; @@ -665,7 +665,7 @@ class RollupMarkColumn : public ReturnedColumn /** * F&E */ - int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override + int32_t getDateIntVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = false; @@ -680,7 +680,7 @@ class RollupMarkColumn : public ReturnedColumn /** * F&E */ - int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override + int64_t getDatetimeIntVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = false; @@ -696,7 +696,7 @@ class RollupMarkColumn : public ReturnedColumn /** * F&E */ - int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override + int64_t getTimestampIntVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = false; @@ -712,7 +712,7 @@ class RollupMarkColumn : public ReturnedColumn /** * F&E */ - int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override + int64_t getTimeIntVal(rowgroup::Row& /*row*/, bool& isNull) override { isNull = false; diff --git a/dbcon/execplan/functioncolumn.h b/dbcon/execplan/functioncolumn.h index cf7a3519b..32ce7fc25 100644 --- a/dbcon/execplan/functioncolumn.h +++ b/dbcon/execplan/functioncolumn.h @@ -335,7 +335,6 @@ class FunctionColumn : public ReturnedColumn funcexp::FunctionParm fFunctionParms; funcexp::Func* fFunctor; /// functor to execute this function funcexp::Func* fDynamicFunctor = nullptr; // for rand encode decode - bool fFixed = false; }; /** diff --git a/dbcon/execplan/groupconcatcolumn.cpp b/dbcon/execplan/groupconcatcolumn.cpp index f6770acbe..5dc232671 100644 --- a/dbcon/execplan/groupconcatcolumn.cpp +++ b/dbcon/execplan/groupconcatcolumn.cpp @@ -50,7 +50,7 @@ GroupConcatColumn::GroupConcatColumn(const uint32_t sessionID, bool isJsonArrayA { } -GroupConcatColumn::GroupConcatColumn(const GroupConcatColumn& rhs, const uint32_t sessionID) +GroupConcatColumn::GroupConcatColumn(const GroupConcatColumn& rhs, const uint32_t /*sessionID*/) : AggregateColumn(dynamic_cast(rhs)) , fOrderCols(rhs.fOrderCols) , fSeparator(rhs.fSeparator) diff --git a/dbcon/execplan/intervalcolumn.h b/dbcon/execplan/intervalcolumn.h index 3017de68a..30c3f99a0 100644 --- a/dbcon/execplan/intervalcolumn.h +++ b/dbcon/execplan/intervalcolumn.h @@ -122,12 +122,12 @@ class IntervalColumn : public ReturnedColumn int fIntervalType; // okay to be private for now. - bool operator==(const TreeNode* t) const override + bool operator==(const TreeNode* /*t*/) const override { return false; } bool operator==(const IntervalColumn& t) const; - bool operator!=(const TreeNode* t) const override + bool operator!=(const TreeNode* /*t*/) const override { return false; } diff --git a/dbcon/execplan/mcsanalyzetableexecutionplan.h b/dbcon/execplan/mcsanalyzetableexecutionplan.h index a33dfe504..667581912 100644 --- a/dbcon/execplan/mcsanalyzetableexecutionplan.h +++ b/dbcon/execplan/mcsanalyzetableexecutionplan.h @@ -237,11 +237,11 @@ class MCSAnalyzeTableExecutionPlan : public CalpontExecutionPlan void unserialize(messageqcpp::ByteStream& bs) override; // TODO: Why do we need this? - bool operator==(const CalpontExecutionPlan* t) const override + bool operator==(const CalpontExecutionPlan* /*t*/) const override { return false; } - bool operator!=(const CalpontExecutionPlan* t) const override + bool operator!=(const CalpontExecutionPlan* /*t*/) const override { return false; } diff --git a/dbcon/execplan/objectidmanager.cpp b/dbcon/execplan/objectidmanager.cpp index 453ce8b46..787e41386 100644 --- a/dbcon/execplan/objectidmanager.cpp +++ b/dbcon/execplan/objectidmanager.cpp @@ -66,7 +66,7 @@ #include #include #include -//#define NDEBUG +// #define NDEBUG #include using namespace std; @@ -144,7 +144,7 @@ void ObjectIDManager::returnOID(int oid) returnOIDs(oid, oid); } -void ObjectIDManager::returnOIDs(int start, int end) +void ObjectIDManager::returnOIDs(int /*start*/, int /*end*/) { //@Bug 1412. Do not reuse oids for now. return; diff --git a/dbcon/execplan/operator.h b/dbcon/execplan/operator.h index 63b14be52..dbd9b4a2d 100644 --- a/dbcon/execplan/operator.h +++ b/dbcon/execplan/operator.h @@ -157,78 +157,78 @@ class Operator : public TreeNode fOp = op; } using TreeNode::evaluate; - virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual void evaluate(rowgroup::Row& /*row*/, bool& /*isNull*/, ParseTree* /*lop*/, ParseTree* /*rop*/) { } // The following methods should be pure virtual. Currently too many instanslization exists. using TreeNode::getStrVal; - virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual const utils::NullString& getStrVal(rowgroup::Row& /*row*/, bool& isNull, ParseTree* /*lop*/, ParseTree* /*rop*/) { isNull = isNull || fResult.strVal.isNull(); return fResult.strVal; } using TreeNode::getIntVal; - virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual int64_t getIntVal(rowgroup::Row& /*row*/, bool& /*isNull*/, ParseTree* /*lop*/, ParseTree* /*rop*/) { return fResult.intVal; } using TreeNode::getUintVal; - virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual uint64_t getUintVal(rowgroup::Row& /*row*/, bool& /*isNull*/, ParseTree* /*lop*/, ParseTree* /*rop*/) { return fResult.uintVal; } using TreeNode::getFloatVal; - virtual float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual float getFloatVal(rowgroup::Row& /*row*/, bool& /*isNull*/, ParseTree* /*lop*/, ParseTree* /*rop*/) { return fResult.floatVal; } using TreeNode::getDoubleVal; - virtual double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual double getDoubleVal(rowgroup::Row& /*row*/, bool& /*isNull*/, ParseTree* /*lop*/, ParseTree* /*rop*/) { return fResult.doubleVal; } using TreeNode::getLongDoubleVal; - virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual long double getLongDoubleVal(rowgroup::Row& /*row*/, bool& /*isNull*/, ParseTree* /*lop*/, ParseTree* /*rop*/) { return fResult.longDoubleVal; } using TreeNode::getDecimalVal; - virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual IDB_Decimal getDecimalVal(rowgroup::Row& /*row*/, bool& /*isNull*/, ParseTree* /*lop*/, ParseTree* /*rop*/) { return fResult.decimalVal; } using TreeNode::getDateIntVal; - virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual int32_t getDateIntVal(rowgroup::Row& /*row*/, bool& /*isNull*/, ParseTree* /*lop*/, ParseTree* /*rop*/) { return fResult.intVal; } using TreeNode::getDatetimeIntVal; - virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual int64_t getDatetimeIntVal(rowgroup::Row& /*row*/, bool& /*isNull*/, ParseTree* /*lop*/, ParseTree* /*rop*/) { return fResult.intVal; } using TreeNode::getTimestampIntVal; - virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual int64_t getTimestampIntVal(rowgroup::Row& /*row*/, bool& /*isNull*/, ParseTree* /*lop*/, ParseTree* /*rop*/) { return fResult.intVal; } using TreeNode::getTimeIntVal; - virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual int64_t getTimeIntVal(rowgroup::Row& /*row*/, bool& /*isNull*/, ParseTree* /*lop*/, ParseTree* /*rop*/) { return fResult.intVal; } using TreeNode::getBoolVal; - virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) + virtual bool getBoolVal(rowgroup::Row& /*row*/, bool& /*isNull*/, ParseTree* /*lop*/, ParseTree* /*rop*/) { return fResult.boolVal; } - virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ReturnedColumn* lop, ReturnedColumn* rop) + virtual bool getBoolVal(rowgroup::Row& /*row*/, bool& /*isNull*/, ReturnedColumn* /*lop*/, ReturnedColumn* /*rop*/) { return fResult.boolVal; } - virtual void setOpType(Type& l, Type& r) + virtual void setOpType(Type& /*l*/, Type& /*r*/) { } void operationType(const Type& ot) override diff --git a/dbcon/execplan/returnedcolumn.h b/dbcon/execplan/returnedcolumn.h index 00031de8d..fa84ca12a 100644 --- a/dbcon/execplan/returnedcolumn.h +++ b/dbcon/execplan/returnedcolumn.h @@ -321,7 +321,7 @@ class ReturnedColumn : public TreeNode * @return true, if all arguments belong to one table * false, if multiple tables are involved in the function */ - virtual bool singleTable(CalpontSystemCatalog::TableAliasName& tan) + virtual bool singleTable(CalpontSystemCatalog::TableAliasName& /*tan*/) { return false; } diff --git a/dbcon/execplan/rewrites.cpp b/dbcon/execplan/rewrites.cpp index 6c1ef8612..a7518bbd3 100644 --- a/dbcon/execplan/rewrites.cpp +++ b/dbcon/execplan/rewrites.cpp @@ -82,7 +82,7 @@ enum class ChildType Leave }; -void printTreeLevel(execplan::ParseTree* root, int level) +void printTreeLevel([[maybe_unused]] execplan::ParseTree* root, [[maybe_unused]] int level) { #if debug_rewrites auto sep = std::string(level * 4, '-'); @@ -116,7 +116,8 @@ struct StackFrameWithSet bool orMet; bool andParent; CommonContainer localset; - StackFrameWithSet(execplan::ParseTree* node_, ParseTree::GoTo direction_, bool orMet_ = false, bool andParent_ = false) + StackFrameWithSet(execplan::ParseTree* node_, ParseTree::GoTo direction_, bool orMet_ = false, + bool andParent_ = false) : node(node_), direction(direction_), orMet(orMet_), andParent(andParent_), localset({{}, {}}) { } @@ -274,8 +275,7 @@ void deleteOneNode(execplan::ParseTree** node) #if debug_rewrites std::cerr << " Deleting: " << (*node)->data() << " " << boost::core::demangle(typeid(**node).name()) - << " " - << "ptr: " << *node << std::endl; + << " " << "ptr: " << *node << std::endl; #endif delete *node; @@ -397,7 +397,8 @@ void removeFromTreeIterative(execplan::ParseTree** root, const CommonContainer& } // namespace details -void dumpTreeFiles(execplan::ParseTree* filters, const std::string& name, std::string dumpfolder = {}) +void dumpTreeFiles([[maybe_unused]] execplan::ParseTree* filters, [[maybe_unused]] const std::string& name, + [[maybe_unused]] std::string dumpfolder = {}) { #if debug_rewrites messageqcpp::ByteStream beforetree; @@ -484,17 +485,18 @@ bool NodeSemanticComparator::operator()(execplan::ParseTree* left, execplan::Par return left->data()->data() < right->data()->data(); } - bool checkFiltersLimit(execplan::ParseTree* tree, uint64_t limit) { uint64_t maxLimit = 0; - auto walker = [](const execplan::ParseTree* node, void* maxLimit){ + auto walker = [](const execplan::ParseTree* node, void* maxLimit) + { auto maybe_cf = dynamic_cast(node->data()); - if (maybe_cf != nullptr && (maybe_cf->op()->op() == OpType::OP_OR || maybe_cf->op()->op() == OpType::OP_IN)) - { - *((uint64_t*)maxLimit) = std::max(maybe_cf->filterList().size(), *((uint64_t*)maxLimit)); - } - }; + if (maybe_cf != nullptr && + (maybe_cf->op()->op() == OpType::OP_OR || maybe_cf->op()->op() == OpType::OP_IN)) + { + *((uint64_t*)maxLimit) = std::max(maybe_cf->filterList().size(), *((uint64_t*)maxLimit)); + } + }; tree->walk(walker, &maxLimit); return maxLimit <= limit; } diff --git a/dbcon/execplan/sessionmanager.cpp b/dbcon/execplan/sessionmanager.cpp index c9289fff0..e85af3728 100644 --- a/dbcon/execplan/sessionmanager.cpp +++ b/dbcon/execplan/sessionmanager.cpp @@ -49,7 +49,7 @@ SessionManager::SessionManager() txnidFilename = conf->getConfig("SessionManager", "TxnIDFile"); } -SessionManager::SessionManager(bool nolock) +SessionManager::SessionManager(bool /*nolock*/) { config::Config* conf; string stmp; diff --git a/dbcon/execplan/treenode.h b/dbcon/execplan/treenode.h index fc74cf0e3..3fac9428c 100644 --- a/dbcon/execplan/treenode.h +++ b/dbcon/execplan/treenode.h @@ -267,18 +267,18 @@ class TreeNode /*********************************************************************** * F&E framework * ***********************************************************************/ - virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) + virtual const utils::NullString& getStrVal(rowgroup::Row& /*row*/, bool& isNull) { isNull = isNull || fResult.strVal .isNull(); // XXX: NullString returns isNull, we should remove that parameter altogether. return fResult.strVal; } - virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) + virtual int64_t getIntVal(rowgroup::Row& /*row*/, bool& /*isNull*/) { return fResult.intVal; } - virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) + virtual uint64_t getUintVal(rowgroup::Row& /*row*/, bool& /*isNull*/) { return fResult.uintVal; } @@ -294,43 +294,43 @@ class TreeNode int64_t val = getIntVal(row, isNull); return datatypes::TSInt64Null(val, isNull); } - virtual float getFloatVal(rowgroup::Row& row, bool& isNull) + virtual float getFloatVal(rowgroup::Row& /*row*/, bool& /*isNull*/) { return fResult.floatVal; } - virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) + virtual double getDoubleVal(rowgroup::Row& /*row*/, bool& /*isNull*/) { return fResult.doubleVal; } - virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) + virtual long double getLongDoubleVal(rowgroup::Row& /*row*/, bool& /*isNull*/) { return fResult.longDoubleVal; } - virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) + virtual IDB_Decimal getDecimalVal(rowgroup::Row& /*row*/, bool& /*isNull*/) { return fResult.decimalVal; } - virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) + virtual bool getBoolVal(rowgroup::Row& /*row*/, bool& /*isNull*/) { return fResult.boolVal; } - virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) + virtual int32_t getDateIntVal(rowgroup::Row& /*row*/, bool& /*isNull*/) { return fResult.intVal; } - virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) + virtual int64_t getDatetimeIntVal(rowgroup::Row& /*row*/, bool& /*isNull*/) { return fResult.intVal; } - virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) + virtual int64_t getTimestampIntVal(rowgroup::Row& /*row*/, bool& /*isNull*/) { return fResult.intVal; } - virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) + virtual int64_t getTimeIntVal(rowgroup::Row& /*row*/, bool& /*isNull*/) { return fResult.intVal; } - virtual void evaluate(rowgroup::Row& row, bool& isNull) + virtual void evaluate(rowgroup::Row& /*row*/, bool& /*isNull*/) { } diff --git a/dbcon/execplan/windowfunctioncolumn.h b/dbcon/execplan/windowfunctioncolumn.h index 213ba0abb..0aa9aee85 100644 --- a/dbcon/execplan/windowfunctioncolumn.h +++ b/dbcon/execplan/windowfunctioncolumn.h @@ -168,12 +168,12 @@ class WindowFunctionColumn : public ReturnedColumn WF_OrderBy fOrderBy; /// order by clause // not support for window functions for now. - bool operator==(const TreeNode* t) const override + bool operator==(const TreeNode* /*t*/) const override { return false; } bool operator==(const WindowFunctionColumn& t) const; - bool operator!=(const TreeNode* t) const override + bool operator!=(const TreeNode* /*t*/) const override { return false; } diff --git a/dbcon/joblist/crossenginestep.h b/dbcon/joblist/crossenginestep.h index bab32aa18..f8a1c465a 100644 --- a/dbcon/joblist/crossenginestep.h +++ b/dbcon/joblist/crossenginestep.h @@ -55,8 +55,7 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep public: /** @brief CrossEngineStep constructor */ - CrossEngineStep(const std::string& schema, const std::string& table, - const execplan::Partitions& partitions, + CrossEngineStep(const std::string& schema, const std::string& table, const execplan::Partitions& partitions, const std::string& alias, const JobInfo& jobInfo); /** @brief CrossEngineStep destructor @@ -89,29 +88,29 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep return 1; } void setBPP(JobStep* jobStep) override; - void setFirstStepType(PrimitiveStepType firstStepType) override + void setFirstStepType(PrimitiveStepType /*firstStepType*/) override { } void setIsProjectionOnly() override { } - void setLastTupleId(uint64_t id) override + void setLastTupleId(uint64_t /*id*/) override { } - void setOutputType(BPSOutputType outputType) override + void setOutputType(BPSOutputType /*outputType*/) override { } - void setProjectBPP(JobStep* jobStep1, JobStep* jobStep2) override; + void setProjectBPP(JobStep* /*jobStep1*/, JobStep* /*jobStep2*/) override; void setStepCount() override { } - void setSwallowRows(const bool swallowRows) override + void setSwallowRows(const bool /*swallowRows*/) override { } void setBppStep() override { } - void dec(DistributedEngineComm* dec) override + void dec(DistributedEngineComm* /*dec*/) override { } const OIDVector& getProjectOids() const override @@ -146,7 +145,7 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep { return fAlias; } - void setJobInfo(const JobInfo* jobInfo) override + void setJobInfo(const JobInfo* /*jobInfo*/) override { } void setOutputRowGroup(const rowgroup::RowGroup&) override; diff --git a/dbcon/joblist/datalist.h b/dbcon/joblist/datalist.h index 6c1b253d4..c51ec85a5 100644 --- a/dbcon/joblist/datalist.h +++ b/dbcon/joblist/datalist.h @@ -105,7 +105,7 @@ class DataList { return 0; } - virtual bool totalDiskIoTime(uint64_t& w, uint64_t& r) + virtual bool totalDiskIoTime(uint64_t& /*w*/, uint64_t& /*r*/) { return false; } diff --git a/dbcon/joblist/dictstep-jl.cpp b/dbcon/joblist/dictstep-jl.cpp index 86f6f4340..e01b58567 100644 --- a/dbcon/joblist/dictstep-jl.cpp +++ b/dbcon/joblist/dictstep-jl.cpp @@ -49,14 +49,14 @@ DictStepJL::DictStepJL(const pDictionaryStep& dict) hasEqFilter = dict.hasEqualityFilter; - if (hasEqFilter && dict.eqFilter.size()> USEEQFILTERTHRESHOLD) + if (hasEqFilter && dict.eqFilter.size() > USEEQFILTERTHRESHOLD) { eqOp = dict.tmpCOP; eqFilter = dict.eqFilter; } else { - hasEqFilter=false; + hasEqFilter = false; filterString = dict.fFilterString; } filterCount = dict.fFilterCount; @@ -67,7 +67,7 @@ DictStepJL::~DictStepJL() { } -void DictStepJL::setLBID(uint64_t token, uint32_t dbroot) +void DictStepJL::setLBID(uint64_t /*token*/, uint32_t /*dbroot*/) { // lbid = token >> 10; // the lbid is calculated on the PM } @@ -94,7 +94,7 @@ void DictStepJL::createCommand(ByteStream& bs) const CommandJL::createCommand(bs); } -void DictStepJL::runCommand(ByteStream& bs) const +void DictStepJL::runCommand(ByteStream& /*bs*/) const { } @@ -133,7 +133,8 @@ messageqcpp::ByteStream DictStepJL::reencodedFilterString() const for (uint32_t i = 0; i < filterCount; i++) { uint8_t roundFlag = 0; - int64_t encodedPrefix = encodeStringPrefix((unsigned char*)eqFilter[i].c_str(), eqFilter[i].size(), charsetNumber); + int64_t encodedPrefix = + encodeStringPrefix((unsigned char*)eqFilter[i].c_str(), eqFilter[i].size(), charsetNumber); bs << eqOp; bs << roundFlag; bs << encodedPrefix; diff --git a/dbcon/joblist/distributedenginecomm.cpp b/dbcon/joblist/distributedenginecomm.cpp index 69b5e4620..da3a9b2d3 100644 --- a/dbcon/joblist/distributedenginecomm.cpp +++ b/dbcon/joblist/distributedenginecomm.cpp @@ -1053,7 +1053,7 @@ void DistributedEngineComm::pushToTheLocalQueueAndNotifyRecv(const messageqcpp:: // SBS is cleared when it is sent to PP at the same host. This fact forces any // code uses ::writeToClient to send to a local node in the last turn. int DistributedEngineComm::writeToClient(size_t aPMIndex, const SBS& bs, uint32_t senderUniqueID, - bool doInterleaving) + bool /*doInterleaving*/) { MessageQueueMap::iterator it; // Keep mqe's stats from being freed early diff --git a/dbcon/joblist/elementcompression.h b/dbcon/joblist/elementcompression.h index 189ff1230..dca5f3dbe 100644 --- a/dbcon/joblist/elementcompression.h +++ b/dbcon/joblist/elementcompression.h @@ -83,74 +83,74 @@ class ElementCompression // template static void compress(std::vector& vIn, std::vector& vOut); - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of ElementType to 32RidOnly not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of StringElementType to 64/32 not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of StringElementType to 32/64 not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of StringElementType to 32/32 not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of StringElementType to 32RidOnly not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of DoubleElementType to 64/32 not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of DoubleElementType to 32/64 not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of DoubleElementType to 32/32 not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of DoubleElementType to 32RidOnly not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of RIDElementType to 64/32 not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of RIDElementType to 32/64 not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of RIDElementType to 32/32 not supported"); } - static void compress(std::vector& vIn, std::vector& vOut); + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/); - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of TupleType to 64/32 not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of TupleType to 32/64 not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { throw std::logic_error("Compression of TupleType to 32/32 not supported"); } - static void compress(std::vector& vIn, std::vector& vOut) + static void compress(std::vector& /*vIn*/, std::vector& /*vOut*/) { - throw std::logic_error("Compression of TupleType to 32/32 not supported"); + throw std::logic_error("Compression of TupleType to 32RidOnly not supported"); } // @@ -158,72 +158,72 @@ class ElementCompression // template static void expand(std::vector& vIn, ElementType* vOut); - static void expand(std::vector& vIn, ElementType* vOut) + static void expand(std::vector& /*vIn*/, ElementType* /*vOut*/) { throw std::logic_error("Expansion to ElementType from 32RidOnly not supported"); } - static void expand(std::vector& vIn, StringElementType* vOut) + static void expand(std::vector& /*vIn*/, StringElementType* /*vOut*/) { throw std::logic_error("Expansion to StringElementType from 64/32 not supported"); } - static void expand(std::vector& vIn, StringElementType* vOut) + static void expand(std::vector& /*vIn*/, StringElementType* /*vOut*/) { throw std::logic_error("Expansion to StringElementType from 32/64 not supported"); } - static void expand(std::vector& vIn, StringElementType* vOut) + static void expand(std::vector& /*vIn*/, StringElementType* /*vOut*/) { throw std::logic_error("Expansion to StringElementType from 32/32 not supported"); } - static void expand(std::vector& vIn, StringElementType* vOut) + static void expand(std::vector& /*vIn*/, StringElementType* /*vOut*/) { throw std::logic_error("Expansion to StringElementType from 32RidOnly not supported"); } - static void expand(std::vector& vIn, DoubleElementType* vOut) + static void expand(std::vector& /*vIn*/, DoubleElementType* /*vOut*/) { throw std::logic_error("Expansion to DoubleElementType from 64/32 not supported"); } - static void expand(std::vector& vIn, DoubleElementType* vOut) + static void expand(std::vector& /*vIn*/, DoubleElementType* /*vOut*/) { throw std::logic_error("Expansion to DoubleElementType from 32/64 not supported"); } - static void expand(std::vector& vIn, DoubleElementType* vOut) + static void expand(std::vector& /*vIn*/, DoubleElementType* /*vOut*/) { throw std::logic_error("Expansion to DoubleElementType from 32/32 not supported"); } - static void expand(std::vector& vIn, DoubleElementType* vOut) + static void expand(std::vector& /*vIn*/, DoubleElementType* /*vOut*/) { throw std::logic_error("Expansion to DoubleElementType from 32RidOnly not supported"); } - static void expand(std::vector& vIn, RIDElementType* vOut) + static void expand(std::vector& /*vIn*/, RIDElementType* /*vOut*/) { throw std::logic_error("Expansion to RIDElementType from 64/32 not supported"); } - static void expand(std::vector& vIn, RIDElementType* vOut) + static void expand(std::vector& /*vIn*/, RIDElementType* /*vOut*/) { throw std::logic_error("Expansion to RIDElementType from 32/64 not supported"); } - static void expand(std::vector& vIn, RIDElementType* vOut) + static void expand(std::vector& /*vIn*/, RIDElementType* /*vOut*/) { throw std::logic_error("Expansion to RIDElementType from 32/32 not supported"); } - static void expand(std::vector& vIn, RIDElementType* vOut); + static void expand(std::vector& /*vIn*/, RIDElementType* /*vOut*/); - static void expand(std::vector& vIn, TupleType* vOut) + static void expand(std::vector& /*vIn*/, TupleType* /*vOut*/) { throw std::logic_error("Expansion to TupleType from 64/32 not supported"); } - static void expand(std::vector& vIn, TupleType* vOut) + static void expand(std::vector& /*vIn*/, TupleType* /*vOut*/) { throw std::logic_error("Expansion to TupleType from 32/64 not supported"); } - static void expand(std::vector& vIn, TupleType* vOut) + static void expand(std::vector& /*vIn*/, TupleType* /*vOut*/) { throw std::logic_error("Expansion to TupleType from 32/32 not supported"); } - static void expand(std::vector& vIn, TupleType* vOut) + static void expand(std::vector& /*vIn*/, TupleType* /*vOut*/) { throw std::logic_error("Expansion to TupleType from 32/32 not supported"); } @@ -232,13 +232,13 @@ class ElementCompression //...Utilities to write a single element with a compressed 32 bit RID. // static void writeWith32Rid(const ElementType& e, std::fstream& fFile); - static void writeWith32Rid(const DoubleElementType& e, std::fstream& fFile) + static void writeWith32Rid(const DoubleElementType& /*e*/, std::fstream& /*fFile*/) { throw std::logic_error("Compress/Write of 32 RID DoubleElementType not supported"); } static void writeWith32Rid(const StringElementType& e, std::fstream& fFile); static void writeWith32Rid(const RIDElementType& e, std::fstream& fFile); - static void writeWith32Rid(const TupleType& e, std::fstream& fFile) + static void writeWith32Rid(const TupleType& /*e*/, std::fstream& /*fFile*/) { throw std::logic_error("Compress/Write of 32 RID TupleType not supported"); } @@ -247,13 +247,13 @@ class ElementCompression //...Utilities to read a single element with a compressed 32 bit RID. // static void readWith32Rid(ElementType& e, std::fstream& fFile); - static void readWith32Rid(DoubleElementType& e, std::fstream& fFile) + static void readWith32Rid(DoubleElementType& /*e*/, std::fstream& /*fFile*/) { throw std::logic_error("Read/Expand of 32 RID DoubleElementType not supported"); } static void readWith32Rid(StringElementType& e, std::fstream& fFile); static void readWith32Rid(RIDElementType& e, std::fstream& fFile); - static void readWith32Rid(TupleType& e, std::fstream& fFile) + static void readWith32Rid(TupleType& /*e*/, std::fstream& /*fFile*/) { throw std::logic_error("Read/Expand of 32 RID TupleType not supported"); } @@ -404,7 +404,6 @@ template fFile.read(d, dlen); e.second.assign((const uint8_t*)d, dlen); } - } /* static */ inline void ElementCompression::readWith32Rid(RIDElementType& e, std::fstream& fFile) diff --git a/dbcon/joblist/elementtype.cpp b/dbcon/joblist/elementtype.cpp index bc6513b82..0a1f336e4 100644 --- a/dbcon/joblist/elementtype.cpp +++ b/dbcon/joblist/elementtype.cpp @@ -66,11 +66,11 @@ ostream& operator<<(ostream& out, const ElementType& rhs) static ostream& writeRid(std::ostream& out, const uint64_t& rhs) { - out.write((const char*) (&rhs), sizeof(rhs)); + out.write((const char*)(&rhs), sizeof(rhs)); return out; } -std::istream& operator >>(std::istream& in, utils::NullString& ns) +std::istream& operator>>(std::istream& in, utils::NullString& ns) { uint8_t isNull; in.read((char*)(&isNull), sizeof(isNull)); @@ -89,7 +89,7 @@ std::istream& operator >>(std::istream& in, utils::NullString& ns) return in; } -std::ostream& operator <<(std::ostream& out, const utils::NullString& ns) +std::ostream& operator<<(std::ostream& out, const utils::NullString& ns) { uint8_t isNull = ns.isNull(); out.write((char*)(&isNull), sizeof(isNull)); @@ -103,8 +103,8 @@ std::ostream& operator <<(std::ostream& out, const utils::NullString& ns) return out; } -// XXX: somewhat hacky. there's an operator with unknown/unneccessarily complex semantics, so I invented mine's, with -// slightly different types. +// XXX: somewhat hacky. there's an operator with unknown/unneccessarily complex semantics, so I invented +// mine's, with slightly different types. static istream& readRid(std::istream& in, uint64_t& rhs) { in.read((char*)(&rhs), sizeof(rhs)); @@ -173,12 +173,12 @@ ostream& operator<<(ostream& os, const RIDElementType& dl) return os; } -istream& operator>>(istream& is, TupleType& dl) +istream& operator>>(istream& /*is*/, TupleType& /*dl*/) { throw std::logic_error("TupleType >> not implemented"); } -ostream& operator<<(ostream& os, const TupleType& dl) +ostream& operator<<(ostream& /*os*/, const TupleType& /*dl*/) { throw std::logic_error("TupleType << not implemented"); } diff --git a/dbcon/joblist/elementtype.h b/dbcon/joblist/elementtype.h index 2033728df..7987498a7 100644 --- a/dbcon/joblist/elementtype.h +++ b/dbcon/joblist/elementtype.h @@ -170,7 +170,7 @@ struct RIDElementType RIDElementType(); explicit RIDElementType(uint64_t f); - const char* getHashString(uint64_t mode, uint64_t* len) const + const char* getHashString(uint64_t /*mode*/, uint64_t* len) const { *len = 8; return (char*)&first; @@ -211,7 +211,7 @@ struct TupleType * @note params mode and len are ignored here. they are carried * just to keep a consistent interface with the other element type */ - const char* getHashString(uint64_t mode, uint64_t* len) const + const char* getHashString(uint64_t /*mode*/, uint64_t* /*len*/) const { return (char*)second; } @@ -404,7 +404,6 @@ class AnyDataList AnyDataList(const AnyDataList& rhs) = delete; AnyDataList& operator=(const AnyDataList& rhs) = delete; boost::shared_ptr fDatalist; - bool fDisown; }; /** @brief type AnyDataListSPtr diff --git a/dbcon/joblist/expressionstep.h b/dbcon/joblist/expressionstep.h index 2c05f3a90..bf160d41d 100644 --- a/dbcon/joblist/expressionstep.h +++ b/dbcon/joblist/expressionstep.h @@ -76,7 +76,7 @@ class ExpressionStep : public JobStep return fViews.empty() ? "" : fViews.front(); } using JobStep::partitions; - execplan::Partitions partitions() const + execplan::Partitions partitions() const override { return fPartitions; } diff --git a/dbcon/joblist/fifo.h b/dbcon/joblist/fifo.h index 8d9e0a0dd..e9f1c9bea 100644 --- a/dbcon/joblist/fifo.h +++ b/dbcon/joblist/fifo.h @@ -167,9 +167,11 @@ class FIFO : public DataListImpl, element_t> uint64_t blockedInsertWriteCount; uint64_t blockedNextReadCount; - FIFO& operator=(const FIFO&); - FIFO(const FIFO&); - FIFO(); + FIFO& operator=(const FIFO&) = delete; + FIFO(const FIFO&) = delete; + FIFO& operator=(FIFO&&) = delete; + FIFO(FIFO&&) = delete; + FIFO() = delete; void signalPs(); bool swapBuffers(bool waitIfBlocked = true); @@ -207,24 +209,6 @@ FIFO::FIFO(uint32_t con, uint32_t max) : DataListImpl -FIFO::FIFO() -{ - throw std::logic_error("don't use FIFO()"); -} - -template -FIFO::FIFO(const FIFO& f) -{ - throw std::logic_error("don't use FIFO(FIFO &)"); -} - -template -FIFO& FIFO::operator=(const FIFO& f) -{ - throw std::logic_error("don't use FIFO:: ="); -} - template FIFO::~FIFO() { diff --git a/dbcon/joblist/filtercommand-jl.cpp b/dbcon/joblist/filtercommand-jl.cpp index f7c4ce73a..da01c8c3e 100644 --- a/dbcon/joblist/filtercommand-jl.cpp +++ b/dbcon/joblist/filtercommand-jl.cpp @@ -38,7 +38,7 @@ FilterCommandJL::~FilterCommandJL() { } -void FilterCommandJL::setLBID(uint64_t rid, uint32_t dbroot) +void FilterCommandJL::setLBID(uint64_t /*rid*/, uint32_t /*dbroot*/) { } @@ -67,7 +67,7 @@ void FilterCommandJL::createCommand(ByteStream& bs) const CommandJL::createCommand(bs); } -void FilterCommandJL::runCommand(ByteStream& bs) const +void FilterCommandJL::runCommand(ByteStream& /*bs*/) const { } diff --git a/dbcon/joblist/jlf_common.cpp b/dbcon/joblist/jlf_common.cpp index 5fb8f4067..7f3726575 100644 --- a/dbcon/joblist/jlf_common.cpp +++ b/dbcon/joblist/jlf_common.cpp @@ -44,9 +44,8 @@ namespace // @brief Returns unique key for a column, table, or expresssion. uint32_t uniqTupleKey(JobInfo& jobInfo, CalpontSystemCatalog::OID& o, CalpontSystemCatalog::OID& t, const string& cn, const string& ca, const string& tn, const string& ta, - const string& sn, const string& vw, const execplan::Partitions& pa, - uint32_t pi, uint64_t en, - bool correlated = false) + const string& sn, const string& vw, const execplan::Partitions& pa, uint32_t pi, + uint64_t en, bool correlated = false) { uint64_t subId = jobInfo.subId; @@ -159,13 +158,12 @@ TupleInfo setTupleInfo_(const CalpontSystemCatalog::ColType& ct, CalpontSystemCa JobInfo& jobInfo, CalpontSystemCatalog::OID tbl_oid, const string& col_name, const string& col_alias, const string& sch_name, const string& tbl_name, const string& tbl_alias, const string& vw_name, - const execplan::Partitions& partitions, - bool correlated = false, - uint32_t pc_id = 0, uint64_t engine = 0) + const execplan::Partitions& partitions, bool correlated = false, uint32_t pc_id = 0, + uint64_t engine = 0) { // get the unique tupleOids for this column - uint32_t tbl_key = uniqTupleKey(jobInfo, tbl_oid, tbl_oid, "", "", tbl_name, tbl_alias, sch_name, vw_name, partitions, - 0, engine, correlated); + uint32_t tbl_key = uniqTupleKey(jobInfo, tbl_oid, tbl_oid, "", "", tbl_name, tbl_alias, sch_name, vw_name, + partitions, 0, engine, correlated); uint32_t col_key = uniqTupleKey(jobInfo, col_oid, tbl_oid, col_name, col_alias, tbl_name, tbl_alias, sch_name, vw_name, partitions, pc_id, engine, correlated); // If this is the first time we've seen this col, add it to the tim @@ -197,8 +195,8 @@ TupleInfo setTupleInfo_(const CalpontSystemCatalog::ColType& ct, CalpontSystemCa uint32_t getTupleKey_(const JobInfo& jobInfo, CalpontSystemCatalog::OID oid, const string& colName, const string& tblAlias, const string& schema, const string& view, - const execplan::Partitions& part, - bool correlated = false, uint32_t pseudo = 0, uint64_t engine = 0) + const execplan::Partitions& part, bool correlated = false, uint32_t pseudo = 0, + uint64_t /*engine*/ = 0) { uint64_t subId = jobInfo.subId; @@ -289,9 +287,7 @@ string UniqId::toString() const strstm << dlm << p; dlm = ","; } - strstm << "):" - << fPseudo << ":" - << (int64_t)fSubId; + strstm << "):" << fPseudo << ":" << (int64_t)fSubId; return strstm.str(); } @@ -410,7 +406,7 @@ uint32_t getTupleKey(JobInfo& jobInfo, const execplan::SimpleColumn* sc, bool ad // TupleInfo is expected to be set already return getTupleKey_(jobInfo, sc->oid(), sc->columnName(), extractTableAlias(sc), sc->schemaName(), sc->viewName(), execplan::Partitions(), - ((sc->joinInfo() & execplan::JOIN_CORRELATED) != 0), pseudoType, + ((sc->joinInfo() & execplan::JOIN_CORRELATED) != 0), pseudoType, (sc->isColumnStore() ? 0 : 1)); } @@ -492,7 +488,7 @@ uint32_t getTupleKey(JobInfo& jobInfo, const SRCP& srcp, bool add) uint32_t getTableKey(const JobInfo& jobInfo, execplan::CalpontSystemCatalog::OID tableOid, const string& alias, const string& schema, const string& view, - const execplan::Partitions& part) + const execplan::Partitions& part) { return getTupleKey_(jobInfo, tableOid, "", alias, schema, view, part); } @@ -582,7 +578,8 @@ TupleInfo setExpTupleInfo(const execplan::CalpontSystemCatalog::ColType& ct, uin if (!(ji->subAlias.empty())) expAlias += ji->subAlias; - return setTupleInfo_(ct, expressionId, jobInfo, CNX_EXP_TABLE_ID, "", alias, "", "$exp", expAlias, "", execplan::Partitions(), cr); + return setTupleInfo_(ct, expressionId, jobInfo, CNX_EXP_TABLE_ID, "", alias, "", "$exp", expAlias, "", + execplan::Partitions(), cr); } TupleInfo setExpTupleInfo(const execplan::ReturnedColumn* rc, JobInfo& jobInfo) diff --git a/dbcon/joblist/jlf_execplantojoblist.cpp b/dbcon/joblist/jlf_execplantojoblist.cpp index 8d4764c70..91d8d8afc 100644 --- a/dbcon/joblist/jlf_execplantojoblist.cpp +++ b/dbcon/joblist/jlf_execplantojoblist.cpp @@ -306,14 +306,10 @@ void convertValueNum(const string& str, const CalpontSystemCatalog::ColType& ct, case CalpontSystemCatalog::USMALLINT: v = boost::any_cast(anyVal); break; case CalpontSystemCatalog::MEDINT: - case CalpontSystemCatalog::INT: - v = boost::any_cast(anyVal); - break; + case CalpontSystemCatalog::INT: v = boost::any_cast(anyVal); break; case CalpontSystemCatalog::UMEDINT: - case CalpontSystemCatalog::UINT: - v = boost::any_cast(anyVal); - break; + case CalpontSystemCatalog::UINT: v = boost::any_cast(anyVal); break; case CalpontSystemCatalog::BIGINT: v = boost::any_cast(anyVal); break; @@ -772,7 +768,6 @@ const JobStepVector doColFilter(const SimpleColumn* sc1, const SimpleColumn* sc2 // data list for column 1 step 1 (pcolstep) output AnyDataListSPtr spdl11(new AnyDataList()); - JobStepAssociation outJs1; outJs1.outAdd(spdl11); pcs1->outputAssociation(outJs1); @@ -833,7 +828,6 @@ const JobStepVector doColFilter(const SimpleColumn* sc1, const SimpleColumn* sc2 // data list for column 1 step 1 (pcolstep) output AnyDataListSPtr spdl11(new AnyDataList()); - JobStepAssociation outJs1; outJs1.outAdd(spdl11); pcs1->outputAssociation(outJs1); @@ -1815,7 +1809,8 @@ const JobStepVector doSimpleFilter(SimpleFilter* sf, JobInfo& jobInfo) } if (cc->isNull() && (opis == *sop || opisnull == *sop)) - jobInfo.tableHasIsNull.insert(getTableKey(jobInfo, tbl_oid, alias, sc->schemaName(), view, sc->partitions())); + jobInfo.tableHasIsNull.insert( + getTableKey(jobInfo, tbl_oid, alias, sc->schemaName(), view, sc->partitions())); } else { @@ -2045,11 +2040,11 @@ const JobStepVector doOuterJoinOnFilter(OuterJoinOnFilter* oj, JobInfo& jobInfo) // @bug3037, workaround on join order, wish this can be corrected soon, // cascade outer table attribute. CalpontSystemCatalog::OID tableOid1 = tableOid(sc1, jobInfo.csc); - uint64_t tid1 = - getTableKey(jobInfo, tableOid1, sc1->tableAlias(), sc1->schemaName(), sc1->viewName(), sc1->partitions()); + uint64_t tid1 = getTableKey(jobInfo, tableOid1, sc1->tableAlias(), sc1->schemaName(), sc1->viewName(), + sc1->partitions()); CalpontSystemCatalog::OID tableOid2 = tableOid(sc2, jobInfo.csc); - uint64_t tid2 = - getTableKey(jobInfo, tableOid2, sc2->tableAlias(), sc2->schemaName(), sc2->viewName(), sc2->partitions()); + uint64_t tid2 = getTableKey(jobInfo, tableOid2, sc2->tableAlias(), sc2->schemaName(), sc2->viewName(), + sc2->partitions()); if (tablesInOuter.find(tid1) != tablesInOuter.end()) sc1->returnAll(true); @@ -2196,7 +2191,8 @@ const JobStepVector doOuterJoinOnFilter(OuterJoinOnFilter* oj, JobInfo& jobInfo) if (sc != NULL) { CalpontSystemCatalog::OID tblOid = tableOid(sc, jobInfo.csc); - uint64_t tid = getTableKey(jobInfo, tblOid, sc->tableAlias(), sc->schemaName(), sc->viewName(), sc->partitions()); + uint64_t tid = getTableKey(jobInfo, tblOid, sc->tableAlias(), sc->schemaName(), sc->viewName(), + sc->partitions()); // skip outer table filters or table not directly involved in the outer join if (tablesInOuter.find(tid) != tablesInOuter.end() || tablesInJoin.find(tid) == tablesInJoin.end()) @@ -2427,7 +2423,7 @@ bool tryCombineDictionary(JobStepVector& jsv1, JobStepVector& jsv2, int8_t bop) return false; } -bool tryCombineDictionaryScan(JobStepVector& jsv1, JobStepVector& jsv2, int8_t bop) +bool tryCombineDictionaryScan(JobStepVector& /*jsv1*/, JobStepVector& /*jsv2*/, int8_t /*bop*/) { // disable dictionary scan -- bug3321 #if 0 diff --git a/dbcon/joblist/jlf_tuplejoblist.cpp b/dbcon/joblist/jlf_tuplejoblist.cpp index 653734332..96add786b 100644 --- a/dbcon/joblist/jlf_tuplejoblist.cpp +++ b/dbcon/joblist/jlf_tuplejoblist.cpp @@ -25,8 +25,8 @@ #include #include #include -//#define NDEBUG -//#include +// #define NDEBUG +// #include #include #include #include @@ -300,7 +300,7 @@ void constructJoinedRowGroup(RowGroup& rg, set& tableSet, TableInfoMap rg = tmpRg; } -void updateExp2Cols(JobStepVector& expSteps, TableInfoMap& tableInfoMap, JobInfo& jobInfo) +void updateExp2Cols(JobStepVector& expSteps, TableInfoMap& tableInfoMap, JobInfo& /*jobInfo*/) { for (JobStepVector::iterator it = expSteps.begin(); it != expSteps.end(); it++) { @@ -817,7 +817,8 @@ void addExpresssionStepsToBps(TableInfoMap::iterator& mit, SJSTEP& sjsp, JobInfo } else { - sjsp.reset(new CrossEngineStep(mit->second.fSchema, mit->second.fName, mit->second.fPartitions, mit->second.fAlias, jobInfo)); + sjsp.reset(new CrossEngineStep(mit->second.fSchema, mit->second.fName, mit->second.fPartitions, + mit->second.fAlias, jobInfo)); bps = dynamic_cast(sjsp.get()); } @@ -1003,8 +1004,8 @@ bool combineJobStepsByTable(TableInfoMap::iterator& mit, JobInfo& jobInfo) } else { - sjsp.reset( - new CrossEngineStep(mit->second.fSchema, mit->second.fName, mit->second.fPartitions, mit->second.fAlias, jobInfo)); + sjsp.reset(new CrossEngineStep(mit->second.fSchema, mit->second.fName, mit->second.fPartitions, + mit->second.fAlias, jobInfo)); bps = dynamic_cast(sjsp.get()); } } @@ -3407,8 +3408,9 @@ SP_JoinInfo joinToLargeTable(uint32_t large, TableInfoMap& tableInfoMap, JobInfo { if ((jointypes[i] & SEMI) || (jointypes[i] & ANTI) || (jointypes[i] & SCALAR)) { - uint32_t tid = getTableKey(jobInfo, smallSides[i]->fTableOid, smallSides[i]->fAlias, - smallSides[i]->fSchema, smallSides[i]->fView, smallSides[i]->fPartitions); + uint32_t tid = + getTableKey(jobInfo, smallSides[i]->fTableOid, smallSides[i]->fAlias, smallSides[i]->fSchema, + smallSides[i]->fView, smallSides[i]->fPartitions); correlateTables[tid] = i; correlateCompare[tid] = NULL; } @@ -4173,8 +4175,9 @@ void joinTablesInOrder(uint32_t largest, JobStepVector& joinSteps, TableInfoMap& { if ((jointypes[i] & SEMI) || (jointypes[i] & ANTI) || (jointypes[i] & SCALAR)) { - uint32_t tid = getTableKey(jobInfo, smallSides[i]->fTableOid, smallSides[i]->fAlias, - smallSides[i]->fSchema, smallSides[i]->fView, smallSides[i]->fPartitions); + uint32_t tid = + getTableKey(jobInfo, smallSides[i]->fTableOid, smallSides[i]->fAlias, smallSides[i]->fSchema, + smallSides[i]->fView, smallSides[i]->fPartitions); correlateTables[tid] = i; correlateCompare[tid] = NULL; } @@ -4413,7 +4416,7 @@ void associateTupleJobSteps(JobStepVector& querySteps, JobStepVector& projectSte const boost::shared_ptr& keyInfo = jobInfo.keyInfo; cout << "query steps:" << endl; - for (const auto& step: querySteps) + for (const auto& step : querySteps) { auto* thjs = dynamic_cast(step.get()); @@ -4436,7 +4439,7 @@ void associateTupleJobSteps(JobStepVector& querySteps, JobStepVector& projectSte cout << "project steps:" << endl; - for (const auto& prStep: projectSteps) + for (const auto& prStep : projectSteps) { cout << typeid(prStep.get()).name() << ": " << prStep->oid() << " " << prStep->tupleId() << " " << getTableKey(jobInfo, prStep->tupleId()) << endl; @@ -4444,7 +4447,7 @@ void associateTupleJobSteps(JobStepVector& querySteps, JobStepVector& projectSte cout << "delivery steps:" << endl; - for (const auto& [_, value]: deliverySteps) + for (const auto& [_, value] : deliverySteps) { cout << typeid(value.get()).name() << endl; } @@ -4606,7 +4609,7 @@ void associateTupleJobSteps(JobStepVector& querySteps, JobStepVector& projectSte // Make sure each query step has an output DL // This is necessary for toString() method on most steps - for (auto& step: steps) + for (auto& step : steps) { // if (dynamic_cast(it->get())) // continue; @@ -4798,7 +4801,7 @@ void associateTupleJobSteps(JobStepVector& querySteps, JobStepVector& projectSte bool tableInOuterQuery = false; set tableSet; // involved unique tables - for (unsigned int table: tables) + for (unsigned int table : tables) { if (find(jobInfo.tableList.begin(), jobInfo.tableList.end(), table) != jobInfo.tableList.end()) tableSet.insert(table); @@ -5039,7 +5042,7 @@ void associateTupleJobSteps(JobStepVector& querySteps, JobStepVector& projectSte joinTables(joinSteps, tableInfoMap, jobInfo, joinOrder, overrideLargeSideEstimate); // 3. put the steps together - for (uint32_t i: joinOrder) + for (uint32_t i : joinOrder) querySteps.insert(querySteps.end(), tableInfoMap[i].fQuerySteps.begin(), tableInfoMap[i].fQuerySteps.end()); diff --git a/dbcon/joblist/joblist.cpp b/dbcon/joblist/joblist.cpp index 93b0cdd3f..b902f5bf1 100644 --- a/dbcon/joblist/joblist.cpp +++ b/dbcon/joblist/joblist.cpp @@ -558,7 +558,7 @@ void JobList::querySummary(bool extendedStats) } // @bug 828. Added additional information to the graph at the end of execution -void JobList::graph(uint32_t sessionID) +void JobList::graph(uint32_t /*sessionID*/) { // Graphic view draw auto jsrname = jlf_graphics::generateDotFileName("jobstep_results."); diff --git a/dbcon/joblist/joblistfactory.cpp b/dbcon/joblist/joblistfactory.cpp index c76b497d6..d68119f8b 100644 --- a/dbcon/joblist/joblistfactory.cpp +++ b/dbcon/joblist/joblistfactory.cpp @@ -22,7 +22,7 @@ #include #include #include -//#define NDEBUG +// #define NDEBUG #include #include #include @@ -384,7 +384,6 @@ void checkHavingClause(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo) } } } - } void preProcessFunctionOnAggregation(const vector& scs, const vector& aggs, @@ -519,9 +518,9 @@ void checkGroupByCols(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo) // Not an aggregate column and not an expression of aggregation. if (dynamic_cast(orderByCols[i].get()) == NULL && orderByCols[i]->aggColumnList().empty()) - { + { csep->groupByCols().push_back(orderByCols[i]); - } + } } } } @@ -1132,7 +1131,9 @@ const JobStepVector doAggProject(const CalpontSelectExecutionPlan* csep, JobInfo it = pcv.insert(pcv.end(), srcp); auto placeToInsert = std::distance(pcv.begin(), it); - projectKeys.insert(projectKeys.begin() + std::min(placeToInsert, projectKeys.end() - projectKeys.begin()), tupleKey); + projectKeys.insert( + projectKeys.begin() + std::min(placeToInsert, projectKeys.end() - projectKeys.begin()), + tupleKey); } else if (doDistinct) // @bug4250, move forward distinct column if necessary. { @@ -1304,7 +1305,8 @@ const JobStepVector doAggProject(const CalpontSelectExecutionPlan* csep, JobInfo it = pcv.insert(pcv.end(), srcp); auto placeToInsert = std::distance(pcv.begin(), it); - projectKeys.insert(projectKeys.begin() + std::min(placeToInsert, projectKeys.end() - projectKeys.begin()), tupleKey); + projectKeys.insert( + projectKeys.begin() + std::min(placeToInsert, projectKeys.end() - projectKeys.begin()), tupleKey); } else if (doDistinct) // @bug4250, move forward distinct column if necessary. { @@ -1539,7 +1541,7 @@ void exceptionHandler(JobList* joblist, const JobInfo& jobInfo, const string& lo } void parseExecutionPlan(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo, JobStepVector& querySteps, - JobStepVector& projectSteps, DeliveredTableMap& deliverySteps) + JobStepVector& projectSteps, DeliveredTableMap& /*deliverySteps*/) { ParseTree* filters = csep->filters(); jobInfo.deliveredCols = csep->returnedCols(); @@ -1966,7 +1968,8 @@ void makeJobSteps(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo, JobStepVec else oid = 0; - uint32_t tableUid = makeTableKey(jobInfo, oid, it->table, it->alias, it->schema, it->view, it->partitions); + uint32_t tableUid = + makeTableKey(jobInfo, oid, it->table, it->alias, it->schema, it->view, it->partitions); jobInfo.tableList.push_back(tableUid); } @@ -2308,8 +2311,8 @@ namespace joblist { /* static */ SJLP JobListFactory::makeJobList(CalpontExecutionPlan* cplan, ResourceManager* rm, - const PrimitiveServerThreadPools& primitiveServerThreadPools, bool tryTuple, - bool isExeMgr) + const PrimitiveServerThreadPools& primitiveServerThreadPools, + bool /*tryTuple*/, bool isExeMgr) { SJLP ret; string emsg; diff --git a/dbcon/joblist/lbidlist.cpp b/dbcon/joblist/lbidlist.cpp index ac97e49af..5afe32135 100644 --- a/dbcon/joblist/lbidlist.cpp +++ b/dbcon/joblist/lbidlist.cpp @@ -144,7 +144,7 @@ LBIDList::~LBIDList() #endif } -void LBIDList::Dump(long Index, int Count) const +void LBIDList::Dump(long /*Index*/, int /*Count*/) const { LBIDRange LBIDR; @@ -422,8 +422,8 @@ void LBIDList::UpdateMinMax(T min, T max, int64_t lbid, bool dictScan, #ifdef DEBUG if (IS_VERBOSE) - cout << "UpdateMinMax() new Mn/Mx " << mmp->min << "/" << mmp->max << " " - << " lbid " << lbid << " seq " << mmp->seq << " valid " << mmp->isValid << endl; + cout << "UpdateMinMax() new Mn/Mx " << mmp->min << "/" << mmp->max << " " << " lbid " << lbid + << " seq " << mmp->seq << " valid " << mmp->isValid << endl; #endif return; @@ -929,4 +929,3 @@ template bool LBIDList::checkRangeOverlap(int64_t min, int64_t max, int const execplan::CalpontSystemCatalog::ColType& type); } // namespace joblist - diff --git a/dbcon/joblist/limitedorderby.cpp b/dbcon/joblist/limitedorderby.cpp index 5d9fe8c56..f22b2adab 100644 --- a/dbcon/joblist/limitedorderby.cpp +++ b/dbcon/joblist/limitedorderby.cpp @@ -18,7 +18,7 @@ // $Id: limitedorderby.cpp 9581 2013-05-31 13:46:14Z pleblanc $ #include -//#define NDEBUG +// #define NDEBUG #include #include using namespace std; @@ -196,7 +196,7 @@ void LimitedOrderBy::finalize() fDataQueue.push(fData); auto& orderByQueue = getQueue(); - + if (orderByQueue.size() > 0) { // *DRRTUY Very memory intensive. CS needs to account active diff --git a/dbcon/joblist/passthrucommand-jl.cpp b/dbcon/joblist/passthrucommand-jl.cpp index 84e63f9c5..9a8d6dbc5 100644 --- a/dbcon/joblist/passthrucommand-jl.cpp +++ b/dbcon/joblist/passthrucommand-jl.cpp @@ -76,7 +76,7 @@ PassThruCommandJL::~PassThruCommandJL() { } -void PassThruCommandJL::setLBID(uint64_t l, uint32_t dbroot) +void PassThruCommandJL::setLBID(uint64_t /*l*/, uint32_t /*dbroot*/) { } @@ -87,7 +87,7 @@ void PassThruCommandJL::createCommand(ByteStream& bs) const CommandJL::createCommand(bs); } -void PassThruCommandJL::runCommand(ByteStream& bs) const +void PassThruCommandJL::runCommand(ByteStream& /*bs*/) const { } diff --git a/dbcon/joblist/pdictionary.cpp b/dbcon/joblist/pdictionary.cpp index 7372a15ed..008b307ca 100644 --- a/dbcon/joblist/pdictionary.cpp +++ b/dbcon/joblist/pdictionary.cpp @@ -160,7 +160,7 @@ const string pDictionaryStep::toString() const return oss.str(); } -void pDictionaryStep::appendFilter(const messageqcpp::ByteStream& filter, unsigned count) +void pDictionaryStep::appendFilter(const messageqcpp::ByteStream& filter, unsigned /*count*/) { ByteStream bs(filter); // need to preserve the input BS uint8_t* buf; diff --git a/dbcon/joblist/resourcedistributor.h b/dbcon/joblist/resourcedistributor.h index 6a04bdbd1..45bbf8150 100644 --- a/dbcon/joblist/resourcedistributor.h +++ b/dbcon/joblist/resourcedistributor.h @@ -132,7 +132,6 @@ class ResourceDistributor std::string fJob; std::string fIdentity; uint64_t fTotalResource; - uint64_t fResourceBlock; boost::mutex fResourceLock; boost::condition fResourceAvailable; diff --git a/dbcon/joblist/rowestimator.cpp b/dbcon/joblist/rowestimator.cpp index 1b2b2f18a..57b7100ba 100644 --- a/dbcon/joblist/rowestimator.cpp +++ b/dbcon/joblist/rowestimator.cpp @@ -184,7 +184,7 @@ uint32_t RowEstimator::estimateDistinctValues(const execplan::CalpontSystemCatal // predicate against the given range. This function is used for estimating an individual operation such as // col1 = 2. template -float RowEstimator::estimateOpFactor(const T& min, const T& max, const T& value, char op, uint8_t lcf, +float RowEstimator::estimateOpFactor(const T& min, const T& max, const T& value, char op, uint8_t /*lcf*/, uint32_t distinctValues, char cpStatus, const execplan::CalpontSystemCatalog::ColType& ct) { @@ -263,7 +263,7 @@ float RowEstimator::estimateOpFactor(const T& min, const T& max, const T& value, float RowEstimator::estimateRowReturnFactor(const BRM::EMEntry& emEntry, const messageqcpp::ByteStream* bs, const uint16_t NOPS, const execplan::CalpontSystemCatalog::ColType& ct, - const uint8_t BOP, const uint32_t& rowsInExtent) + const uint8_t BOP, const uint32_t& /*rowsInExtent*/) { bool bIsUnsigned = datatypes::isUnsigned(ct.colDataType); float factor = 1.0; @@ -500,8 +500,8 @@ float RowEstimator::estimateRowReturnFactor(const BRM::EMEntry& emEntry, const m // This function returns the estimated row count for the entire TupleBPS. It samples the last 20 // (configurable) extents to calculate the estimate. uint64_t RowEstimator::estimateRows(const vector& cpColVec, - const std::vector& scanFlags, BRM::DBRM& dbrm, - const execplan::CalpontSystemCatalog::OID oid) + const std::vector& scanFlags, BRM::DBRM& /*dbrm*/, + const execplan::CalpontSystemCatalog::OID /*oid*/) { #if ROW_EST_DEBUG diff --git a/dbcon/joblist/rowestimator.h b/dbcon/joblist/rowestimator.h index 848029517..7bbf987ca 100644 --- a/dbcon/joblist/rowestimator.h +++ b/dbcon/joblist/rowestimator.h @@ -47,14 +47,7 @@ class RowEstimator public: /** @brief ctor */ - RowEstimator() - : fExtentsToSample(20) - , fIntDistinctAdjust(1) - , fDecDistinctAdjust(1) - , fChar1DistinctAdjust(1) - , fChar2Thru7DistinctAdjust(1) - , fDictDistinctAdjust(1) - , fDateDistinctAdjust(1) + RowEstimator() : fExtentsToSample(20) { } @@ -132,12 +125,6 @@ class RowEstimator // Configurables read from Columnstore.xml - future. uint32_t fExtentsToSample; - uint32_t fIntDistinctAdjust; - uint32_t fDecDistinctAdjust; - uint32_t fChar1DistinctAdjust; - uint32_t fChar2Thru7DistinctAdjust; - uint32_t fDictDistinctAdjust; - uint32_t fDateDistinctAdjust; static const uint32_t fRowsPerExtent = 8192 * 1024; static const uint32_t fBlockSize = 8192; // Block size in bytes. diff --git a/dbcon/joblist/tupleaggregatestep.cpp b/dbcon/joblist/tupleaggregatestep.cpp index b837e837e..541765854 100644 --- a/dbcon/joblist/tupleaggregatestep.cpp +++ b/dbcon/joblist/tupleaggregatestep.cpp @@ -2414,7 +2414,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(JobInfo& jobInfo, vector #include #include @@ -90,7 +90,7 @@ TupleConstantStep::~TupleConstantStep() { } -void TupleConstantStep::setOutputRowGroup(const rowgroup::RowGroup& rg) +void TupleConstantStep::setOutputRowGroup(const rowgroup::RowGroup& /*rg*/) { throw runtime_error("Disabled, use initialize() to set output RowGroup."); } @@ -278,7 +278,7 @@ void TupleConstantStep::constructContanstRow(const JobInfo& jobInfo) break; } } // switch - } // for constant columns + } // for constant columns } void TupleConstantStep::run() @@ -567,22 +567,15 @@ void TupleConstantStep::printCalTrace() void TupleConstantStep::formatMiniStats() { ostringstream oss; - oss << "TCS " - << "UM " - << "- " - << "- " - << "- " - << "- " - << "- " - << "- " << JSTimeStamp::tsdiffstr(dlTimes.EndOfInputTime(), dlTimes.FirstReadTime()) << " " - << fRowsReturned << " "; + oss << "TCS " << "UM " << "- " << "- " << "- " << "- " << "- " << "- " + << JSTimeStamp::tsdiffstr(dlTimes.EndOfInputTime(), dlTimes.FirstReadTime()) << " " << fRowsReturned + << " "; fMiniInfo += oss.str(); } // class TupleConstantOnlyStep TupleConstantOnlyStep::TupleConstantOnlyStep(const JobInfo& jobInfo) - : TupleConstantStep(jobInfo) - , fEmptySet(jobInfo.constantFalse) + : TupleConstantStep(jobInfo), fEmptySet(jobInfo.constantFalse) { // fExtendedInfo = "TCOS: "; } @@ -592,7 +585,7 @@ TupleConstantOnlyStep::~TupleConstantOnlyStep() } // void TupleConstantOnlyStep::initialize(const RowGroup& rgIn, const JobInfo& jobInfo) -void TupleConstantOnlyStep::initialize(const JobInfo& jobInfo, const rowgroup::RowGroup* rgIn) +void TupleConstantOnlyStep::initialize(const JobInfo& jobInfo, const rowgroup::RowGroup* /*rgIn*/) { vector oids; vector keys; diff --git a/dbcon/joblist/tupleconstantstep.h b/dbcon/joblist/tupleconstantstep.h index 44867057e..0c9ae9f63 100644 --- a/dbcon/joblist/tupleconstantstep.h +++ b/dbcon/joblist/tupleconstantstep.h @@ -180,10 +180,9 @@ class TupleConstantBooleanStep : public TupleConstantStep void fillInConstants() override { } - void constructContanstRow(const JobInfo& jobInfo) override + void constructContanstRow(const JobInfo& /*jobInfo*/) override { } - // boolean value bool fValue; }; diff --git a/dbcon/joblist/tuplehavingstep.cpp b/dbcon/joblist/tuplehavingstep.cpp index 7281988c6..87bf36b5d 100644 --- a/dbcon/joblist/tuplehavingstep.cpp +++ b/dbcon/joblist/tuplehavingstep.cpp @@ -17,7 +17,7 @@ // $Id: tuplehavingstep.cpp 9709 2013-07-20 06:08:46Z xlou $ -//#define NDEBUG +// #define NDEBUG #include #include #include @@ -73,7 +73,7 @@ TupleHavingStep::~TupleHavingStep() { } -void TupleHavingStep::setOutputRowGroup(const rowgroup::RowGroup& rg) +void TupleHavingStep::setOutputRowGroup(const rowgroup::RowGroup& /*rg*/) { throw runtime_error("Disabled, use initialize() to set output RowGroup."); } diff --git a/dbcon/joblist/windowfunctionstep.cpp b/dbcon/joblist/windowfunctionstep.cpp index da0410a2c..055ad29ad 100644 --- a/dbcon/joblist/windowfunctionstep.cpp +++ b/dbcon/joblist/windowfunctionstep.cpp @@ -239,7 +239,7 @@ uint32_t WindowFunctionStep::nextBand(messageqcpp::ByteStream& bs) return rowCount; } -void WindowFunctionStep::setOutputRowGroup(const RowGroup& rg) +void WindowFunctionStep::setOutputRowGroup(const RowGroup& /*rg*/) { idbassert(0); } @@ -1580,15 +1580,9 @@ void WindowFunctionStep::printCalTrace() void WindowFunctionStep::formatMiniStats() { ostringstream oss; - oss << "WFS " - << "UM " - << "- " - << "- " - << "- " - << "- " - << "- " - << "- " << JSTimeStamp::tsdiffstr(dlTimes.EndOfInputTime(), dlTimes.FirstReadTime()) << " " - << fRowsReturned << " "; + oss << "WFS " << "UM " << "- " << "- " << "- " << "- " << "- " << "- " + << JSTimeStamp::tsdiffstr(dlTimes.EndOfInputTime(), dlTimes.FirstReadTime()) << " " << fRowsReturned + << " "; fMiniInfo += oss.str(); } diff --git a/dbcon/mysql/ha_mcs.cpp b/dbcon/mysql/ha_mcs.cpp index b61dd88d9..655f6001d 100644 --- a/dbcon/mysql/ha_mcs.cpp +++ b/dbcon/mysql/ha_mcs.cpp @@ -21,7 +21,11 @@ #include #include "columnstoreversion.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include "ha_mcs_pushdown.h" +#pragma GCC diagnostic pop + #define NEED_CALPONT_EXTERNS #include "ha_mcs_impl.h" #include "is_columnstore.h" @@ -34,7 +38,7 @@ #define CACHE_PREFIX "#cache#" #ifdef HLINDEX_TEMPLATE /* it happens to be defined in the vector branch */ -#define HT(X) /* nothing */ +#define HT(X) /* nothing */ #else #define HT(X) X, #endif @@ -91,7 +95,7 @@ static const uchar* mcs_get_key(const void* share, size_t* length, my_bool not_u } // This one is unused -int mcs_discover(handlerton* hton, THD* thd, TABLE_SHARE* share) +int mcs_discover(handlerton* /*hton*/, THD* thd, TABLE_SHARE* share) { DBUG_ENTER("mcs_discover"); DBUG_PRINT("mcs_discover", ("db: '%s' name: '%s'", share->db.str, share->table_name.str)); @@ -118,7 +122,7 @@ int mcs_discover(handlerton* hton, THD* thd, TABLE_SHARE* share) } // This f() is also unused -int mcs_discover_existence(handlerton* hton, const char* db, const char* table_name) +int mcs_discover_existence(handlerton* /*hton*/, const char* db, const char* table_name) { return ha_mcs_impl_discover_existence(db, table_name); } @@ -203,7 +207,7 @@ const char** ha_mcs::bas_ext() const return ha_mcs_exts; } -int ha_mcs::analyze(THD* thd, HA_CHECK_OPT* check_opt) +int ha_mcs::analyze(THD* thd, HA_CHECK_OPT* /*check_opt*/) { DBUG_ENTER("ha_mcs::analyze"); @@ -342,7 +346,7 @@ int ha_mcs::write_row(const uchar* buf) DBUG_RETURN(rc); } -void ha_mcs::start_bulk_insert(ha_rows rows, uint flags) +void ha_mcs::start_bulk_insert(ha_rows rows, uint /*flags*/) { DBUG_ENTER("ha_mcs::start_bulk_insert"); try @@ -356,7 +360,7 @@ void ha_mcs::start_bulk_insert(ha_rows rows, uint flags) DBUG_VOID_RETURN; } -void ha_mcs::start_bulk_insert_from_cache(ha_rows rows, uint flags) +void ha_mcs::start_bulk_insert_from_cache(ha_rows rows, uint /*flags*/) { DBUG_ENTER("ha_mcs::start_bulk_insert_from_cache"); try @@ -399,7 +403,7 @@ int ha_mcs::end_bulk_insert() @see */ -int ha_mcs::update_row(const uchar* old_data, const uchar* new_data) +int ha_mcs::update_row(const uchar* /*old_data*/, const uchar* /*new_data*/) { DBUG_ENTER("ha_mcs::update_row"); int rc; @@ -428,7 +432,7 @@ int ha_mcs::update_row(const uchar* old_data, const uchar* new_data) @see mysql_update()/mysql_delete */ -int ha_mcs::direct_update_rows_init(List* update_fields) +int ha_mcs::direct_update_rows_init(List* /*update_fields*/) { DBUG_ENTER("ha_mcs::direct_update_rows_init"); DBUG_RETURN(0); @@ -508,7 +512,7 @@ int ha_mcs::direct_delete_rows(ha_rows* deleted_rows) sql_acl.cc, sql_udf.cc, sql_delete.cc, sql_insert.cc and sql_select.cc */ -int ha_mcs::delete_row(const uchar* buf) +int ha_mcs::delete_row(const uchar* /*buf*/) { DBUG_ENTER("ha_mcs::delete_row"); int rc; @@ -531,8 +535,8 @@ int ha_mcs::delete_row(const uchar* buf) index. */ -int ha_mcs::index_read_map(uchar* buf, const uchar* key, key_part_map keypart_map __attribute__((unused)), - enum ha_rkey_function find_flag __attribute__((unused))) +int ha_mcs::index_read_map(uchar* /*buf*/, const uchar* /*key*/, key_part_map /*keypart_map*/, + enum ha_rkey_function /*find_flag*/) { DBUG_ENTER("ha_mcs::index_read"); DBUG_RETURN(HA_ERR_WRONG_COMMAND); @@ -543,7 +547,7 @@ int ha_mcs::index_read_map(uchar* buf, const uchar* key, key_part_map keypart_ma Used to read forward through the index. */ -int ha_mcs::index_next(uchar* buf) +int ha_mcs::index_next(uchar* /*buf*/) { DBUG_ENTER("ha_mcs::index_next"); DBUG_RETURN(HA_ERR_WRONG_COMMAND); @@ -554,7 +558,7 @@ int ha_mcs::index_next(uchar* buf) Used to read backwards through the index. */ -int ha_mcs::index_prev(uchar* buf) +int ha_mcs::index_prev(uchar* /*buf*/) { DBUG_ENTER("ha_mcs::index_prev"); DBUG_RETURN(HA_ERR_WRONG_COMMAND); @@ -570,7 +574,7 @@ int ha_mcs::index_prev(uchar* buf) @see opt_range.cc, opt_sum.cc, sql_handler.cc and sql_select.cc */ -int ha_mcs::index_first(uchar* buf) +int ha_mcs::index_first(uchar* /*buf*/) { DBUG_ENTER("ha_mcs::index_first"); DBUG_RETURN(HA_ERR_WRONG_COMMAND); @@ -586,7 +590,7 @@ int ha_mcs::index_first(uchar* buf) @see opt_range.cc, opt_sum.cc, sql_handler.cc and sql_select.cc */ -int ha_mcs::index_last(uchar* buf) +int ha_mcs::index_last(uchar* /*buf*/) { DBUG_ENTER("ha_mcs::index_last"); DBUG_RETURN(HA_ERR_WRONG_COMMAND); @@ -703,7 +707,7 @@ int ha_mcs::rnd_next(uchar* buf) // allow for implementing blobs (is that the same as varbinary?). Perhaps using // lbid and offset as key would work, or something. We also need to add functionality // to retrieve records quickly by this "key" -void ha_mcs::position(const uchar* record) +void ha_mcs::position(const uchar* /*record*/) { DBUG_ENTER("ha_mcs::position"); DBUG_VOID_RETURN; @@ -776,7 +780,7 @@ int ha_mcs::rnd_pos(uchar* buf, uchar* pos) sql_select.cc, sql_show.cc, sql_show.cc, sql_show.cc, sql_show.cc, sql_table.cc, sql_union.cc and sql_update.cc */ -int ha_mcs::info(uint32_t flag) +int ha_mcs::info(uint32_t /*flag*/) { DBUG_ENTER("ha_mcs::info"); // @bug 1635. Raise this number magically fix the filesort crash issue. May need to twist @@ -797,7 +801,7 @@ int ha_mcs::info(uint32_t flag) @see ha_innodb.cc */ -int ha_mcs::extra(enum ha_extra_function operation) +int ha_mcs::extra([[maybe_unused]] enum ha_extra_function operation) { DBUG_ENTER("ha_mcs::extra"); #ifdef INFINIDB_DEBUG @@ -926,7 +930,7 @@ int ha_mcs::external_lock(THD* thd, int lock_type) get_lock_data() in lock.cc */ -THR_LOCK_DATA** ha_mcs::store_lock(THD* thd, THR_LOCK_DATA** to, enum thr_lock_type lock_type) +THR_LOCK_DATA** ha_mcs::store_lock(THD* /*thd*/, THR_LOCK_DATA** to, enum thr_lock_type /*lock_type*/) { // if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) // lock.type=lock_type; @@ -1019,8 +1023,8 @@ int ha_mcs::rename_table(const char* from, const char* to) @see check_quick_keys() in opt_range.cc */ -ha_rows ha_mcs::records_in_range(uint32_t inx, const key_range* min_key, const key_range* max_key, - page_range* res) +ha_rows ha_mcs::records_in_range(uint32_t /*inx*/, const key_range* /*min_key*/, const key_range* /*max_key*/, + page_range* /*res*/) { DBUG_ENTER("ha_mcs::records_in_range"); DBUG_RETURN(10); // low number to force index usage @@ -1109,7 +1113,7 @@ int ha_mcs::reset() DBUG_RETURN(0); } -int ha_mcs::repair(THD* thd, HA_CHECK_OPT* check_opt) +int ha_mcs::repair(THD* /*thd*/, HA_CHECK_OPT* /*check_opt*/) { DBUG_ENTER("ha_mcs::repair"); DBUG_ASSERT(!(int_table_flags & HA_CAN_REPAIR)); @@ -1347,7 +1351,8 @@ void ha_mcs_cache_share::close() static plugin_ref plugin_maria = NULL; -ha_mcs_cache::ha_mcs_cache(handlerton* hton, TABLE_SHARE* table_arg, MEM_ROOT* mem_root) +// FIXME First parameter is unused +ha_mcs_cache::ha_mcs_cache(handlerton* /*hton*/, TABLE_SHARE* table_arg, MEM_ROOT* mem_root) : ha_mcs(mcs_hton, table_arg), isSysCatTable(false), isCacheDisabled(false) { if (table_arg && table_arg->db.str && !strcasecmp(table_arg->db.str, "calpontsys") && @@ -1857,7 +1862,7 @@ static int columnstore_init_func(void* p) DBUG_RETURN(0); } -static int columnstore_done_func(void* p) +static int columnstore_done_func(void* /*p*/) { DBUG_ENTER("columnstore_done_func"); diff --git a/dbcon/mysql/ha_mcs.h b/dbcon/mysql/ha_mcs.h index 3af6717ea..a955691ef 100644 --- a/dbcon/mysql/ha_mcs.h +++ b/dbcon/mysql/ha_mcs.h @@ -21,7 +21,10 @@ #include #include "idb_mysql.h" #include "ha_mcs_sysvars.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include "ha_maria.h" +#pragma GCC diagnostic pop extern handlerton* mcs_hton; @@ -98,7 +101,7 @@ class ha_mcs : public handler If all_parts is set, MySQL wants to know the flags for the combined index, up to and including 'part'. */ - ulong index_flags(uint32_t inx, uint32_t part, bool all_parts) const override + ulong index_flags(uint32_t /*inx*/, uint32_t /*part*/, bool /*all_parts*/) const override { return 0; } diff --git a/dbcon/mysql/ha_mcs_client_udfs.cpp b/dbcon/mysql/ha_mcs_client_udfs.cpp index e9085e63d..32d8f004e 100644 --- a/dbcon/mysql/ha_mcs_client_udfs.cpp +++ b/dbcon/mysql/ha_mcs_client_udfs.cpp @@ -114,8 +114,8 @@ extern "C" return 0; } - const char* mcssetparms(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* mcssetparms(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, unsigned long* length, + char* /*is_null*/, char* /*error*/) { char parameter[MAXSTRINGLENGTH]; char valuestr[MAXSTRINGLENGTH]; @@ -188,7 +188,7 @@ extern "C" return setparms_init(initid, args, message, "MCSSETPARMS"); } - void mcssetparms_deinit(UDF_INIT* initid) + void mcssetparms_deinit(UDF_INIT* /*initid*/) { } @@ -203,7 +203,7 @@ extern "C" return setparms_init(initid, args, message, "CALSETPARMS"); } - void calsetparms_deinit(UDF_INIT* initid) + void calsetparms_deinit(UDF_INIT* /*initid*/) { } @@ -221,8 +221,8 @@ extern "C" return 0; } - const char* mcsgetstats(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* mcsgetstats(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* result, unsigned long* length, + char* is_null, char* /*error*/) { if (get_fe_conn_info_ptr() == NULL) { @@ -253,7 +253,7 @@ extern "C" return getstats_init(initid, args, message, "MCSGETSTATS"); } - void mcsgetstats_deinit(UDF_INIT* initid) + void mcsgetstats_deinit(UDF_INIT* /*initid*/) { } @@ -268,11 +268,11 @@ extern "C" return getstats_init(initid, args, message, "CALGETSTATS"); } - void calgetstats_deinit(UDF_INIT* initid) + void calgetstats_deinit(UDF_INIT* /*initid*/) { } - my_bool settrace_init(UDF_INIT* initid, UDF_ARGS* args, char* message, const char* funcname) + my_bool settrace_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message, const char* funcname) { if (args->arg_count != 1 || args->arg_type[0] != INT_RESULT) { @@ -283,7 +283,7 @@ extern "C" return 0; } - long long mcssettrace(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long mcssettrace(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*is_null*/, char* /*error*/) { if (get_fe_conn_info_ptr() == NULL) { @@ -306,7 +306,7 @@ extern "C" return settrace_init(initid, args, message, "MCSSETTRACE"); } - void mcssettrace_deinit(UDF_INIT* initid) + void mcssettrace_deinit(UDF_INIT* /*initid*/) { } @@ -320,12 +320,12 @@ extern "C" return settrace_init(initid, args, message, "CALSETTRACE"); } - void calsettrace_deinit(UDF_INIT* initid) + void calsettrace_deinit(UDF_INIT* /*initid*/) { } // Return 1 if system is ready for reads or 0 if not. - long long mcssystemready(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long mcssystemready(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error) { long long rtn = 0; Oam oam; @@ -346,17 +346,17 @@ extern "C" return rtn; } - my_bool mcssystemready_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool mcssystemready_init(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*message*/) { return 0; } - void mcssystemready_deinit(UDF_INIT* initid) + void mcssystemready_deinit(UDF_INIT* /*initid*/) { } // Return non-zero if system is read only; 0 if writeable - long long mcssystemreadonly(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long mcssystemreadonly(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error) { long long rtn = 0; DBRM dbrm(true); @@ -382,17 +382,17 @@ extern "C" return rtn; } - my_bool mcssystemreadonly_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool mcssystemreadonly_init(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*message*/) { return 0; } - void mcssystemreadonly_deinit(UDF_INIT* initid) + void mcssystemreadonly_deinit(UDF_INIT* /*initid*/) { } // Return non-zero if this is the primary UM; 0 if not primary - long long mcssystemprimary(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long mcssystemprimary(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error) { long long rtn = 0; Oam oam; @@ -424,12 +424,12 @@ extern "C" return rtn; } - my_bool mcssystemprimary_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool mcssystemprimary_init(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*message*/) { return 0; } - void mcssystemprimary_deinit(UDF_INIT* initid) + void mcssystemprimary_deinit(UDF_INIT* /*initid*/) { } @@ -467,8 +467,8 @@ extern "C" return viewtablelock_init(initid, args, message, "MCSVIEWTABLELOCK"); } - const char* mcsviewtablelock(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* mcsviewtablelock(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, unsigned long* length, + char* /*is_null*/, char* /*error*/) { THD* thd = current_thd; @@ -522,7 +522,7 @@ extern "C" return result; } - void mcsviewtablelock_deinit(UDF_INIT* initid) + void mcsviewtablelock_deinit(UDF_INIT* /*initid*/) { } @@ -537,7 +537,7 @@ extern "C" return mcsviewtablelock(initid, args, result, length, is_null, error); } - void calviewtablelock_deinit(UDF_INIT* initid) + void calviewtablelock_deinit(UDF_INIT* /*initid*/) { } @@ -570,7 +570,8 @@ extern "C" return 0; } - const char* mcs_set_ddldebug_level(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length) + const char* mcs_set_ddldebug_level(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, + unsigned long* length) { uint32_t level = *reinterpret_cast(args->args[0]); std::unique_ptr stmt = @@ -626,7 +627,7 @@ extern "C" return result; } - void mcs_set_ddldebug_level_deinit(UDF_INIT* initid) + void mcs_set_ddldebug_level_deinit(UDF_INIT* /*initid*/) { } @@ -635,8 +636,8 @@ extern "C" return cleartablelock_init(initid, args, message, "MCSCLEARTABLELOCK"); } - const char* mcscleartablelock(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* mcscleartablelock(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, unsigned long* length, + char* /*is_null*/, char* /*error*/) { if (get_fe_conn_info_ptr() == NULL) { @@ -662,7 +663,7 @@ extern "C" return result; } - void mcscleartablelock_deinit(UDF_INIT* initid) + void mcscleartablelock_deinit(UDF_INIT* /*initid*/) { } @@ -677,7 +678,7 @@ extern "C" return mcscleartablelock(initid, args, result, length, is_null, error); } - void calcleartablelock_deinit(UDF_INIT* initid) + void calcleartablelock_deinit(UDF_INIT* /*initid*/) { } @@ -715,7 +716,7 @@ extern "C" return lastinsertid_init(initid, args, message, "MCSLASTINSERTID"); } - long long mcslastinsertid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long mcslastinsertid(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*is_null*/, char* /*error*/) { THD* thd = current_thd; @@ -775,7 +776,7 @@ extern "C" return (nextVal - 1); } - void mcslastinsertid_deinit(UDF_INIT* initid) + void mcslastinsertid_deinit(UDF_INIT* /*initid*/) { } @@ -789,11 +790,11 @@ extern "C" return mcslastinsertid(initid, args, is_null, error); } - void callastinsertid_deinit(UDF_INIT* initid) + void callastinsertid_deinit(UDF_INIT* /*initid*/) { } - my_bool flushcache_init(UDF_INIT* initid, UDF_ARGS* args, char* message, const char* funcname) + my_bool flushcache_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message, const char* funcname) { if (args->arg_count != 0) { @@ -804,11 +805,11 @@ extern "C" return 0; } - void mcsflushcache_deinit(UDF_INIT* initid) + void mcsflushcache_deinit(UDF_INIT* /*initid*/) { } - long long mcsflushcache(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long mcsflushcache(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/) { return static_cast(cacheutils::flushPrimProcCache()); } @@ -818,7 +819,7 @@ extern "C" return flushcache_init(initid, args, message, "MCSFLUSHCACHE"); } - void calflushcache_deinit(UDF_INIT* initid) + void calflushcache_deinit(UDF_INIT* /*initid*/) { } @@ -837,8 +838,8 @@ extern "C" // mysqld will call this with only 766 bytes available in result no matter what we asked for in // calgettrace_init() // if we return a pointer that is not result, mysqld will take our pointer and use it, freeing up result - const char* mcsgettrace(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* mcsgettrace(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*result*/, unsigned long* length, + char* is_null, char* /*error*/) { const std::string* msgp; int flags = 0; @@ -881,7 +882,7 @@ extern "C" return msgp->c_str(); } - my_bool gettrace_init(UDF_INIT* initid, UDF_ARGS* args, char* message, const char* funcname) + my_bool gettrace_init(UDF_INIT* initid, UDF_ARGS* /*args*/, char* /*message*/, const char* /*funcname*/) { #if 0 @@ -903,7 +904,7 @@ extern "C" return gettrace_init(initid, args, message, "MCSGETTRACE"); } - void mcsgettrace_deinit(UDF_INIT* initid) + void mcsgettrace_deinit(UDF_INIT* /*initid*/) { } @@ -918,11 +919,11 @@ extern "C" return gettrace_init(initid, args, message, "CALGETTRACE"); } - void calgettrace_deinit(UDF_INIT* initid) + void calgettrace_deinit(UDF_INIT* /*initid*/) { } - my_bool getversion_init(UDF_INIT* initid, UDF_ARGS* args, char* message, const char* funcname) + my_bool getversion_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message, const char* funcname) { if (args->arg_count != 0) { @@ -933,8 +934,8 @@ extern "C" return 0; } - const char* mcsgetversion(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* mcsgetversion(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* result, unsigned long* length, + char* /*is_null*/, char* /*error*/) { std::string version(columnstore_version); *length = version.size(); @@ -947,7 +948,7 @@ extern "C" return getversion_init(initid, args, message, "MCSGETVERSION"); } - void mcsgetversion_deinit(UDF_INIT* initid) + void mcsgetversion_deinit(UDF_INIT* /*initid*/) { } @@ -962,11 +963,11 @@ extern "C" return getversion_init(initid, args, message, "CALGETVERSION"); } - void calgetversion_deinit(UDF_INIT* initid) + void calgetversion_deinit(UDF_INIT* /*initid*/) { } - my_bool getsqlcount_init(UDF_INIT* initid, UDF_ARGS* args, char* message, const char* funcname) + my_bool getsqlcount_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message, const char* funcname) { if (args->arg_count != 0) { @@ -977,8 +978,8 @@ extern "C" return 0; } - const char* mcsgetsqlcount(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* mcsgetsqlcount(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* result, unsigned long* length, + char* /*is_null*/, char* /*error*/) { if (get_fe_conn_info_ptr() == NULL) { @@ -1024,7 +1025,7 @@ extern "C" return getstats_init(initid, args, message, "MCSGETSQLCOUNT"); } - void mcsgetsqlcount_deinit(UDF_INIT* initid) + void mcsgetsqlcount_deinit(UDF_INIT* /*initid*/) { } @@ -1039,17 +1040,17 @@ extern "C" return getstats_init(initid, args, message, "CALGETSQLCOUNT"); } - void calgetsqlcount_deinit(UDF_INIT* initid) + void calgetsqlcount_deinit(UDF_INIT* /*initid*/) { } - long long mcs_emindex_size(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long mcs_emindex_size(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/) { DBRM dbrm; return dbrm.EMIndexShmemSize(); } - my_bool mcs_emindex_size_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool mcs_emindex_size_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 0) { @@ -1060,17 +1061,17 @@ extern "C" return 0; } - void mcs_emindex_size_deinit(UDF_INIT* initid) + void mcs_emindex_size_deinit(UDF_INIT* /*initid*/) { } - long long mcs_emindex_free(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long mcs_emindex_free(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/) { DBRM dbrm; return dbrm.EMIndexShmemFree(); } - my_bool mcs_emindex_free_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool mcs_emindex_free_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 0) { @@ -1081,7 +1082,7 @@ extern "C" return 0; } - void mcs_emindex_free_deinit(UDF_INIT* initid) + void mcs_emindex_free_deinit(UDF_INIT* /*initid*/) { } diff --git a/dbcon/mysql/ha_mcs_datatype.h b/dbcon/mysql/ha_mcs_datatype.h index 71e03c72d..067af6d06 100644 --- a/dbcon/mysql/ha_mcs_datatype.h +++ b/dbcon/mysql/ha_mcs_datatype.h @@ -360,7 +360,7 @@ class WriteBatchFieldMariaDB : public WriteBatchField } static void ColWriteBatchTextString(const String& value, const ColBatchWriter& ci, - const size_t colWidthInBytes) + const size_t /*colWidthInBytes*/) { std::string escape; escape.assign(value.ptr(), value.length()); @@ -376,7 +376,7 @@ class WriteBatchFieldMariaDB : public WriteBatchField } static void ColWriteBatchBlobString(const String& value, const ColBatchWriter& ci, - const size_t colWidthInBytes) + const size_t /*colWidthInBytes*/) { const char* ptr = value.ptr(); for (uint32_t i = 0; i < value.length(); i++) @@ -386,9 +386,9 @@ class WriteBatchFieldMariaDB : public WriteBatchField fprintf(ci.filePtr(), "%c", ci.delimiter()); } - size_t ColWriteBatchString(const uchar* buf, bool nullVal, ColBatchWriter& ci, + size_t ColWriteBatchString(const uchar* /*buf*/, bool nullVal, ColBatchWriter& ci, void (*printFuncPtr)(const String&, const ColBatchWriter&, - const size_t colWidthInBytes)) const + const size_t /*colWidthInBytes*/)) const { if (nullVal && (m_type.constraintType != CalpontSystemCatalog::NOTNULL_CONSTRAINT)) { diff --git a/dbcon/mysql/ha_mcs_ddl.cpp b/dbcon/mysql/ha_mcs_ddl.cpp index 0acde2392..ad7e77fad 100644 --- a/dbcon/mysql/ha_mcs_ddl.cpp +++ b/dbcon/mysql/ha_mcs_ddl.cpp @@ -751,7 +751,7 @@ bool anyNullInTheColumn(THD* thd, string& schema, string& table, string& columnN } } -int ProcessDDLStatement(string& ddlStatement, string& schema, const string& table, int sessionID, +int ProcessDDLStatement(string& ddlStatement, string& schema, const string& /*table*/, int sessionID, string& emsg, int compressionTypeIn = 2, bool isAnyAutoincreCol = false, int64_t nextvalue = 1, std::string autoiColName = "", const CHARSET_INFO* default_table_charset = NULL) @@ -767,7 +767,8 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl int rc = 0; parser.Parse(ddlStatement.c_str()); - if (get_fe_conn_info_ptr() == NULL) { + if (get_fe_conn_info_ptr() == NULL) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -1064,12 +1065,11 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl } } - - bool isAutoIncrementColumn = - default_table_charset ? datatypes::CollationAwareComparator(default_table_charset)( - autoiColName, createTable->fTableDef->fColumns[i]->fName) - : datatypes::ASCIIStringCaseInsensetiveEquals( - autoiColName, createTable->fTableDef->fColumns[i]->fName); + bool isAutoIncrementColumn = default_table_charset + ? datatypes::CollationAwareComparator(default_table_charset)( + autoiColName, createTable->fTableDef->fColumns[i]->fName) + : datatypes::ASCIIStringCaseInsensetiveEquals( + autoiColName, createTable->fTableDef->fColumns[i]->fName); if (!autoIncre && isAnyAutoincreCol && isAutoIncrementColumn) { @@ -1395,7 +1395,8 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl { //@Bug 3782 This is for synchronization after calonlinealter to use boost::algorithm::to_upper(comment); - std::regex pat("[[:space:]]*SCHEMA[[:space:]]+SYNC[[:space:]]+ONLY", std::regex_constants::extended); + std::regex pat("[[:space:]]*SCHEMA[[:space:]]+SYNC[[:space:]]+ONLY", + std::regex_constants::extended); if (std::regex_search(comment, pat)) { @@ -2184,7 +2185,8 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl { rc = 0; string errmsg( - "Error occurred during file deletion. Restart DDLProc or use command tool ddlcleanup to clean up. "); + "Error occurred during file deletion. Restart DDLProc or use command tool ddlcleanup to clean " + "up. "); push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 9999, errmsg.c_str()); } @@ -2228,7 +2230,7 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl // been created. // -static bool get_field_default_value(THD* thd, Field* field, String* def_value, bool quoted) +static bool get_field_default_value(THD* /*thd*/, Field* field, String* def_value, bool quoted) { bool has_default; enum enum_field_types field_type = field->type(); @@ -2306,7 +2308,7 @@ bool hasZerofillDecimal(TABLE* table_arg) return false; } -int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* create_info, +int ha_mcs_impl_create_(const char* /*name*/, TABLE* table_arg, HA_CREATE_INFO* create_info, cal_connection_info& ci) { #ifdef MCS_DEBUG @@ -2391,7 +2393,7 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea return 1; } else if (db == "infinidb_vtable") //@bug 3540. table created in infinidb_vtable schema could be dropped - //when select statement happen to have same tablename. + // when select statement happen to have same tablename. { setError(thd, ER_INTERNAL_ERROR, "Table creation is not allowed in infinidb_vtable schema."); return 1; @@ -2525,8 +2527,7 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea const CHARSET_INFO* field_cs = (*field)->charset(); if (field_cs && (!share->table_charset || field_cs->number != share->table_charset->number)) { - oss << " CHARACTER SET " << field_cs->cs_name.str << - " COLLATE " << field_cs->coll_name.str; + oss << " CHARACTER SET " << field_cs->cs_name.str << " COLLATE " << field_cs->coll_name.str; } } @@ -2566,8 +2567,8 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea if (share->table_charset) { - oss << " DEFAULT CHARSET=" << share->table_charset->cs_name.str << - " COLLATE=" << share->table_charset->coll_name.str; + oss << " DEFAULT CHARSET=" << share->table_charset->cs_name.str + << " COLLATE=" << share->table_charset->coll_name.str; } // Process table level options such as MIN_ROWS, MAX_ROWS, COMMENT @@ -2625,7 +2626,7 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea return rc; } -int ha_mcs_impl_delete_table_(const char* db, const char* name, cal_connection_info& ci) +int ha_mcs_impl_delete_table_(const char* /*db*/, const char* name, cal_connection_info& ci) { #ifdef MCS_DEBUG cout << "ha_mcs_impl_delete_table: " << db << name << endl; @@ -2751,7 +2752,7 @@ int ha_mcs_impl_rename_table_(const char* from, const char* to, cal_connection_i extern "C" { - long long calonlinealter(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long calonlinealter(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*is_null*/, char* /*error*/) { string stmt(args->args[0], args->lengths[0]); @@ -2789,7 +2790,7 @@ extern "C" return rc; } - my_bool calonlinealter_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool calonlinealter_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1 || args->arg_type[0] != STRING_RESULT) { @@ -2800,8 +2801,7 @@ extern "C" return 0; } - void calonlinealter_deinit(UDF_INIT* initid) + void calonlinealter_deinit(UDF_INIT* /*initid*/) { } } - diff --git a/dbcon/mysql/ha_mcs_dml.cpp b/dbcon/mysql/ha_mcs_dml.cpp index ba107c8ef..a469b4ab8 100644 --- a/dbcon/mysql/ha_mcs_dml.cpp +++ b/dbcon/mysql/ha_mcs_dml.cpp @@ -66,8 +66,8 @@ using namespace execplan; #include "resourcemanager.h" using namespace joblist; -//#include "stopwatch.h" -// using namespace logging; +// #include "stopwatch.h" +// using namespace logging; #include "dbrm.h" @@ -99,7 +99,6 @@ uint32_t buildValueList(TABLE* table, cal_connection_info& ci) ci.nullValuesBitset.reset(); NullString null; - for (Field** field = table->field; *field; field++) { if ((*field)->is_null()) @@ -129,11 +128,12 @@ uint32_t buildValueList(TABLE* table, cal_connection_info& ci) // fetch different data type (*field)->val_str(&attribute, &attribute); -// if (attribute.length() == 0) -// { -// ci.tableValuesMap[columnPos].push_back(null); // currently, empty string is treated as null. -// } -// else + // if (attribute.length() == 0) + // { + // ci.tableValuesMap[columnPos].push_back(null); // currently, empty string is treated as + // null. + // } + // else { string val(attribute.ptr(), attribute.length()); NullString nonNull(val); @@ -579,7 +579,7 @@ int ha_mcs_impl_write_last_batch(TABLE* table, cal_connection_info& ci, bool abo return rc; } -int ha_mcs_impl_write_row_(const uchar* buf, TABLE* table, cal_connection_info& ci, ha_rows& rowsInserted) +int ha_mcs_impl_write_row_(const uchar* /*buf*/, TABLE* table, cal_connection_info& ci, ha_rows& rowsInserted) { int rc = 0; // timer.start( "buildValueList"); @@ -945,7 +945,7 @@ std::string ha_mcs_impl_cleartablelock(cal_impl_if::cal_connection_info& ci, uin return tableLockInfo; } -int ha_mcs_impl_commit_(handlerton* hton, THD* thd, bool all, cal_connection_info& ci) +int ha_mcs_impl_commit_(handlerton* /*hton*/, THD* thd, bool /*all*/, cal_connection_info& ci) { if (thd->slave_thread && !get_replication_slave(thd)) return 0; @@ -960,7 +960,7 @@ int ha_mcs_impl_commit_(handlerton* hton, THD* thd, bool all, cal_connection_inf return rc; } -int ha_mcs_impl_rollback_(handlerton* hton, THD* thd, bool all, cal_connection_info& ci) +int ha_mcs_impl_rollback_(handlerton* /*hton*/, THD* thd, bool /*all*/, cal_connection_info& ci) { int rc = 0; #ifdef INFINIDB_DEBUG @@ -980,7 +980,7 @@ int ha_mcs_impl_rollback_(handlerton* hton, THD* thd, bool all, cal_connection_i return rc; } -int ha_mcs_impl_close_connection_(handlerton* hton, THD* thd, cal_connection_info& ci) +int ha_mcs_impl_close_connection_(handlerton* /*hton*/, THD* thd, cal_connection_info& ci) { int rc = 0; #ifdef INFINIDB_DEBUG @@ -1001,4 +1001,3 @@ int ha_mcs_impl_close_connection_(handlerton* hton, THD* thd, cal_connection_inf // transaction. Under either situation, system catalog cache for this session should be removed return rc; } - diff --git a/dbcon/mysql/ha_mcs_execplan.cpp b/dbcon/mysql/ha_mcs_execplan.cpp index 6f3ba62b3..23e706a2f 100644 --- a/dbcon/mysql/ha_mcs_execplan.cpp +++ b/dbcon/mysql/ha_mcs_execplan.cpp @@ -173,7 +173,7 @@ void pushReturnedCol(gp_walk_info& gwi, Item* from, SRCP rc) // made within MCOL-5776 produced bug MCOL-5932 so, the check of equal columns is disabled // FIXME: enable the check of equal columns - //bool same = ith->eq(from, false); + // bool same = ith->eq(from, false); bool same = false; if (same && ith->type() == Item::FUNC_ITEM) @@ -326,7 +326,7 @@ static execplan::Partitions getPartitions(TABLE* table) partition_element* pe; - while ((pe = part_el_it++)) // this is how server does it. + while ((pe = part_el_it++)) // this is how server does it. { result.fPartNames.emplace_back(pe->partition_name); } @@ -343,7 +343,7 @@ static execplan::Partitions getPartitions(TABLE_LIST* table) String* n; - while ((n = part_name_it++)) // this is how server does it. + while ((n = part_name_it++)) // this is how server does it. { std::string pn(n->ptr(), n->length()); result.fPartNames.push_back(pn); @@ -352,7 +352,6 @@ static execplan::Partitions getPartitions(TABLE_LIST* table) return result; } - CalpontSystemCatalog::TableAliasName makeTableAliasName_(TABLE_LIST* table) { return make_aliasview( @@ -367,7 +366,6 @@ CalpontSystemCatalog::TableAliasName makeTableAliasName(TABLE_LIST* table) return result; } - //@bug5228. need to escape backtick ` string escapeBackTick(const char* str) { @@ -895,26 +893,16 @@ void debug_walk(const Item* item, void* arg) cerr << '=' << " (" << ifp->functype() << ")" << endl; break; - case Item_func::GE_FUNC: - cerr << ">=" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::GE_FUNC: cerr << ">=" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::LE_FUNC: - cerr << "<=" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::LE_FUNC: cerr << "<=" << " (" << ifp->functype() << ")" << endl; break; case Item_func::LT_FUNC: cerr << '<' << " (" << ifp->functype() << ")" << endl; break; - case Item_func::NE_FUNC: - cerr << "<>" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::NE_FUNC: cerr << "<>" << " (" << ifp->functype() << ")" << endl; break; case Item_func::NEG_FUNC: // 45 - cerr << "unary minus" - << " (" << ifp->functype() << ")" << endl; + cerr << "unary minus" << " (" << ifp->functype() << ")" << endl; break; case Item_func::IN_FUNC: // 16 @@ -923,8 +911,7 @@ void debug_walk(const Item* item, void* arg) if (inp->negated) cerr << "not "; - cerr << "in" - << " (" << ifp->functype() << ")" << endl; + cerr << "in" << " (" << ifp->functype() << ")" << endl; break; case Item_func::BETWEEN: @@ -933,44 +920,32 @@ void debug_walk(const Item* item, void* arg) if (inp->negated) cerr << "not "; - cerr << "between" - << " (" << ifp->functype() << ")" << endl; + cerr << "between" << " (" << ifp->functype() << ")" << endl; break; case Item_func::ISNULL_FUNC: // 10 - cerr << "is null" - << " (" << ifp->functype() << ")" << endl; + cerr << "is null" << " (" << ifp->functype() << ")" << endl; break; case Item_func::ISNOTNULL_FUNC: // 11 - cerr << "is not null" - << " (" << ifp->functype() << ")" << endl; + cerr << "is not null" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::NOT_ALL_FUNC: - cerr << "not_all" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::NOT_ALL_FUNC: cerr << "not_all" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::NOT_FUNC: - cerr << "not_func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::NOT_FUNC: cerr << "not_func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::TRIG_COND_FUNC: - cerr << "trig_cond_func" - << " (" << ifp->functype() << ")" << endl; + cerr << "trig_cond_func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::ISNOTNULLTEST_FUNC: - cerr << "isnotnulltest_func" - << " (" << ifp->functype() << ")" << endl; + cerr << "isnotnulltest_func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::MULT_EQUAL_FUNC: { - cerr << "mult_equal_func:" - << " (" << ifp->functype() << ")" << endl; + cerr << "mult_equal_func:" << " (" << ifp->functype() << ")" << endl; Item_equal* item_eq = (Item_equal*)ifp; Item_equal_fields_iterator it(*item_eq); Item* item; @@ -984,165 +959,107 @@ void debug_walk(const Item* item, void* arg) break; } - case Item_func::EQUAL_FUNC: - cerr << "equal func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::EQUAL_FUNC: cerr << "equal func" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::FT_FUNC: - cerr << "ft func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::FT_FUNC: cerr << "ft func" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::LIKE_FUNC: - cerr << "like func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::LIKE_FUNC: cerr << "like func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::COND_AND_FUNC: - cerr << "cond and func" - << " (" << ifp->functype() << ")" << endl; + cerr << "cond and func" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::COND_OR_FUNC: - cerr << "cond or func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::COND_OR_FUNC: cerr << "cond or func" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::XOR_FUNC: - cerr << "xor func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::XOR_FUNC: cerr << "xor func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::INTERVAL_FUNC: - cerr << "interval func" - << " (" << ifp->functype() << ")" << endl; + cerr << "interval func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_EQUALS_FUNC: - cerr << "sp equals func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp equals func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_DISJOINT_FUNC: - cerr << "sp disjoint func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp disjoint func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_INTERSECTS_FUNC: - cerr << "sp intersects func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp intersects func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_TOUCHES_FUNC: - cerr << "sp touches func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp touches func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_CROSSES_FUNC: - cerr << "sp crosses func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp crosses func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_WITHIN_FUNC: - cerr << "sp within func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp within func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_CONTAINS_FUNC: - cerr << "sp contains func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp contains func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_OVERLAPS_FUNC: - cerr << "sp overlaps func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp overlaps func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_STARTPOINT: - cerr << "sp startpoint func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp startpoint func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_ENDPOINT: - cerr << "sp endpoint func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp endpoint func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_EXTERIORRING: - cerr << "sp exteriorring func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp exteriorring func" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::SP_POINTN: - cerr << "sp pointn func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::SP_POINTN: cerr << "sp pointn func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_GEOMETRYN: - cerr << "sp geometryn func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp geometryn func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_INTERIORRINGN: - cerr << "sp exteriorringn func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp exteriorringn func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SP_RELATE_FUNC: - cerr << "sp relate func" - << " (" << ifp->functype() << ")" << endl; + cerr << "sp relate func" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::NOW_FUNC: - cerr << "now func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::NOW_FUNC: cerr << "now func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::SUSERVAR_FUNC: - cerr << "suservar func" - << " (" << ifp->functype() << ")" << endl; + cerr << "suservar func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::GUSERVAR_FUNC: - cerr << "guservar func" - << " (" << ifp->functype() << ")" << endl; + cerr << "guservar func" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::COLLATE_FUNC: - cerr << "collate func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::COLLATE_FUNC: cerr << "collate func" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::EXTRACT_FUNC: - cerr << "extract func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::EXTRACT_FUNC: cerr << "extract func" << " (" << ifp->functype() << ")" << endl; break; case Item_func::CHAR_TYPECAST_FUNC: - cerr << "char typecast func" - << " (" << ifp->functype() << ")" << endl; + cerr << "char typecast func" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::FUNC_SP: - cerr << "func sp func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::FUNC_SP: cerr << "func sp func" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::UDF_FUNC: - cerr << "udf func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::UDF_FUNC: cerr << "udf func" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::GSYSVAR_FUNC: - cerr << "gsysvar func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::GSYSVAR_FUNC: cerr << "gsysvar func" << " (" << ifp->functype() << ")" << endl; break; - case Item_func::DYNCOL_FUNC: - cerr << "dyncol func" - << " (" << ifp->functype() << ")" << endl; - break; + case Item_func::DYNCOL_FUNC: cerr << "dyncol func" << " (" << ifp->functype() << ")" << endl; break; default: cerr << "type=" << ifp->functype() << endl; break; } @@ -2622,7 +2539,7 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp) sc->tableAlias(gwi.tbList[i].alias); sc->viewName(viewName, lower_case_table_names); - sc->partitions(gwi.tbList[i].partitions); + sc->partitions(gwi.tbList[i].partitions); sc->resultType(ct); sc->timeZone(gwi.timeZone); break; @@ -2708,7 +2625,7 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp) } sc->resultType(cols[j]->resultType()); sc->hasAggregate(cols[j]->hasAggregate()); - // XXX partitions??? + // XXX partitions??? if (col) sc->isColumnStore(col->isColumnStore()); @@ -2820,7 +2737,7 @@ void collectAllCols(gp_walk_info& gwi, Item_field* ifp) sc->colPosition(j); sc->tableAlias(csep->derivedTbAlias()); sc->viewName(gwi.tbList[i].view); - sc->partitions(gwi.tbList[i].partitions); + sc->partitions(gwi.tbList[i].partitions); sc->resultType(cols[j]->resultType()); sc->timeZone(gwi.timeZone); @@ -3008,7 +2925,7 @@ void setError(THD* thd, uint32_t errcode, string errmsg) ci->expressionId = 0; } -void setError(THD* thd, uint32_t errcode, string errmsg, gp_walk_info& gwi) +void setError(THD* thd, uint32_t errcode, string errmsg, gp_walk_info& /*gwi*/) { setError(thd, errcode, errmsg); } @@ -3213,7 +3130,7 @@ SimpleColumn* getSmallestColumn(boost::shared_ptr csc, sc->columnName(rc->alias()); sc->sequence(0); sc->tableAlias(tan.alias); - sc->partitions(tan.partitions); + sc->partitions(tan.partitions); sc->timeZone(gwi.timeZone); sc->derivedTable(csep->derivedTbAlias()); sc->derivedRefCol(rc); @@ -3665,7 +3582,7 @@ static ConstantColumn* buildConstantColumnNotNullUsingValNative(Item* item, gp_w return rc; } -ReturnedColumn* buildReturnedColumnBody(Item* item, gp_walk_info& gwi, bool& nonSupport, bool isRefItem) +ReturnedColumn* buildReturnedColumnBody(Item* item, gp_walk_info& gwi, bool& nonSupport, bool /*isRefItem*/) { ReturnedColumn* rc = NULL; @@ -3861,7 +3778,7 @@ ReturnedColumn* buildReturnedColumn(Item* item, gp_walk_info& gwi, bool& nonSupp } // parse the boolean fields to string "true" or "false" -ReturnedColumn* buildBooleanConstantColumn(Item* item, gp_walk_info& gwi, bool& nonSupport) +ReturnedColumn* buildBooleanConstantColumn(Item* item, gp_walk_info& gwi, bool& /*nonSupport*/) { ConstantColumn* cc = NULL; @@ -4700,7 +4617,8 @@ ReturnedColumn* buildFunctionColumnBody(Item_func* ifp, gp_walk_info& gwi, bool& // A few functions use a different collation than that found in // the base ifp class - if (funcName == "locate" || funcName == "find_in_set" || funcName == "strcmp" || funcName == "regexp_instr") + if (funcName == "locate" || funcName == "find_in_set" || funcName == "strcmp" || + funcName == "regexp_instr") { DTCollation dt; ifp->Type_std_attributes::agg_arg_charsets_for_comparison(dt, ifp->func_name_cstring(), @@ -5073,7 +4991,7 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi) // view name sc->viewName(getViewName(ifp->cached_table), lower_case_table_names); - //sc->partitions(...); // XXX how??? + // sc->partitions(...); // XXX how??? sc->alias(ifp->name.str); sc->isColumnStore(prm.columnStore()); @@ -5108,7 +5026,7 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi) return sc; } -ParseTree* buildParseTree(Item* item, gp_walk_info& gwi, bool& nonSupport) +ParseTree* buildParseTree(Item* item, gp_walk_info& gwi, bool& /*nonSupport*/) { ParseTree* pt = 0; #ifdef DEBUG_WALK_COND @@ -7176,12 +7094,12 @@ int processFrom(bool& isUnion, SELECT_LEX& select_lex, gp_walk_info& gwi, SCSEP& CalpontSystemCatalog::TableAliasName tn = make_aliasview(table_ptr->db.str, table_name, table_ptr->alias.str, viewName, columnStore, lower_case_table_names); - execplan::Partitions parts = getPartitions(table_ptr); - tn.partitions = parts; + execplan::Partitions parts = getPartitions(table_ptr); + tn.partitions = parts; gwi.tbList.push_back(tn); CalpontSystemCatalog::TableAliasName tan = make_aliastable( table_ptr->db.str, table_name, table_ptr->alias.str, columnStore, lower_case_table_names); - tan.partitions = parts; + tan.partitions = parts; gwi.tableMap[tan] = make_pair(0, table_ptr); #ifdef DEBUG_WALK_COND cerr << tn << endl; @@ -7609,7 +7527,7 @@ int processWhere(SELECT_LEX& select_lex, gp_walk_info& gwi, SCSEP& csep, const s * error id as an int ***********************************************************/ int processLimitAndOffset(SELECT_LEX& select_lex, gp_walk_info& gwi, SCSEP& csep, bool unionSel, bool isUnion, - bool isSelectHandlerTop) + bool /*isSelectHandlerTop*/) { // LIMIT processing part uint64_t limitNum = std::numeric_limits::max(); @@ -9278,7 +9196,7 @@ int cp_get_table_plan(THD* thd, SCSEP& csep, cal_table_info& ti, long timeZone) csep->columnMap(gwi->columnMap); CalpontSelectExecutionPlan::TableList tblist; tblist.push_back(make_aliastable(table->s->db.str, table->s->table_name.str, table->alias.c_ptr(), true, - lower_case_table_names)); + lower_case_table_names)); csep->tableList(tblist); // @bug 3321. Set max number of blocks in a dictionary file to be scanned for filtering @@ -9291,7 +9209,7 @@ int cp_get_table_plan(THD* thd, SCSEP& csep, cal_table_info& ti, long timeZone) return 0; } -int cs_get_derived_plan(ha_columnstore_derived_handler* handler, THD* thd, SCSEP& csep, gp_walk_info& gwi) +int cs_get_derived_plan(ha_columnstore_derived_handler* handler, THD* /*thd*/, SCSEP& csep, gp_walk_info& gwi) { SELECT_LEX& select_lex = *handler->select; int status = getSelectPlan(gwi, select_lex, csep, false); @@ -9311,7 +9229,7 @@ int cs_get_derived_plan(ha_columnstore_derived_handler* handler, THD* thd, SCSEP return 0; } -int cs_get_select_plan(ha_columnstore_select_handler* handler, THD* thd, SCSEP& csep, gp_walk_info& gwi, +int cs_get_select_plan(ha_columnstore_select_handler* handler, THD* /*thd*/, SCSEP& csep, gp_walk_info& gwi, bool isSelectLexUnit) { SELECT_LEX& select_lex = handler->select_lex ? *handler->select_lex : *handler->lex_unit->first_select(); diff --git a/dbcon/mysql/ha_mcs_impl.cpp b/dbcon/mysql/ha_mcs_impl.cpp index 6eaf8a34a..f3f56a74d 100644 --- a/dbcon/mysql/ha_mcs_impl.cpp +++ b/dbcon/mysql/ha_mcs_impl.cpp @@ -132,7 +132,6 @@ using namespace funcexp; #include "ha_mcs_logging.h" #include "ha_subquery.h" - namespace cal_impl_if { extern bool nonConstFunc(Item_func* ifp); @@ -306,18 +305,18 @@ int fetchNextRow(uchar* buf, cal_table_info& ti, cal_connection_info* ci, long t { // @bug 2244. Always log this msg for now, as we try to track down when/why we are // losing socket connection with ExeMgr - //#ifdef INFINIDB_DEBUG + // #ifdef INFINIDB_DEBUG tpl_scan_fetch_LogException(ti, ci, &ex); - //#endif + // #endif sm_stat = sm::CALPONT_INTERNAL_ERROR; } catch (...) { // @bug 2244. Always log this msg for now, as we try to track down when/why we are // losing socket connection with ExeMgr - //#ifdef INFINIDB_DEBUG + // #ifdef INFINIDB_DEBUG tpl_scan_fetch_LogException(ti, ci, 0); - //#endif + // #endif sm_stat = sm::CALPONT_INTERNAL_ERROR; } @@ -763,7 +762,8 @@ vector getOnUpdateTimestampColumns(string& schema, string& tableName, in uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector& condStack) { - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -901,7 +901,6 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector& c while ((item = (Item_field*)field_it++)) { - string tmpTableName = bestTableName(item); //@Bug 5312 populate aliasname with tablename if it is empty @@ -1226,7 +1225,6 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector& c else dmlStatement.set_DMLStatementType(DML_DELETE); - UpdateSqlStatement updateStmt; //@Bug 2753. To make sure the momory is freed. updateStmt.fColAssignmentListPtr = colAssignmentListPtr; @@ -1638,7 +1636,8 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector& c // cout << "doUpdateDelete start new DMLProc client for ctrl-c " << " for session " << sessionID // << endl; VendorDMLStatement cmdStmt("CTRL+C", DML_COMMAND, sessionID); - std::shared_ptr pDMLPackage(CalpontDMLFactory::makeCalpontDMLPackageFromMysqlBuffer(cmdStmt)); + std::shared_ptr pDMLPackage( + CalpontDMLFactory::makeCalpontDMLPackageFromMysqlBuffer(cmdStmt)); pDMLPackage->set_TimeZone(timeZoneOffset); ByteStream bytestream; bytestream << static_cast(sessionID); @@ -1761,7 +1760,8 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector& c if (command != "") { VendorDMLStatement cmdStmt(command, DML_COMMAND, sessionID); - std::shared_ptr pDMLPackage(CalpontDMLFactory::makeCalpontDMLPackageFromMysqlBuffer(cmdStmt)); + std::shared_ptr pDMLPackage( + CalpontDMLFactory::makeCalpontDMLPackageFromMysqlBuffer(cmdStmt)); pDMLPackage->set_TimeZone(timeZoneOffset); pDMLPackage->setTableOid(ci->tableOid); ByteStream bytestream; @@ -2047,7 +2047,8 @@ int ha_mcs_impl_analyze(THD* thd, TABLE* table) query.assign(idb_mysql_query_str(thd)); caep->data(query); - if (!get_fe_conn_info_ptr()) { + if (!get_fe_conn_info_ptr()) + { set_fe_conn_info_ptr(reinterpret_cast(new cal_connection_info(), thd)); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -2110,7 +2111,8 @@ error: return ER_INTERNAL_ERROR; } -int ha_mcs_impl_open(const char* name, int mode, uint32_t test_if_locked) +int ha_mcs_impl_open([[maybe_unused]] const char* name, [[maybe_unused]] int mode, + [[maybe_unused]] uint32_t test_if_locked) { IDEBUG(cout << "ha_mcs_impl_open: " << name << ", " << mode << ", " << test_if_locked << endl); Config::makeConfig(); @@ -2172,7 +2174,6 @@ int ha_mcs_impl_direct_update_delete_rows(bool execute, ha_rows* affected_rows, *affected_rows = ci->affectedRows; } - return rc; } @@ -2188,11 +2189,10 @@ int ha_mcs::impl_rnd_init(TABLE* table, const std::vector& condStack) gwi.thd = thd; if (thd->slave_thread && !get_replication_slave(thd) && - (isDMLStatement(thd->lex->sql_command) || - thd->lex->sql_command == SQLCOM_ALTER_TABLE)) + (isDMLStatement(thd->lex->sql_command) || thd->lex->sql_command == SQLCOM_ALTER_TABLE)) return 0; - // check whether the system is ready to process statement. + // check whether the system is ready to process statement. static DBRM dbrm(true); int bSystemQueryReady = dbrm.getSystemQueryReady(); @@ -2248,7 +2248,8 @@ int ha_mcs::impl_rnd_init(TABLE* table, const std::vector& condStack) boost::shared_ptr csc = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID); csc->identity(CalpontSystemCatalog::FE); - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -2447,9 +2448,9 @@ int ha_mcs::impl_rnd_init(TABLE* table, const std::vector& condStack) ti.conn_hndl = hndl; - using namespace std::chrono_literals; - std::this_thread::sleep_for(100ms); - ntries --; + using namespace std::chrono_literals; + std::this_thread::sleep_for(100ms); + ntries--; try { @@ -2577,8 +2578,7 @@ int ha_mcs_impl_rnd_next(uchar* buf, TABLE* table, long timeZone) THD* thd = current_thd; if (thd->slave_thread && !get_replication_slave(thd) && - (isDMLStatement(thd->lex->sql_command) || - thd->lex->sql_command == SQLCOM_ALTER_TABLE)) + (isDMLStatement(thd->lex->sql_command) || thd->lex->sql_command == SQLCOM_ALTER_TABLE)) return HA_ERR_END_OF_FILE; if (isMCSTableUpdate(thd) || isMCSTableDelete(thd)) @@ -2589,7 +2589,8 @@ int ha_mcs_impl_rnd_next(uchar* buf, TABLE* table, long timeZone) // if (MIGR::infinidb_vtable.impossibleWhereOnUnion) // return HA_ERR_END_OF_FILE; - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -2660,8 +2661,7 @@ int ha_mcs_impl_rnd_end(TABLE* table, bool is_pushdown_hand) THD* thd = current_thd; if (thd->slave_thread && !get_replication_slave(thd) && - (isDMLStatement(thd->lex->sql_command) || - thd->lex->sql_command == SQLCOM_ALTER_TABLE)) + (isDMLStatement(thd->lex->sql_command) || thd->lex->sql_command == SQLCOM_ALTER_TABLE)) return 0; cal_connection_info* ci = nullptr; @@ -2685,18 +2685,18 @@ int ha_mcs_impl_rnd_end(TABLE* table, bool is_pushdown_hand) if (thd->lex->analyze_stmt && ci->cal_conn_hndl && ci->cal_conn_hndl->exeMgr) { // The ANALYZE statement leaves ExeMgr hanging. This clears it up. - ci->cal_conn_hndl->exeMgr->read(); // Ignore the returned buffer + ci->cal_conn_hndl->exeMgr->read(); // Ignore the returned buffer ByteStream msg; - ByteStream::quadbyte qb = 1; // Tell PrimProc front session to eat all the rows + ByteStream::quadbyte qb = 1; // Tell PrimProc front session to eat all the rows msg << qb; ci->cal_conn_hndl->exeMgr->write(msg); // This is the command to start sending return values. because we previously sent the swallow // rows command, there won't be anything useful coming back, but it needs this to flush internal queues. - qb = 5; // Read the result data. + qb = 5; // Read the result data. msg.reset(); msg << qb; ci->cal_conn_hndl->exeMgr->write(msg); - qb = 0; // End the query + qb = 0; // End the query msg.reset(); msg << qb; ci->cal_conn_hndl->exeMgr->write(msg); @@ -2748,7 +2748,6 @@ int ha_mcs_impl_rnd_end(TABLE* table, bool is_pushdown_hand) ti.conn_hndl = hndl; else ci->cal_conn_hndl = hndl; - } catch (IDBExcept& e) { @@ -2796,7 +2795,8 @@ int ha_mcs_impl_create(const char* name, TABLE* table_arg, HA_CREATE_INFO* creat { THD* thd = current_thd; - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -2840,7 +2840,8 @@ int ha_mcs_impl_delete_table(const char* name) if (!memcmp((uchar*)name, tmp_file_prefix, tmp_file_prefix_length)) return 0; - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -2905,7 +2906,8 @@ int ha_mcs_impl_write_row(const uchar* buf, TABLE* table, uint64_t rows_changed, return ER_CHECK_NOT_IMPLEMENTED; } - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -2958,7 +2960,8 @@ int ha_mcs_impl_write_row(const uchar* buf, TABLE* table, uint64_t rows_changed, int ha_mcs_impl_update_row() { - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -2974,7 +2977,8 @@ int ha_mcs_impl_update_row() int ha_mcs_impl_delete_row() { - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -2995,7 +2999,8 @@ void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_ins if (thd->slave_thread && !get_replication_slave(thd)) return; - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -3122,7 +3127,7 @@ void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_ins ci->useXbit = false; //@bug 6122 Check how many columns have not null constraint. columnn with not null constraint will not - //show up in header. + // show up in header. unsigned int numberNotNull = 0; for (unsigned int j = 0; j < colrids.size(); j++) @@ -3279,9 +3284,8 @@ void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_ins int execvErrno = errno; ostringstream oss; - oss << " : execvp error: cpimport.bin invocation failed; " - << "(errno-" << errno << "); " << strerror(execvErrno) - << "; Check file and try invoking locally."; + oss << " : execvp error: cpimport.bin invocation failed; " << "(errno-" << errno << "); " + << strerror(execvErrno) << "; Check file and try invoking locally."; cout << oss.str(); setError(current_thd, ER_INTERNAL_ERROR, "Forking process cpimport failed."); @@ -3300,7 +3304,6 @@ void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_ins // Set read_set used for bulk insertion of Fields inheriting // from Field_blob|Field_varstring. Used in ColWriteBatchString() bitmap_set_all(table->read_set); - } else { @@ -3416,7 +3419,8 @@ int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table) std::string aTmpDir(startup::StartUp::tmpDir()); - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -3442,7 +3446,6 @@ int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table) ((thd->lex)->sql_command == SQLCOM_LOAD) || ((thd->lex)->sql_command == SQLCOM_INSERT_SELECT) || ci->isCacheInsert)) { - if ((thd->killed > 0) && (ci->cpimport_pid > 0)) // handle CTRL-C { // cout << "sending ctrl-c to cpimport" << endl; @@ -3521,12 +3524,9 @@ int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table) else { ostringstream oss; - oss << "End SQL statement with error, rc=" << rc - << ", aPid=" << aPid - << ", WIF=" << WIFEXITED(aStatus) - << ", WEXIT=" << WEXITSTATUS(aStatus); - ha_mcs_impl::log_this(thd, oss.str().c_str(), logging::LOG_TYPE_DEBUG, - tid2sid(thd->thread_id)); + oss << "End SQL statement with error, rc=" << rc << ", aPid=" << aPid + << ", WIF=" << WIFEXITED(aStatus) << ", WEXIT=" << WEXITSTATUS(aStatus); + ha_mcs_impl::log_this(thd, oss.str().c_str(), logging::LOG_TYPE_DEBUG, tid2sid(thd->thread_id)); } ci->columnTypes.clear(); @@ -3612,7 +3612,8 @@ int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table) int ha_mcs_impl_commit(handlerton* hton, THD* thd, bool all) { - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -3647,7 +3648,8 @@ int ha_mcs_impl_commit(handlerton* hton, THD* thd, bool all) int ha_mcs_impl_rollback(handlerton* hton, THD* thd, bool all) { - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -3719,7 +3721,8 @@ int ha_mcs_impl_rename_table(const char* from, const char* to) { IDEBUG(cout << "ha_mcs_impl_rename_table: " << from << " => " << to << endl); - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -3745,7 +3748,7 @@ int ha_mcs_impl_rename_table(const char* from, const char* to) return rc; } -int ha_mcs_impl_delete_row(const uchar* buf) +int ha_mcs_impl_delete_row(const uchar* /*buf*/) { IDEBUG(cout << "ha_mcs_impl_delete_row" << endl); return 0; @@ -3753,8 +3756,7 @@ int ha_mcs_impl_delete_row(const uchar* buf) // this place is as good as any. ext_cond_info::ext_cond_info(long timeZone) - : chainHolder(new SubQueryChainHolder()) - , gwi(timeZone, &chainHolder->chain) + : chainHolder(new SubQueryChainHolder()), gwi(timeZone, &chainHolder->chain) { } @@ -3772,7 +3774,8 @@ COND* ha_mcs_impl_cond_push(COND* cond, TABLE* table, std::vector& condSt alias.assign(table->alias.ptr(), table->alias.length()); IDEBUG(cout << "ha_mcs_impl_cond_push: " << alias << endl); - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -3883,7 +3886,8 @@ int ha_mcs::impl_external_lock(THD* thd, TABLE* table, int lock_type) alias.assign(table->alias.ptr(), table->alias.length()); IDEBUG(cout << "external_lock for " << alias << endl); - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -3997,7 +4001,7 @@ int ha_mcs::impl_external_lock(THD* thd, TABLE* table, int lock_type) } // for sorting length exceeds blob limit. Just error out for now. -int ha_mcs_impl_rnd_pos(uchar* buf, uchar* pos) +int ha_mcs_impl_rnd_pos(uchar* /*buf*/, uchar* /*pos*/) { IDEBUG(cout << "ha_mcs_impl_rnd_pos" << endl); string emsg = logging::IDBErrorInfo::instance()->errorMsg(ERR_ORDERBY_TOO_BIG); @@ -4072,7 +4076,8 @@ int ha_mcs_impl_pushdown_init(mcs_handler_info* handler_info, TABLE* table, bool boost::shared_ptr csc = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID); csc->identity(CalpontSystemCatalog::FE); - if (!get_fe_conn_info_ptr()) { + if (!get_fe_conn_info_ptr()) + { set_fe_conn_info_ptr(reinterpret_cast(new cal_connection_info(), thd)); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -4363,9 +4368,9 @@ int ha_mcs_impl_pushdown_init(mcs_handler_info* handler_info, TABLE* table, bool ci->cal_conn_hndl = hndl; - using namespace std::chrono_literals; - std::this_thread::sleep_for(100ms); - ntries --; + using namespace std::chrono_literals; + std::this_thread::sleep_for(100ms); + ntries--; try { @@ -4493,7 +4498,8 @@ int ha_mcs_impl_select_next(uchar* buf, TABLE* table, long timeZone) int rc = HA_ERR_END_OF_FILE; - if (get_fe_conn_info_ptr() == nullptr) { + if (get_fe_conn_info_ptr() == nullptr) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr()); } diff --git a/dbcon/mysql/ha_mcs_logging.h b/dbcon/mysql/ha_mcs_logging.h index c6e48dc23..10ad9e278 100644 --- a/dbcon/mysql/ha_mcs_logging.h +++ b/dbcon/mysql/ha_mcs_logging.h @@ -32,7 +32,7 @@ */ namespace ha_mcs_impl { -inline void log_this(THD* thd, const char* message, logging::LOG_TYPE log_type, unsigned sid) +inline void log_this(THD* /*thd*/, const char* message, logging::LOG_TYPE log_type, unsigned sid) { // corresponds with dbcon in SubsystemID vector // in messagelog.cpp diff --git a/dbcon/mysql/ha_mcs_partition.cpp b/dbcon/mysql/ha_mcs_partition.cpp index 0a4538e74..6835fa83c 100644 --- a/dbcon/mysql/ha_mcs_partition.cpp +++ b/dbcon/mysql/ha_mcs_partition.cpp @@ -546,7 +546,7 @@ extern "C" * CalShowPartitions */ - my_bool calshowpartitions_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool calshowpartitions_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count < 2 || args->arg_count > 3 || args->arg_type[0] != STRING_RESULT || args->arg_type[1] != STRING_RESULT || (args->arg_count == 3 && args->arg_type[2] != STRING_RESULT)) @@ -573,7 +573,7 @@ extern "C" } const char* calshowpartitions(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + char* /*is_null*/, char* /*error*/) { BRM::DBRM::refreshShmWithLock(); DBRM em; @@ -735,8 +735,8 @@ extern "C" return 0; } - const char* caldisablepartitions(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* caldisablepartitions(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, unsigned long* length, + char* /*is_null*/, char* /*error*/) { CalpontSystemCatalog::TableName tableName; set partitionNums; @@ -772,7 +772,7 @@ extern "C" return result; } - void caldisablepartitions_deinit(UDF_INIT* initid) + void caldisablepartitions_deinit(UDF_INIT* /*initid*/) { } @@ -814,8 +814,8 @@ extern "C" return 0; } - const char* calenablepartitions(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* calenablepartitions(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, unsigned long* length, + char* /*is_null*/, char* /*error*/) { CalpontSystemCatalog::TableName tableName; string errMsg; @@ -851,7 +851,7 @@ extern "C" return result; } - void calenablepartitions_deinit(UDF_INIT* initid) + void calenablepartitions_deinit(UDF_INIT* /*initid*/) { } @@ -893,8 +893,8 @@ extern "C" return 0; } - const char* caldroppartitions(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* caldroppartitions(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, unsigned long* length, + char* /*is_null*/, char* /*error*/) { CalpontSystemCatalog::TableName tableName; string errMsg; @@ -930,7 +930,7 @@ extern "C" return result; } - void caldroppartitions_deinit(UDF_INIT* initid) + void caldroppartitions_deinit(UDF_INIT* /*initid*/) { } @@ -938,7 +938,7 @@ extern "C" * CalDropPartitionsByValue */ - void caldroppartitionsbyvalue_deinit(UDF_INIT* initid) + void caldroppartitionsbyvalue_deinit(UDF_INIT* /*initid*/) { } @@ -979,8 +979,8 @@ extern "C" return 0; } - const char* caldroppartitionsbyvalue(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* caldroppartitionsbyvalue(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, + unsigned long* length, char* /*is_null*/, char* /*error*/) { string msg; CalpontSystemCatalog::TableName tableName; @@ -1005,7 +1005,7 @@ extern "C" * CalDisablePartitionsByValue */ - void caldisablepartitionsbyvalue_deinit(UDF_INIT* initid) + void caldisablepartitionsbyvalue_deinit(UDF_INIT* /*initid*/) { } @@ -1042,8 +1042,8 @@ extern "C" return 0; } - const char* caldisablepartitionsbyvalue(UDF_INIT* initid, UDF_ARGS* args, char* result, - unsigned long* length, char* is_null, char* error) + const char* caldisablepartitionsbyvalue(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, + unsigned long* length, char* /*is_null*/, char* /*error*/) { string msg; set partSet; @@ -1067,7 +1067,7 @@ extern "C" /** * CalEnablePartitionsByValue */ - void calenablepartitionsbyvalue_deinit(UDF_INIT* initid) + void calenablepartitionsbyvalue_deinit(UDF_INIT* /*initid*/) { } @@ -1104,8 +1104,8 @@ extern "C" return 0; } - const char* calenablepartitionsbyvalue(UDF_INIT* initid, UDF_ARGS* args, char* result, - unsigned long* length, char* is_null, char* error) + const char* calenablepartitionsbyvalue(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, + unsigned long* length, char* /*is_null*/, char* /*error*/) { string msg; set partSet; @@ -1168,7 +1168,7 @@ extern "C" } const char* calshowpartitionsbyvalue(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + char* /*is_null*/, char* /*error*/) { BRM::DBRM::refreshShmWithLock(); DBRM em; diff --git a/dbcon/mysql/ha_mcs_pushdown.h b/dbcon/mysql/ha_mcs_pushdown.h index 6be7d64b9..2ca977535 100644 --- a/dbcon/mysql/ha_mcs_pushdown.h +++ b/dbcon/mysql/ha_mcs_pushdown.h @@ -110,7 +110,6 @@ class ha_mcs_group_by_handler : public group_by_handler class ha_columnstore_derived_handler : public derived_handler { private: - COLUMNSTORE_SHARE* share; long time_zone; public: @@ -138,7 +137,6 @@ class ha_columnstore_derived_handler : public derived_handler class ha_columnstore_select_handler : public select_handler { private: - COLUMNSTORE_SHARE* share; bool prepared; bool scan_ended; long time_zone; diff --git a/dbcon/mysql/ha_mcs_sysvars.cpp b/dbcon/mysql/ha_mcs_sysvars.cpp index 3c22e9be1..aaeecbc04 100644 --- a/dbcon/mysql/ha_mcs_sysvars.cpp +++ b/dbcon/mysql/ha_mcs_sysvars.cpp @@ -281,7 +281,7 @@ void set_fe_conn_info_ptr(void* ptr, THD* thd) THDVAR(thd, fe_conn_info_ptr) = (uint64_t)(ptr); } -ulonglong get_original_optimizer_flags(THD* thd) +ulonglong get_original_optimizer_flags(THD* /*thd*/) { return THDVAR(current_thd, original_optimizer_flags); } diff --git a/dbcon/mysql/ha_pseudocolumn.cpp b/dbcon/mysql/ha_pseudocolumn.cpp index 1da0eaa01..459085d1e 100644 --- a/dbcon/mysql/ha_pseudocolumn.cpp +++ b/dbcon/mysql/ha_pseudocolumn.cpp @@ -1,6 +1,6 @@ #define PREFER_MY_CONFIG_H #include -//#include +// #include #include #include using namespace std; @@ -54,7 +54,8 @@ void bailout(char* error, const string& funcName) int64_t idblocalpm() { - if (get_fe_conn_info_ptr() == NULL) { + if (get_fe_conn_info_ptr() == NULL) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr()); } @@ -79,7 +80,7 @@ extern "C" /** * IDBDBROOT */ - my_bool idbdbroot_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool idbdbroot_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -90,11 +91,11 @@ extern "C" return 0; } - void idbdbroot_deinit(UDF_INIT* initid) + void idbdbroot_deinit(UDF_INIT* /*initid*/) { } - long long idbdbroot(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long idbdbroot(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error) { bailout(error, "idbdbroot"); return 0; @@ -104,7 +105,7 @@ extern "C" * IDBPM */ - my_bool idbpm_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool idbpm_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -115,11 +116,11 @@ extern "C" return 0; } - void idbpm_deinit(UDF_INIT* initid) + void idbpm_deinit(UDF_INIT* /*initid*/) { } - long long idbpm(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long idbpm(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error) { bailout(error, "idbpm"); return 0; @@ -129,7 +130,7 @@ extern "C" * IDBEXTENTRELATIVERID */ - my_bool idbextentrelativerid_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool idbextentrelativerid_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -140,11 +141,11 @@ extern "C" return 0; } - void idbextentrelativerid_deinit(UDF_INIT* initid) + void idbextentrelativerid_deinit(UDF_INIT* /*initid*/) { } - long long idbextentrelativerid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long idbextentrelativerid(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error) { bailout(error, "idbextentrelativerid"); return 0; @@ -154,7 +155,7 @@ extern "C" * IDBBLOCKID */ - my_bool idbblockid_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool idbblockid_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -165,11 +166,11 @@ extern "C" return 0; } - void idbblockid_deinit(UDF_INIT* initid) + void idbblockid_deinit(UDF_INIT* /*initid*/) { } - long long idbblockid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long idbblockid(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error) { bailout(error, "idbblockid"); return 0; @@ -179,7 +180,7 @@ extern "C" * IDBEXTENTID */ - my_bool idbextentid_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool idbextentid_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -190,11 +191,11 @@ extern "C" return 0; } - void idbextentid_deinit(UDF_INIT* initid) + void idbextentid_deinit(UDF_INIT* /*initid*/) { } - long long idbextentid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long idbextentid(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error) { bailout(error, "idbextentid"); return 0; @@ -204,7 +205,7 @@ extern "C" * IDBSEGMENT */ - my_bool idbsegment_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool idbsegment_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -215,11 +216,11 @@ extern "C" return 0; } - void idbsegment_deinit(UDF_INIT* initid) + void idbsegment_deinit(UDF_INIT* /*initid*/) { } - long long idbsegment(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long idbsegment(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error) { bailout(error, "idbsegment"); return 0; @@ -229,7 +230,7 @@ extern "C" * IDBSEGMENTDIR */ - my_bool idbsegmentdir_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool idbsegmentdir_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -240,11 +241,11 @@ extern "C" return 0; } - void idbsegmentdir_deinit(UDF_INIT* initid) + void idbsegmentdir_deinit(UDF_INIT* /*initid*/) { } - long long idbsegmentdir(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long idbsegmentdir(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error) { bailout(error, "idbsegmentdir"); return 0; @@ -254,7 +255,7 @@ extern "C" * IDBPARTITION */ - my_bool idbpartition_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool idbpartition_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -265,12 +266,12 @@ extern "C" return 0; } - void idbpartition_deinit(UDF_INIT* initid) + void idbpartition_deinit(UDF_INIT* /*initid*/) { } - const char* idbpartition(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* idbpartition(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* result, unsigned long* /*length*/, + char* /*is_null*/, char* error) { bailout(error, "idbpartition"); return result; @@ -280,7 +281,7 @@ extern "C" * IDBEXTENTMIN */ - my_bool idbextentmin_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool idbextentmin_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -292,12 +293,12 @@ extern "C" return 0; } - void idbextentmin_deinit(UDF_INIT* initid) + void idbextentmin_deinit(UDF_INIT* /*initid*/) { } - const char* idbextentmin(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* idbextentmin(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* result, unsigned long* /*length*/, + char* /*is_null*/, char* error) { bailout(error, "idbextentmin"); return result; @@ -307,7 +308,7 @@ extern "C" * IDBEXTENTMAX */ - my_bool idbextentmax_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool idbextentmax_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -319,12 +320,12 @@ extern "C" return 0; } - void idbextentmax_deinit(UDF_INIT* initid) + void idbextentmax_deinit(UDF_INIT* /*initid*/) { } - const char* idbextentmax(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, - char* is_null, char* error) + const char* idbextentmax(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* result, unsigned long* /*length*/, + char* /*is_null*/, char* error) { bailout(error, "idbextentmax"); return result; @@ -334,7 +335,7 @@ extern "C" * IDBLOCALPM */ - my_bool idblocalpm_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool idblocalpm_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 0) { @@ -346,11 +347,11 @@ extern "C" return 0; } - void idblocalpm_deinit(UDF_INIT* initid) + void idblocalpm_deinit(UDF_INIT* /*initid*/) { } - long long idblocalpm(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long idblocalpm(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* is_null, char* /*error*/) { longlong localpm = idblocalpm(); @@ -378,10 +379,11 @@ uint32_t isPseudoColumn(string funcName) return execplan::PseudoColumn::pseudoNameToType(funcName); } -execplan::ReturnedColumn* buildPseudoColumn(Item* item, gp_walk_info& gwi, bool& nonSupport, +execplan::ReturnedColumn* buildPseudoColumn(Item* item, gp_walk_info& gwi, bool& /*nonSupport*/, uint32_t pseudoType) { - if (get_fe_conn_info_ptr() == NULL) { + if (get_fe_conn_info_ptr() == NULL) + { set_fe_conn_info_ptr((void*)new cal_connection_info()); thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr()); } diff --git a/dbcon/mysql/ha_subquery.h b/dbcon/mysql/ha_subquery.h index 688c64771..403881e21 100644 --- a/dbcon/mysql/ha_subquery.h +++ b/dbcon/mysql/ha_subquery.h @@ -61,7 +61,7 @@ class SubQuery { fCorrelated = correlated; } - virtual void handleFunc(gp_walk_info* gwip, Item_func* func) + virtual void handleFunc(gp_walk_info* /*gwip*/, Item_func* /*func*/) { } virtual void handleNot() @@ -69,6 +69,7 @@ class SubQuery } SubQuery* next; + protected: gp_walk_info& fGwip; bool fCorrelated; @@ -77,8 +78,10 @@ class SubQuery struct SubQueryChainHolder { SubQuery* chain; - SubQueryChainHolder () : chain(nullptr) { } - ~SubQueryChainHolder () + SubQueryChainHolder() : chain(nullptr) + { + } + ~SubQueryChainHolder() { while (chain) { @@ -89,7 +92,6 @@ struct SubQueryChainHolder } }; - /** * @brief A class to represent a generic WHERE clause subquery */ diff --git a/dbcon/mysql/ha_tzinfo.cpp b/dbcon/mysql/ha_tzinfo.cpp index b866e9db6..6f59a0b57 100644 --- a/dbcon/mysql/ha_tzinfo.cpp +++ b/dbcon/mysql/ha_tzinfo.cpp @@ -24,7 +24,10 @@ #define TRUE (1) /* Logical true */ #define FALSE (0) /* Logical false */ #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include +#pragma GCC diagnostic pop // static HASH tz_names; // static HASH offset_tzs; diff --git a/dbcon/mysql/idb_mysql.h b/dbcon/mysql/idb_mysql.h index 812c049b0..a89814788 100644 --- a/dbcon/mysql/idb_mysql.h +++ b/dbcon/mysql/idb_mysql.h @@ -24,9 +24,8 @@ #error mcsconfig.h was included before idb_mysql.h #endif - -//#define INFINIDB_DEBUG -//#define DEBUG_WALK_COND +// #define INFINIDB_DEBUG +// #define DEBUG_WALK_COND #define MYSQL_SERVER 1 // needed for definition of struct THD in mysql_priv.h #define USE_CALPONT_REGEX @@ -56,14 +55,19 @@ #include "sql_plugin.h" #include "sql_table.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include "sql_select.h" -#include "mysqld_error.h" #include "item_windowfunc.h" +#include "rpl_rli.h" +#pragma GCC diagnostic pop + +#include "mysqld_error.h" #include "sql_cte.h" #include "tztime.h" #include "derived_handler.h" #include "select_handler.h" -#include "rpl_rli.h" + #include "my_dbug.h" #include "sql_show.h" @@ -101,4 +105,3 @@ inline char* idb_mysql_query_str(THD* thd) #endif } } // namespace - diff --git a/dbcon/mysql/sm.cpp b/dbcon/mysql/sm.cpp index caf6f156e..58ab93681 100644 --- a/dbcon/mysql/sm.cpp +++ b/dbcon/mysql/sm.cpp @@ -316,7 +316,7 @@ status_t tpl_open(tableid_t tableid, sp_cpsm_tplh_t& ntplh, cpsm_conhdl_t* conn_ return STATUS_OK; } -status_t tpl_scan_open(tableid_t tableid, sp_cpsm_tplsch_t& ntplsch, cpsm_conhdl_t* conn_hdl) +status_t tpl_scan_open(tableid_t tableid, sp_cpsm_tplsch_t& ntplsch, cpsm_conhdl_t* /*conn_hdl*/) { #if IDB_SM_DEBUG SMDEBUGLOG << "tpl_scan_open: " << conn_hdl << " tableid: " << tableid << endl; @@ -495,7 +495,6 @@ void cpsm_conhdl_t::write(ByteStream bs) if (sigFlag) throw runtime_error("Broken Pipe Error"); - } -} +} // namespace sm diff --git a/ddlproc/ddlproc.cpp b/ddlproc/ddlproc.cpp index bea5aaf53..f58de6078 100644 --- a/ddlproc/ddlproc.cpp +++ b/ddlproc/ddlproc.cpp @@ -40,8 +40,8 @@ using namespace oam; #include "distributedenginecomm.h" using namespace joblist; -//#include "boost/filesystem/operations.hpp" -//#include "boost/filesystem/path.hpp" +// #include "boost/filesystem/operations.hpp" +// #include "boost/filesystem/path.hpp" #include #include #include @@ -97,7 +97,7 @@ class ServiceDDLProc : public Service, public Opt protected: void setupChildSignalHandlers(); - void log(logging::LOG_TYPE type, const std::string& str) + void log(logging::LOG_TYPE /*type*/, const std::string& str) { LoggingID logid(23, 0, 0); Message::Args args; diff --git a/dmlproc/dmlproc.cpp b/dmlproc/dmlproc.cpp index 3931297d6..dec25979f 100644 --- a/dmlproc/dmlproc.cpp +++ b/dmlproc/dmlproc.cpp @@ -25,8 +25,8 @@ #include #include #include -//#include "boost/filesystem/operations.hpp" -//#include "boost/filesystem/path.hpp" +// #include "boost/filesystem/operations.hpp" +// #include "boost/filesystem/path.hpp" using namespace std; #include "liboamcpp.h" @@ -123,7 +123,7 @@ class ServiceDMLProc : public Service, public Opt return Service::Parent(); } - void log(logging::LOG_TYPE type, const std::string& str) + void log(logging::LOG_TYPE /*type*/, const std::string& str) { LoggingID logid(23, 0, 0); Message::Args args; diff --git a/dmlproc/dmlprocessor.cpp b/dmlproc/dmlprocessor.cpp index 833705b68..765f5f19f 100644 --- a/dmlproc/dmlprocessor.cpp +++ b/dmlproc/dmlprocessor.cpp @@ -25,7 +25,7 @@ #include #include -//#define SERIALIZE_DDL_DML_CPIMPORT 1 +// #define SERIALIZE_DDL_DML_CPIMPORT 1 #include #include #include @@ -313,7 +313,7 @@ struct CancellationThread PackageHandler::PackageHandler(const messageqcpp::IOSocket& ios, boost::shared_ptr bs, uint8_t packageType, joblist::DistributedEngineComm* ec, bool concurrentSupport, - uint64_t maxDeleteRows, uint32_t sessionID, + uint64_t /*maxDeleteRows*/, uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnId, DBRM* aDbrm, const QueryTeleClient& qtc, boost::shared_ptr csc) @@ -322,7 +322,6 @@ PackageHandler::PackageHandler(const messageqcpp::IOSocket& ios, , fPackageType(packageType) , fEC(ec) , fConcurrentSupport(concurrentSupport) - , fMaxDeleteRows(maxDeleteRows) , fSessionID(sessionID) , fTableOid(0) , fTxnid(txnId) @@ -1317,9 +1316,7 @@ int DMLServer::start() } DMLProcessor::DMLProcessor(messageqcpp::IOSocket ios, BRM::DBRM* aDbrm) - : fIos(ios) - , fDbrm(aDbrm) - , fConcurrentSupport(false) + : fIos(ios), fDbrm(aDbrm), fConcurrentSupport(false) { csc = CalpontSystemCatalog::makeCalpontSystemCatalog(); csc->identity(CalpontSystemCatalog::EC); diff --git a/dmlproc/dmlprocessor.h b/dmlproc/dmlprocessor.h index 6f21d8d9a..3492bcfa5 100644 --- a/dmlproc/dmlprocessor.h +++ b/dmlproc/dmlprocessor.h @@ -214,7 +214,6 @@ class PackageHandler messageqcpp::ByteStream::quadbyte fPackageType; joblist::DistributedEngineComm* fEC; bool fConcurrentSupport; - uint64_t fMaxDeleteRows; uint32_t fSessionID; uint32_t fTableOid; execplan::CalpontSystemCatalog::SCN fTxnid; @@ -330,7 +329,7 @@ class RollbackTransactionProcessor : public dmlpackageprocessor::DMLPackageProce * * @param cpackage the UpdateDMLPackage to process */ - DMLResult processPackageInternal(dmlpackage::CalpontDMLPackage& cpackage) + DMLResult processPackageInternal(dmlpackage::CalpontDMLPackage& /*cpackage*/) { DMLResult result; result.result = NO_ERROR; diff --git a/oam/oamcpp/liboamcpp.cpp b/oam/oamcpp/liboamcpp.cpp index 2c9bb395e..60b704780 100644 --- a/oam/oamcpp/liboamcpp.cpp +++ b/oam/oamcpp/liboamcpp.cpp @@ -79,7 +79,7 @@ uint32_t ctrlc = 0; // Signal handler to catch Control-C signal to terminate the process // while waiting for a shutdown or suspend action //------------------------------------------------------------------------------ -void handleControlC(int i) +void handleControlC(int /*i*/) { std::cout << "Received Control-C to terminate the command..." << std::endl; ctrlc = 1; diff --git a/primitives/blockcache/fileblockrequestqueue.h b/primitives/blockcache/fileblockrequestqueue.h index fb8febfd2..fa70319b3 100644 --- a/primitives/blockcache/fileblockrequestqueue.h +++ b/primitives/blockcache/fileblockrequestqueue.h @@ -95,11 +95,8 @@ class fileBlockRequestQueue uint32_t readersWaiting; private: - // do not implement - fileBlockRequestQueue(const fileBlockRequestQueue& Q) - { - } - const fileBlockRequestQueue& operator=(const fileBlockRequestQueue& Q); + fileBlockRequestQueue(const fileBlockRequestQueue&) = delete; + const fileBlockRequestQueue& operator=(const fileBlockRequestQueue&) = delete; /** * @brief pointer to the next request to be popped from the queue diff --git a/primitives/linux-port/column.cpp b/primitives/linux-port/column.cpp index a78ddd978..672dd8cd1 100644 --- a/primitives/linux-port/column.cpp +++ b/primitives/linux-port/column.cpp @@ -18,7 +18,7 @@ #include #include -//#define NDEBUG +// #define NDEBUG #include #include #include @@ -174,7 +174,7 @@ inline bool colCompare_(const T& val1, const T& val2, uint8_t COP) } inline bool colCompareStr(const ColRequestHeaderDataType& type, uint8_t COP, const utils::ConstString& val1, - const utils::ConstString& val2, const bool printOut = false) + const utils::ConstString& val2, const bool /*printOut*/ = false) { int error = 0; bool rc = primitives::StringComparator(type).op(&error, COP, val1, val2); @@ -283,8 +283,8 @@ inline bool isMinMaxValid(const NewColRequestHeader* in) template ::type* = nullptr> -inline bool colCompareDispatcherT(T1 columnValue, T2 filterValue, uint8_t cop, uint8_t rf, - const ColRequestHeaderDataType& typeHolder, T1 nullValue) +inline bool colCompareDispatcherT(T1 columnValue, T2 filterValue, uint8_t cop, uint8_t /*rf*/, + const ColRequestHeaderDataType& /*typeHolder*/, T1 /*nullValue*/) { float dVal1 = *((float*)&columnValue); float dVal2 = *((float*)&filterValue); @@ -294,8 +294,8 @@ inline bool colCompareDispatcherT(T1 columnValue, T2 filterValue, uint8_t cop, u template ::type* = nullptr> -inline bool colCompareDispatcherT(T1 columnValue, T2 filterValue, uint8_t cop, uint8_t rf, - const ColRequestHeaderDataType& typeHolder, T1 nullValue) +inline bool colCompareDispatcherT(T1 columnValue, T2 filterValue, uint8_t cop, uint8_t /*rf*/, + const ColRequestHeaderDataType& /*typeHolder*/, T1 /*nullValue*/) { double dVal1 = *((double*)&columnValue); double dVal2 = *((double*)&filterValue); @@ -346,7 +346,7 @@ inline bool isNullValue(const T val, const T NULL_VALUE) template ::type* = nullptr> inline bool colCompareDispatcherT(T1 columnValue, T2 filterValue, uint8_t cop, uint8_t rf, - const ColRequestHeaderDataType& typeHolder, T1 nullValue) + const ColRequestHeaderDataType& /*typeHolder*/, T1 nullValue) { const bool isVal2Null = isNullValue(filterValue, (T2)nullValue); @@ -375,7 +375,7 @@ inline bool colCompareDispatcherT(T1 columnValue, T2 filterValue, uint8_t cop, u template ::type* = nullptr> inline bool colCompareDispatcherT(T1 columnValue, T2 filterValue, uint8_t cop, uint8_t rf, - const ColRequestHeaderDataType& typeHolder, T1 nullValue) + const ColRequestHeaderDataType& /*typeHolder*/, T1 nullValue) { const bool isVal2Null = isNullValue(filterValue, (T2)nullValue); @@ -394,7 +394,7 @@ inline bool colCompareDispatcherT(T1 columnValue, T2 filterValue, uint8_t cop, u template ::type* = nullptr> inline bool colCompareDispatcherT(T1 columnValue, T2 filterValue, uint8_t cop, uint8_t rf, - const ColRequestHeaderDataType& typeHolder, T1 nullValue) + const ColRequestHeaderDataType& /*typeHolder*/, T1 nullValue) { const bool isVal2Null = isNullValue(filterValue, (T2)nullValue); @@ -428,7 +428,7 @@ inline bool colCompare(T1 columnValue, T2 filterValue, uint8_t cop, uint8_t rf, // Bit pattern representing EMPTY value for given column type/width // TBD Use typeHandler template ::type* = nullptr> -T getEmptyValue(uint8_t type) +T getEmptyValue(uint8_t /*type*/) { return datatypes::Decimal128Empty; } @@ -526,7 +526,8 @@ T getEmptyValue(uint8_t type) // template ::type* = nullptr> -inline bool noneValuesInArray(const T curValue, const FT* filterValues, const uint32_t filterCount) +inline bool noneValuesInArray(const T /*curValue*/, const FT* /*filterValues*/, + const uint32_t /*filterCount*/) { // ignore NULLs in the array and in the column data return false; @@ -546,7 +547,7 @@ inline bool noneValuesInArray(const T curValue, const FT* filterValues, const ui } template ::type* = nullptr> -inline bool noneValuesInSet(const T curValue, const ST* filterSet) +inline bool noneValuesInSet(const T /*curValue*/, const ST* /*filterSet*/) { // bug 1920: ignore NULLs in the set and in the column data return false; @@ -589,9 +590,8 @@ inline bool matchingColValue( { auto filterValue = filterValues[0]; // This can be future optimized checking if a filterValue is NULL or not - bool cmp = - colCompare(curValue, filterValue, filterCOPs[0], filterRFs[0], typeHolder, - NULL_VALUE); + bool cmp = colCompare(curValue, filterValue, filterCOPs[0], filterRFs[0], + typeHolder, NULL_VALUE); return cmp; } @@ -604,8 +604,7 @@ inline bool matchingColValue( // This can be future optimized checking if a filterValues are NULLs or not before the higher level // loop. bool cmp = colCompare(curValue, filterValue, filterCOPs[argIndex], - filterRFs[argIndex], typeHolder, - NULL_VALUE); + filterRFs[argIndex], typeHolder, NULL_VALUE); // Short-circuit the filter evaluation - true || ... == true if (cmp == true) @@ -625,8 +624,7 @@ inline bool matchingColValue( // This can be future optimized checking if a filterValues are NULLs or not before the higher level // loop. bool cmp = colCompare(curValue, filterValue, filterCOPs[argIndex], - filterRFs[argIndex], typeHolder, - NULL_VALUE); + filterRFs[argIndex], typeHolder, NULL_VALUE); // Short-circuit the filter evaluation - false && ... = false if (cmp == false) @@ -648,8 +646,7 @@ inline bool matchingColValue( // This can be future optimized checking if a filterValues are NULLs or not before the higher level // loop. bool cmp = colCompare(curValue, filterValue, filterCOPs[argIndex], - filterRFs[argIndex], typeHolder, - NULL_VALUE); + filterRFs[argIndex], typeHolder, NULL_VALUE); result ^= cmp; } @@ -694,7 +691,8 @@ template (Min, curValue, COMPARE_GT, false, in->colType, DUMMY_NULL_VALUE)) Min = curValue; @@ -703,7 +701,7 @@ inline void updateMinMax(T& Min, T& Max, const T curValue, NewColRequestHeader* } template ::type* = nullptr> -inline void updateMinMax(T& Min, T& Max, const T curValue, NewColRequestHeader* in) +inline void updateMinMax(T& Min, T& Max, const T curValue, NewColRequestHeader* /*in*/) { if (Min > curValue) Min = curValue; @@ -723,20 +721,20 @@ T getInitialMin(NewColRequestHeader* in) } template ::type* = nullptr> -T getInitialMin(NewColRequestHeader* in) +T getInitialMin(NewColRequestHeader* /*in*/) { return datatypes::numeric_limits::max(); } template ::type* = nullptr> -T getInitialMax(NewColRequestHeader* in) +T getInitialMax(NewColRequestHeader* /*in*/) { return datatypes::numeric_limits::min(); } template ::type* = nullptr> -T getInitialMax(NewColRequestHeader* in) +T getInitialMax(NewColRequestHeader* /*in*/) { return 0; } @@ -900,8 +898,8 @@ inline void vectUpdateMinMax(const bool validMinMax, const bool isNonNullOrEmpty // This happens if in->NVALS > 0(HAS_INPUT_RIDS is set). template ::type* = nullptr> -inline void vectUpdateMinMax(const bool validMinMax, const bool isNonNullOrEmpty, T& Min, T& Max, T curValue, - NewColRequestHeader* in) +inline void vectUpdateMinMax(const bool /*validMinMax*/, const bool /*isNonNullOrEmpty*/, T& /*Min*/, + T& /*Max*/, T /*curValue*/, NewColRequestHeader* /*in*/) { // } @@ -910,7 +908,8 @@ template ::type* = nullptr> void vectWriteColValuesLoopRIDAsignment(primitives::RIDType* ridDstArray, ColResultHeader* out, const primitives::RIDType calculatedRID, - const primitives::RIDType* ridSrcArray, const uint32_t srcRIDIdx) + const primitives::RIDType* /*ridSrcArray*/, + const uint32_t /*srcRIDIdx*/) { *ridDstArray = calculatedRID; out->RidFlags |= (1 << (calculatedRID >> 9)); // set the (row/512)'th bit @@ -919,7 +918,7 @@ void vectWriteColValuesLoopRIDAsignment(primitives::RIDType* ridDstArray, ColRes template ::type* = nullptr> void vectWriteColValuesLoopRIDAsignment(primitives::RIDType* ridDstArray, ColResultHeader* out, - const primitives::RIDType calculatedRID, + const primitives::RIDType /*calculatedRID*/, const primitives::RIDType* ridSrcArray, const uint32_t srcRIDIdx) { *ridDstArray = ridSrcArray[srcRIDIdx]; @@ -933,18 +932,19 @@ template ::type* = nullptr> inline uint16_t vectWriteColValues( - VT& simdProcessor, // SIMD processor - const typename VT::MaskType writeMask, // SIMD intrinsics bitmask for values to write - const typename VT::MaskType nonNullOrEmptyMask, // SIMD intrinsics inverce bitmask for NULL/EMPTY values - const bool validMinMax, // The flag to update Min/Max for a block or not - const primitives::RIDType ridOffset, // The first RID value of the dataVecTPtr - T* dataVecTPtr, // Typed SIMD vector from the input block - char* dstArray, // the actual char dst array ptr to start writing values - T& Min, T& Max, // Min/Max of the extent - NewColRequestHeader* in, // Proto message - ColResultHeader* out, // Proto message - primitives::RIDType* ridDstArray, // The actual dst arrray ptr to start writing RIDs - primitives::RIDType* ridSrcArray) // The actual src array ptr to read RIDs + VT& /*simdProcessor*/, // SIMD processor + const typename VT::MaskType writeMask, // SIMD intrinsics bitmask for values to write + const typename VT::MaskType /*nonNullOrEmptyMask*/, // SIMD intrinsics inverce bitmask for NULL/EMPTY + // values + const bool /*validMinMax*/, // The flag to update Min/Max for a block or not + const primitives::RIDType /*ridOffset*/, // The first RID value of the dataVecTPtr + T* dataVecTPtr, // Typed SIMD vector from the input block + char* dstArray, // the actual char dst array ptr to start writing values + T& /*Min*/, T& /*Max*/, // Min/Max of the extent + NewColRequestHeader* /*in*/, // Proto message + ColResultHeader* /*out*/, // Proto message + primitives::RIDType* /*ridDstArray*/, // The actual dst arrray ptr to start writing RIDs + primitives::RIDType* /*ridSrcArray*/) // The actual src array ptr to read RIDs { constexpr const uint16_t FilterMaskStep = VT::FilterMaskStep; T* tmpDstVecTPtr = reinterpret_cast(dstArray); @@ -966,18 +966,19 @@ inline uint16_t vectWriteColValues( template ::type* = nullptr> inline uint16_t vectWriteColValues( - VT& simdProcessor, // SIMD processor - const typename VT::MaskType writeMask, // SIMD intrinsics bitmask for values to write - const typename VT::MaskType nonNullOrEmptyMask, // SIMD intrinsics inverce bitmask for NULL/EMPTY values - const bool validMinMax, // The flag to update Min/Max for a block or not - const primitives::RIDType ridOffset, // The first RID value of the dataVecTPtr - T* dataVecTPtr, // Typed SIMD vector from the input block - char* dstArray, // the actual char dst array ptr to start writing values - T& Min, T& Max, // Min/Max of the extent - NewColRequestHeader* in, // Proto message - ColResultHeader* out, // Proto message - primitives::RIDType* ridDstArray, // The actual dst arrray ptr to start writing RIDs - primitives::RIDType* ridSrcArray) // The actual src array ptr to read RIDs + VT& /*simdProcessor*/, // SIMD processor + const typename VT::MaskType /*writeMask*/, // SIMD intrinsics bitmask for values to write + const typename VT::MaskType /*nonNullOrEmptyMask*/, // SIMD intrinsics inverce bitmask for NULL/EMPTY + // values + const bool /*validMinMax*/, // The flag to update Min/Max for a block or not + const primitives::RIDType /*ridOffset*/, // The first RID value of the dataVecTPtr + T* /*dataVecTPtr*/, // Typed SIMD vector from the input block + char* /*dstArray*/, // the actual char dst array ptr to start writing values + T& /*Min*/, T& /*Max*/, // Min/Max of the extent + NewColRequestHeader* /*in*/, // Proto message + ColResultHeader* /*out*/, // Proto message + primitives::RIDType* /*ridDstArray*/, // The actual dst arrray ptr to start writing RIDs + primitives::RIDType* /*ridSrcArray*/) // The actual src array ptr to read RIDs { return 0; } @@ -986,18 +987,19 @@ inline uint16_t vectWriteColValues( template ::type* = nullptr> inline uint16_t vectWriteColValues( - VT& simdProcessor, // SIMD processor - const typename VT::MaskType writeMask, // SIMD intrinsics bitmask for values to write - const typename VT::MaskType nonNullOrEmptyMask, // SIMD intrinsics inverce bitmask for NULL/EMPTY values - const bool validMinMax, // The flag to update Min/Max for a block or not - const primitives::RIDType ridOffset, // The first RID value of the dataVecTPtr - T* dataVecTPtr, // Typed SIMD vector from the input block - char* dstArray, // the actual char dst array ptr to start writing values - T& Min, T& Max, // Min/Max of the extent - NewColRequestHeader* in, // Proto message - ColResultHeader* out, // Proto message - primitives::RIDType* ridDstArray, // The actual dst arrray ptr to start writing RIDs - primitives::RIDType* ridSrcArray) // The actual src array ptr to read RIDs + VT& /*simdProcessor*/, // SIMD processor + const typename VT::MaskType writeMask, // SIMD intrinsics bitmask for values to write + const typename VT::MaskType /*nonNullOrEmptyMask*/, // SIMD intrinsics inverce bitmask for NULL/EMPTY + // values + const bool /*validMinMax*/, // The flag to update Min/Max for a block or not + const primitives::RIDType ridOffset, // The first RID value of the dataVecTPtr + T* dataVecTPtr, // Typed SIMD vector from the input block + char* dstArray, // the actual char dst array ptr to start writing values + T& /*Min*/, T& /*Max*/, // Min/Max of the extent + NewColRequestHeader* /*in*/, // Proto message + ColResultHeader* out, // Proto message + primitives::RIDType* ridDstArray, // The actual dst arrray ptr to start writing RIDs + primitives::RIDType* ridSrcArray) // The actual src array ptr to read RIDs { constexpr const uint16_t FilterMaskStep = VT::FilterMaskStep; T* tmpDstVecTPtr = reinterpret_cast(dstArray); @@ -1026,18 +1028,19 @@ template ::type* = nullptr> inline uint16_t vectWriteRIDValues( - VT& processor, // SIMD processor - const uint16_t valuesWritten, // The number of values written to in certain SFINAE cases - const bool validMinMax, // The flag to update Min/Max for a block or not + VT& /*processor*/, // SIMD processor + const uint16_t /*valuesWritten*/, // The number of values written to in certain SFINAE cases + const bool /*validMinMax*/, // The flag to update Min/Max for a block or not const primitives::RIDType ridOffset, // The first RID value of the dataVecTPtr - T* dataVecTPtr, // Typed SIMD vector from the input block + T* /*dataVecTPtr*/, // Typed SIMD vector from the input block primitives::RIDType* ridDstArray, // The actual dst arrray ptr to start writing RIDs const typename VT::MaskType writeMask, // SIMD intrinsics bitmask for values to write - T& Min, T& Max, // Min/Max of the extent - NewColRequestHeader* in, // Proto message + T& /*Min*/, T& /*Max*/, // Min/Max of the extent + NewColRequestHeader* /*in*/, // Proto message ColResultHeader* out, // Proto message - const typename VT::MaskType nonNullOrEmptyMask, // SIMD intrinsics inverce bitmask for NULL/EMPTY values - primitives::RIDType* ridSrcArray) // The actual src array ptr to read RIDs + const typename VT::MaskType /*nonNullOrEmptyMask*/, // SIMD intrinsics inverce bitmask for NULL/EMPTY + // values + primitives::RIDType* ridSrcArray) // The actual src array ptr to read RIDs { constexpr const uint16_t FilterMaskStep = VT::FilterMaskStep; primitives::RIDType* origRIDDstArray = ridDstArray; @@ -1062,18 +1065,19 @@ inline uint16_t vectWriteRIDValues( template ::type* = nullptr> inline uint16_t vectWriteRIDValues( - VT& processor, // SIMD processor - const uint16_t valuesWritten, // The number of values written to in certain SFINAE cases - const bool validMinMax, // The flag to update Min/Max for a block or not - const primitives::RIDType ridOffset, // The first RID value of the dataVecTPtr - T* dataVecTPtr, // Typed SIMD vector from the input block - primitives::RIDType* ridDstArray, // The actual dst arrray ptr to start writing RIDs - const typename VT::MaskType writeMask, // SIMD intrinsics bitmask for values to write - T& Min, T& Max, // Min/Max of the extent - NewColRequestHeader* in, // Proto message - ColResultHeader* out, // Proto message - const typename VT::MaskType nonNullOrEmptyMask, // SIMD intrinsics inverce bitmask for NULL/EMPTY values - primitives::RIDType* ridSrcArray) // The actual src array ptr to read RIDs + VT& /*processor*/, // SIMD processor + const uint16_t valuesWritten, // The number of values written to in certain SFINAE cases + const bool /*validMinMax*/, // The flag to update Min/Max for a block or not + const primitives::RIDType /*ridOffset*/, // The first RID value of the dataVecTPtr + T* /*dataVecTPtr*/, // Typed SIMD vector from the input block + primitives::RIDType* /*ridDstArray*/, // The actual dst arrray ptr to start writing RIDs + const typename VT::MaskType /*writeMask*/, // SIMD intrinsics bitmask for values to write + T& /*Min*/, T& /*Max*/, // Min/Max of the extent + NewColRequestHeader* /*in*/, // Proto message + ColResultHeader* /*out*/, // Proto message + const typename VT::MaskType /*nonNullOrEmptyMask*/, // SIMD intrinsics inverce bitmask for NULL/EMPTY + // values + primitives::RIDType* /*ridSrcArray*/) // The actual src array ptr to read RIDs { return valuesWritten; } @@ -1083,18 +1087,19 @@ template ::type* = nullptr> inline uint16_t vectWriteRIDValues( - VT& processor, // SIMD processor - const uint16_t valuesWritten, // The number of values written to in certain SFINAE cases - const bool validMinMax, // The flag to update Min/Max for a block or not - const primitives::RIDType ridOffset, // The first RID value of the dataVecTPtr - T* dataVecTPtr, // Typed SIMD vector from the input block - primitives::RIDType* ridDstArray, // The actual dst arrray ptr to start writing RIDs - const typename VT::MaskType writeMask, // SIMD intrinsics bitmask for values to write - T& Min, T& Max, // Min/Max of the extent - NewColRequestHeader* in, // Proto message - ColResultHeader* out, // Proto message - const typename VT::MaskType nonNullOrEmptyMask, // SIMD intrinsics inverce bitmask for NULL/EMPTY values - primitives::RIDType* ridSrcArray) // The actual src array ptr to read RIDs + VT& /*processor*/, // SIMD processor + const uint16_t valuesWritten, // The number of values written to in certain SFINAE cases + const bool /*validMinMax*/, // The flag to update Min/Max for a block or not + const primitives::RIDType /*ridOffset*/, // The first RID value of the dataVecTPtr + T* /*dataVecTPtr*/, // Typed SIMD vector from the input block + primitives::RIDType* /*ridDstArray*/, // The actual dst arrray ptr to start writing RIDs + const typename VT::MaskType /*writeMask*/, // SIMD intrinsics bitmask for values to write + T& /*Min*/, T& /*Max*/, // Min/Max of the extent + NewColRequestHeader* /*in*/, // Proto message + ColResultHeader* /*out*/, // Proto message + const typename VT::MaskType /*nonNullOrEmptyMask*/, // SIMD intrinsics inverce bitmask for NULL/EMPTY + // values + primitives::RIDType* /*ridSrcArray*/) // The actual src array ptr to read RIDs { return valuesWritten; } @@ -1113,9 +1118,9 @@ void scalarFiltering_( const uint8_t* filterCOPs, // comparison operation const FT* filterValues, // value to compare to const uint8_t* filterRFs, - const ColRequestHeaderDataType& typeHolder, // TypeHolder to use collation-aware ops for char/text. - const T* srcArray, // Input array - const uint32_t srcSize, // ... and its size + const ColRequestHeaderDataType& /*typeHolder*/, // TypeHolder to use collation-aware ops for char/text. + const T* srcArray, // Input array + const uint32_t srcSize, // ... and its size const uint16_t* ridArray, // Optional array of indexes into srcArray, that defines the read order const uint16_t ridSize, // ... and its size const uint32_t initialRID, // The input block idx to start scanning/filter at. @@ -1224,8 +1229,8 @@ void scalarFiltering( template ::type* = nullptr> -inline SIMD_WRAPPER_TYPE simdDataLoad(VT& processor, const T* srcArray, const T* origSrcArray, - const primitives::RIDType* ridArray, const uint16_t iter) +inline SIMD_WRAPPER_TYPE simdDataLoad(VT& processor, const T* srcArray, const T* /*origSrcArray*/, + const primitives::RIDType* /*ridArray*/, const uint16_t /*iter*/) { return {processor.loadFrom(reinterpret_cast(srcArray))}; } @@ -1234,8 +1239,8 @@ inline SIMD_WRAPPER_TYPE simdDataLoad(VT& processor, const T* srcArray, const T* // TODO Move the logic into simd namespace class methods and use intrinsics template ::type* = nullptr> -inline SIMD_WRAPPER_TYPE simdDataLoad(VT& processor, const T* srcArray, const T* origSrcArray, - const primitives::RIDType* ridArray, const uint16_t iter) +inline SIMD_WRAPPER_TYPE simdDataLoad(VT& /*processor*/, const T* /*srcArray*/, const T* origSrcArray, + const primitives::RIDType* ridArray, const uint16_t /*iter*/) { constexpr const uint16_t WIDTH = sizeof(T); constexpr const uint16_t VECTOR_SIZE = VT::vecByteSize / WIDTH; @@ -1252,7 +1257,7 @@ inline SIMD_WRAPPER_TYPE simdDataLoad(VT& processor, const T* srcArray, const T* template ::type* = nullptr> -inline SIMD_WRAPPER_TYPE simdSwapedOrderDataLoad(const ColRequestHeaderDataType& type, VT& processor, +inline SIMD_WRAPPER_TYPE simdSwapedOrderDataLoad(const ColRequestHeaderDataType& /*type*/, VT& /*processor*/, typename VT::SimdType& dataVector) { return {dataVector}; @@ -1260,7 +1265,7 @@ inline SIMD_WRAPPER_TYPE simdSwapedOrderDataLoad(const ColRequestHeaderDataType& template ::type* = nullptr> -inline SIMD_WRAPPER_TYPE simdSwapedOrderDataLoad(const ColRequestHeaderDataType& type, VT& processor, +inline SIMD_WRAPPER_TYPE simdSwapedOrderDataLoad(const ColRequestHeaderDataType& type, VT& /*processor*/, typename VT::SimdType& dataVector) { constexpr const uint16_t WIDTH = sizeof(T); @@ -1311,7 +1316,7 @@ void vectorizedTextUpdateMinMax(const bool validMinMax, const typename VT::MaskT } template -void extractMinMax(VT& simdProcessor, SimdType simdMin, SimdType simdMax, T& min, T& max) +void extractMinMax(VT& /*simdProcessor*/, SimdType simdMin, SimdType simdMax, T& min, T& max) { constexpr const uint16_t size = VT::vecByteSize / sizeof(T); T* simdMinVec = reinterpret_cast(&simdMin); @@ -1321,7 +1326,7 @@ void extractMinMax(VT& simdProcessor, SimdType simdMin, SimdType simdMax, T& min } template -void extractTextMinMax(VT& simdProcessor, SimdType simdMin, SimdType simdMax, SimdType weightsMin, +void extractTextMinMax(VT& /*simdProcessor*/, SimdType simdMin, SimdType simdMax, SimdType weightsMin, SimdType weightsMax, T& min, T& max) { constexpr const uint16_t size = VT::vecByteSize / sizeof(T); @@ -1891,7 +1896,7 @@ template ::type* = nullptr> // gcc >= 5 #else sizeof(T) == sizeof(int128_t), - T>::type*> // gcc 4.8.5 + T>::type*> // gcc 4.8.5 #endif #else sizeof(T) == sizeof(int128_t), @@ -1928,7 +1933,7 @@ template = 5 typename std::enable_if::type* = nullptr> // gcc >= 5 #else - typename std::enable_if::type*> // gcc 4.8.5 + typename std::enable_if::type*> // gcc 4.8.5 #endif #else typename std::enable_if::type* = nullptr> diff --git a/primitives/linux-port/primitiveprocessor.h b/primitives/linux-port/primitiveprocessor.h index ecff92489..db40470c9 100644 --- a/primitives/linux-port/primitiveprocessor.h +++ b/primitives/linux-port/primitiveprocessor.h @@ -469,7 +469,7 @@ class PrimitiveProcessor // Bit pattern representing NULL value for given column type/width // TBD Use TypeHandler template ::type* = nullptr> -T getNullValue(uint8_t type) +T getNullValue(uint8_t /*type*/) { return datatypes::Decimal128Null; } diff --git a/primitives/primproc/batchprimitiveprocessor.h b/primitives/primproc/batchprimitiveprocessor.h index 0fa62f0ff..381fce3d5 100644 --- a/primitives/primproc/batchprimitiveprocessor.h +++ b/primitives/primproc/batchprimitiveprocessor.h @@ -158,7 +158,7 @@ class BatchPrimitiveProcessor return touchedBlocks; } - void setError(const std::string& error, logging::ErrorCodeValues errorCode) + void setError(const std::string& /*error*/, logging::ErrorCodeValues /*errorCode*/) { } @@ -203,7 +203,8 @@ class BatchPrimitiveProcessor void serializeStrings(messageqcpp::SBS& bs); void asyncLoadProjectColumns(); - void writeErrorMsg(messageqcpp::SBS& bs, const std::string& error, uint16_t errCode, bool logIt = true, bool critical = true); + void writeErrorMsg(messageqcpp::SBS& bs, const std::string& error, uint16_t errCode, bool logIt = true, + bool critical = true); BPSOutputType ot; @@ -308,14 +309,14 @@ class BatchPrimitiveProcessor bool hasRowGroup; /* Rowgroups + join */ - using TJoiner = std::unordered_multimap, - utils::STLPoolAllocator>>; - - using TLJoiner = std::unordered_multimap< - joiner::TypelessData, uint32_t, joiner::TupleJoiner::TypelessDataHasher, - joiner::TupleJoiner::TypelessDataComparator, - utils::STLPoolAllocator>>; + using TJoiner = + std::unordered_multimap, + utils::STLPoolAllocator>>; + + using TLJoiner = + std::unordered_multimap>>; bool generateJoinedRowGroup(rowgroup::Row& baseRow, const uint32_t depth = 0); /* generateJoinedRowGroup helper fcns & vars */ diff --git a/primitives/primproc/command.cpp b/primitives/primproc/command.cpp index ab1bc18b8..2357bf48d 100644 --- a/primitives/primproc/command.cpp +++ b/primitives/primproc/command.cpp @@ -39,7 +39,7 @@ void Command::createCommand(ByteStream& bs) bs >> stepUuid; } -void Command::resetCommand(ByteStream& bs){}; +void Command::resetCommand(ByteStream& /*bs*/) {}; void Command::setMakeAbsRids(bool) { diff --git a/primitives/primproc/command.h b/primitives/primproc/command.h index 81f228ac7..fbdf46d53 100644 --- a/primitives/primproc/command.h +++ b/primitives/primproc/command.h @@ -57,7 +57,7 @@ class Command virtual void project(messageqcpp::SBS& bs) = 0; virtual void projectIntoRowGroup(rowgroup::RowGroup& rg, uint32_t columnPosition) = 0; virtual uint64_t getLBID() = 0; - virtual void getLBIDList(uint32_t loopCount, std::vector* out) + virtual void getLBIDList(uint32_t /*loopCount*/, std::vector* /*out*/) { } // the default fcn returns 0 lbids virtual void nextLBID() = 0; diff --git a/primitives/primproc/dictstep.cpp b/primitives/primproc/dictstep.cpp index 1a4753201..53bd4b4cf 100644 --- a/primitives/primproc/dictstep.cpp +++ b/primitives/primproc/dictstep.cpp @@ -104,11 +104,11 @@ void DictStep::createCommand(ByteStream& bs) Command::createCommand(bs); } -void DictStep::resetCommand(ByteStream& bs) +void DictStep::resetCommand(ByteStream& /*bs*/) { } -void DictStep::prep(int8_t outputType, bool makeAbsRids) +void DictStep::prep(int8_t /*outputType*/, bool /*makeAbsRids*/) { // (at most there are 8192 tokens to fetch) bufferSize = sizeof(DictInput) + filterString.length() + (8192 * sizeof(OldGetSigParams)); @@ -188,14 +188,15 @@ void DictStep::copyResultToTmpSpace(OrderedToken* ot) pos += 1; len = *((uint16_t*)pos); pos += 2; - if (!isnull) { + if (!isnull) + { ns.assign(pos, len); } pos += len; ot[rid16].str = ns; - //if (rid64 & 0x8000000000000000LL) - // ot[rid16].str = joblist::CPNULLSTRMARK; + // if (rid64 & 0x8000000000000000LL) + // ot[rid16].str = joblist::CPNULLSTRMARK; } } } diff --git a/primitives/primproc/filtercommand.cpp b/primitives/primproc/filtercommand.cpp index 5587a2c7d..cc83a70fb 100644 --- a/primitives/primproc/filtercommand.cpp +++ b/primitives/primproc/filtercommand.cpp @@ -193,19 +193,19 @@ void FilterCommand::createCommand(ByteStream& bs) Command::createCommand(bs); } -void FilterCommand::resetCommand(ByteStream& bs) +void FilterCommand::resetCommand(ByteStream& /*bs*/) { } -void FilterCommand::prep(int8_t outputType, bool absRids) +void FilterCommand::prep(int8_t /*outputType*/, bool /*absRids*/) { } -void FilterCommand::project(messageqcpp::SBS& bs) +void FilterCommand::project(messageqcpp::SBS& /*bs*/) { } -void FilterCommand::projectIntoRowGroup(rowgroup::RowGroup& rg, uint32_t col) +void FilterCommand::projectIntoRowGroup(rowgroup::RowGroup& /*rg*/, uint32_t /*col*/) { } diff --git a/primitives/primproc/passthrucommand.cpp b/primitives/primproc/passthrucommand.cpp index fd9d36f1a..1b3f382dc 100644 --- a/primitives/primproc/passthrucommand.cpp +++ b/primitives/primproc/passthrucommand.cpp @@ -46,7 +46,7 @@ PassThruCommand::~PassThruCommand() { } -void PassThruCommand::prep(int8_t outputType, bool makeAbsRids) +void PassThruCommand::prep(int8_t /*outputType*/, bool /*makeAbsRids*/) { if (bpp->ot == ROW_GROUP) { @@ -173,7 +173,7 @@ void PassThruCommand::createCommand(ByteStream& bs) Command::createCommand(bs); } -void PassThruCommand::resetCommand(ByteStream& bs) +void PassThruCommand::resetCommand(ByteStream& /*bs*/) { } diff --git a/primitives/primproc/primitiveserver.cpp b/primitives/primproc/primitiveserver.cpp index c94294791..06c9f2ad9 100644 --- a/primitives/primproc/primitiveserver.cpp +++ b/primitives/primproc/primitiveserver.cpp @@ -154,7 +154,7 @@ struct preFetchCond boost::condition cond; unsigned waiters; - preFetchCond(const uint64_t l) + preFetchCond(const uint64_t) { waiters = 0; } @@ -825,7 +825,7 @@ void loadBlock(uint64_t lbid, QueryContext v, uint32_t t, int compType, void* bu struct AsynchLoader { AsynchLoader(uint64_t l, QueryContext v, uint32_t t, int ct, uint32_t* cCount, uint32_t* rCount, bool trace, - uint32_t sesID, boost::mutex* m, uint32_t* loaderCount, + uint32_t /*sesID*/, boost::mutex* m, uint32_t* loaderCount, boost::shared_ptr st, // sendThread for abort upon exception. VSSCache* vCache) : lbid(l) @@ -833,7 +833,6 @@ struct AsynchLoader , txn(t) , compType(ct) , LBIDTrace(trace) - , sessionID(sesID) , cacheCount(cCount) , readCount(rCount) , busyLoaders(loaderCount) @@ -905,7 +904,6 @@ struct AsynchLoader uint32_t txn; int compType; bool LBIDTrace; - uint32_t sessionID; uint32_t* cacheCount; uint32_t* readCount; uint32_t* busyLoaders; @@ -1596,8 +1594,8 @@ struct BPPHandler { if (posix_time::second_clock::universal_time() > dieTime) { - cout << "destroyBPP: job for id " << uniqueID << " and sessionID " << sessionID << " has been killed." - << endl; + cout << "destroyBPP: job for id " << uniqueID << " and sessionID " << sessionID + << " has been killed." << endl; // If for some reason there are jobs for this uniqueID that arrived later // they won't leave PP thread pool staying there forever. } @@ -1617,7 +1615,7 @@ struct BPPHandler if (bppv) { bppv->abort(); - } + } return 0; } @@ -1841,7 +1839,7 @@ struct ReadThread ios->write(buildCacheOpResp(0)); } - void doCacheFlushCmd(SP_UM_IOSOCK ios, const ByteStream& bs) + void doCacheFlushCmd(SP_UM_IOSOCK ios, const ByteStream& /*bs*/) { for (int i = 0; i < fCacheCount; i++) { @@ -2251,19 +2249,17 @@ struct ServerThread namespace primitiveprocessor { PrimitiveServer::PrimitiveServer(int serverThreads, int serverQueueSize, int processorWeight, - int processorQueueSize, bool rotatingDestination, uint32_t BRPBlocks, + int /*processorQueueSize*/, bool rotatingDestination, uint32_t BRPBlocks, int BRPThreads, int cacheCount, int maxBlocksPerRead, int readAheadBlocks, - uint32_t deleteBlocks, bool ptTrace, double prefetch, uint64_t smallSide) + uint32_t deleteBlocks, bool ptTrace, double prefetch, uint64_t /*smallSide*/) : fServerThreads(serverThreads) , fServerQueueSize(serverQueueSize) , fProcessorWeight(processorWeight) - , fProcessorQueueSize(processorQueueSize) , fMaxBlocksPerRead(maxBlocksPerRead) , fReadAheadBlocks(readAheadBlocks) , fRotatingDestination(rotatingDestination) , fPTTrace(ptTrace) , fPrefetchThreshold(prefetch) - , fPMSmallSide(smallSide) { fCacheCount = cacheCount; fServerpool.setMaxThreads(fServerThreads); diff --git a/primitives/primproc/primitiveserver.h b/primitives/primproc/primitiveserver.h index 40c5f919f..d500f66dd 100644 --- a/primitives/primproc/primitiveserver.h +++ b/primitives/primproc/primitiveserver.h @@ -171,13 +171,11 @@ class PrimitiveServer int fServerThreads; int fServerQueueSize; int fProcessorWeight; - int fProcessorQueueSize; int fMaxBlocksPerRead; int fReadAheadBlocks; bool fRotatingDestination; bool fPTTrace; double fPrefetchThreshold; - uint64_t fPMSmallSide; }; } // namespace primitiveprocessor diff --git a/primitives/primproc/primproc.cpp b/primitives/primproc/primproc.cpp index ad3459081..69a05ff10 100644 --- a/primitives/primproc/primproc.cpp +++ b/primitives/primproc/primproc.cpp @@ -39,7 +39,7 @@ #include #include #include -//#define NDEBUG +// #define NDEBUG #include using namespace std; @@ -123,10 +123,9 @@ void setupSignalHandlers() sigaddset(&sigset, SIGPIPE); sigaddset(&sigset, SIGUSR2); sigprocmask(SIG_BLOCK, &sigset, 0); - } -int8_t setupCwd(Config* cf) +int8_t setupCwd(Config* /*cf*/) { string workdir = startup::StartUp::tmpDir(); @@ -649,7 +648,6 @@ int ServicePrimProc::Child() if ((strVal == "n") || (strVal == "N")) directIOFlag = 0; - IDBPolicy::configIDBPolicy(); // no versionbuffer if using HDFS for performance reason diff --git a/primitives/primproc/rtscommand.cpp b/primitives/primproc/rtscommand.cpp index 9e783418b..c1859233a 100644 --- a/primitives/primproc/rtscommand.cpp +++ b/primitives/primproc/rtscommand.cpp @@ -163,7 +163,7 @@ void RTSCommand::nextLBID() col->nextLBID(); } -void RTSCommand::prep(int8_t outputType, bool makeAbsRids) +void RTSCommand::prep(int8_t /*outputType*/, bool /*makeAbsRids*/) { if (!passThru) col->prep(OT_BOTH, true); diff --git a/primitives/primproc/serviceexemgr.cpp b/primitives/primproc/serviceexemgr.cpp index 692911244..2de371f21 100644 --- a/primitives/primproc/serviceexemgr.cpp +++ b/primitives/primproc/serviceexemgr.cpp @@ -93,7 +93,7 @@ void added_a_pm(int) std::cout << "Total UM memory available: " << num << std::endl; } -void printTotalUmMemory(int sig) +void printTotalUmMemory(int /*sig*/) { int64_t num = globServiceExeMgr->getRm().availableMemory(); std::cout << "Total UM memory available: " << num << std::endl; diff --git a/primitives/primproc/serviceexemgr.h b/primitives/primproc/serviceexemgr.h index 9f4ff73a6..a94f88c89 100644 --- a/primitives/primproc/serviceexemgr.h +++ b/primitives/primproc/serviceexemgr.h @@ -94,7 +94,7 @@ class Opt } }; - void printTotalUmMemory(int sig); +void printTotalUmMemory(int sig); class ServiceExeMgr : public Service, public Opt { @@ -102,7 +102,7 @@ class ServiceExeMgr : public Service, public Opt using ThreadCntPerSessionMap_t = std::map; protected: - void log(logging::LOG_TYPE type, const std::string& str) + void log(logging::LOG_TYPE type, const std::string& /*str*/) { logging::LoggingID logid(16); logging::Message::Args args; @@ -113,40 +113,43 @@ class ServiceExeMgr : public Service, public Opt logger.logMessage(type, message, logid); } - public: - ServiceExeMgr(const Opt& opt, joblist::ResourceManager* rm) : Service("ExeMgr"), Opt(opt), msgLog_(logging::Logger(16)), rm_(rm) - { } - void LogErrno() override - { - log(logging::LOG_TYPE_CRITICAL, std::string(strerror(errno))); - } - void ParentLogChildMessage(const std::string& str) override - { - log(logging::LOG_TYPE_INFO, str); - } - int Child() override; - int Run() - { - return m_fg ? Child() : RunForking(); - } - static const constexpr unsigned logDefaultMsg = logging::M0000; - static const constexpr unsigned logDbProfStartStatement = logging::M0028; - static const constexpr unsigned logDbProfEndStatement = logging::M0029; - static const constexpr unsigned logStartSql = logging::M0041; - static const constexpr unsigned logEndSql = logging::M0042; - static const constexpr unsigned logRssTooBig = logging::M0044; - static const constexpr unsigned logDbProfQueryStats = logging::M0047; - static const constexpr unsigned logExeMgrExcpt = logging::M0055; - // If any flags other than the table mode flags are set, produce output to screeen - static const constexpr uint32_t flagsWantOutput = (0xffffffff & ~execplan::CalpontSelectExecutionPlan::TRACE_TUPLE_AUTOSWITCH & - ~execplan::CalpontSelectExecutionPlan::TRACE_TUPLE_OFF); - logging::Logger& getLogger() - { - return msgLog_; - } - void updateSessionMap(const size_t pct) - { - std::lock_guard lk(sessionMemMapMutex_); + public: + ServiceExeMgr(const Opt& opt, joblist::ResourceManager* rm) + : Service("ExeMgr"), Opt(opt), msgLog_(logging::Logger(16)), rm_(rm) + { + } + void LogErrno() override + { + log(logging::LOG_TYPE_CRITICAL, std::string(strerror(errno))); + } + void ParentLogChildMessage(const std::string& str) override + { + log(logging::LOG_TYPE_INFO, str); + } + int Child() override; + int Run() + { + return m_fg ? Child() : RunForking(); + } + static const constexpr unsigned logDefaultMsg = logging::M0000; + static const constexpr unsigned logDbProfStartStatement = logging::M0028; + static const constexpr unsigned logDbProfEndStatement = logging::M0029; + static const constexpr unsigned logStartSql = logging::M0041; + static const constexpr unsigned logEndSql = logging::M0042; + static const constexpr unsigned logRssTooBig = logging::M0044; + static const constexpr unsigned logDbProfQueryStats = logging::M0047; + static const constexpr unsigned logExeMgrExcpt = logging::M0055; + // If any flags other than the table mode flags are set, produce output to screeen + static const constexpr uint32_t flagsWantOutput = + (0xffffffff & ~execplan::CalpontSelectExecutionPlan::TRACE_TUPLE_AUTOSWITCH & + ~execplan::CalpontSelectExecutionPlan::TRACE_TUPLE_OFF); + logging::Logger& getLogger() + { + return msgLog_; + } + void updateSessionMap(const size_t pct) + { + std::lock_guard lk(sessionMemMapMutex_); for (auto mapIter = sessionMemMap_.begin(); mapIter != sessionMemMap_.end(); ++mapIter) { diff --git a/storage-manager/src/IOCoordinator.cpp b/storage-manager/src/IOCoordinator.cpp index 347899db4..8b1807f73 100644 --- a/storage-manager/src/IOCoordinator.cpp +++ b/storage-manager/src/IOCoordinator.cpp @@ -1192,7 +1192,7 @@ std::shared_ptr seekToEndOfHeader1(int fd, size_t* _bytesRead) throw runtime_error("seekToEndOfHeader1: did not find the end of the header"); } -int IOCoordinator::mergeJournal(int objFD, int journalFD, uint8_t* buf, off_t offset, size_t* len) const +int IOCoordinator::mergeJournal(int /*objFD*/, int /*journalFD*/, uint8_t* /*buf*/, off_t /*offset*/, size_t* /*len*/) const { throw runtime_error("IOCoordinator::mergeJournal(int, int, etc) is not implemented yet."); } diff --git a/storage-manager/src/Ownership.cpp b/storage-manager/src/Ownership.cpp index cadcebc22..122b0ec78 100644 --- a/storage-manager/src/Ownership.cpp +++ b/storage-manager/src/Ownership.cpp @@ -222,7 +222,7 @@ void Ownership::takeOwnership(const bf::path& p) auto it = ownedPrefixes.find(p); if (it != ownedPrefixes.end()) return; - ownedPrefixes[p] = NULL; + ownedPrefixes[p] = false; s.unlock(); bool okToTransfer = false; diff --git a/storage-manager/src/Synchronizer.cpp b/storage-manager/src/Synchronizer.cpp index 62315d990..912f717fa 100644 --- a/storage-manager/src/Synchronizer.cpp +++ b/storage-manager/src/Synchronizer.cpp @@ -301,7 +301,7 @@ void Synchronizer::periodicSync() } } -void Synchronizer::syncNow(const bf::path& prefix) +void Synchronizer::syncNow(const bf::path& /*prefix*/) { boost::unique_lock lock(mutex); diff --git a/tests/brm-em-standalone.cpp b/tests/brm-em-standalone.cpp index f54cf6011..e560fe978 100644 --- a/tests/brm-em-standalone.cpp +++ b/tests/brm-em-standalone.cpp @@ -40,7 +40,7 @@ #include "extentmap.h" #include "IDBPolicy.h" -//#define BRM_VERBOSE 1 +// #define BRM_VERBOSE 1 using namespace BRM; using namespace std; @@ -57,42 +57,51 @@ const DBRootT dbroot = 1; struct Range { - LBID_t start, end, nextBlock; - VER_t txnID; - Range() - { - start = end = nextBlock = 0; - txnID = 0; - } + LBID_t start, end, nextBlock; + VER_t txnID; + Range() + { + start = end = nextBlock = 0; + txnID = 0; + } }; struct EMEntries { - LBID_t LBIDstart; - uint32_t size; - OID_t OID; - uint32_t FBO; - uint32_t HWM; - uint32_t secondHWM; - int32_t txnID; - DBRootT dbroot; - PartitionNumberT partNum; - SegmentT segNum; - struct EMEntries* next; - EMEntries() : HWM(0), secondHWM(0), txnID(0), next(nullptr) - { } - EMEntries(const uint32_t aSize, const OID_t aOid, const uint32_t aFbo, - const LBID_t aLBIDStart, EMEntries* aNext) - : LBIDstart(aLBIDStart), size(aSize), OID(aOid), FBO(aFbo), HWM(0), - secondHWM(0), txnID(0), next(aNext) - { } - EMEntries(const uint32_t aSize, const OID_t aOid, const uint32_t aFbo, - const LBID_t aLBIDStart, EMEntries* aNext, const DBRootT aDbroot, - const PartitionNumberT aPartNum, const SegmentT aSegNum) - : LBIDstart(aLBIDStart), size(aSize), OID(aOid), FBO(aFbo), HWM(0), - secondHWM(0), txnID(0), dbroot(aDbroot), partNum(aPartNum), - segNum(aSegNum), next(aNext) - { } + LBID_t LBIDstart; + uint32_t size; + OID_t OID; + uint32_t FBO; + uint32_t HWM; + uint32_t secondHWM; + int32_t txnID; + DBRootT dbroot; + PartitionNumberT partNum; + SegmentT segNum; + struct EMEntries* next; + EMEntries() : HWM(0), secondHWM(0), txnID(0), next(nullptr) + { + } + EMEntries(const uint32_t aSize, const OID_t aOid, const uint32_t aFbo, const LBID_t aLBIDStart, + EMEntries* aNext) + : LBIDstart(aLBIDStart), size(aSize), OID(aOid), FBO(aFbo), HWM(0), secondHWM(0), txnID(0), next(aNext) + { + } + EMEntries(const uint32_t aSize, const OID_t aOid, const uint32_t aFbo, const LBID_t aLBIDStart, + EMEntries* aNext, const DBRootT aDbroot, const PartitionNumberT aPartNum, const SegmentT aSegNum) + : LBIDstart(aLBIDStart) + , size(aSize) + , OID(aOid) + , FBO(aFbo) + , HWM(0) + , secondHWM(0) + , txnID(0) + , dbroot(aDbroot) + , partNum(aPartNum) + , segNum(aSegNum) + , next(aNext) + { + } }; /* static void* BRMRunner_2(void* arg) @@ -226,10 +235,9 @@ static void* BRMRunner_1(void* arg) colWidth = colWidthsAvailable[randNumber % colWidthsAvailable.size()]; partNum = randNumber % std::numeric_limits::max(); segmentNum = randNumber % std::numeric_limits::max(); - colDataType = (execplan::CalpontSystemCatalog::ColDataType) (randNumber % (int)execplan::CalpontSystemCatalog::ColDataType::TIMESTAMP); -#ifdef BRM_VERBOSE - cerr << "next op is " << op << endl; -#endif + colDataType = (execplan::CalpontSystemCatalog::ColDataType) (randNumber % +(int)execplan::CalpontSystemCatalog::ColDataType::TIMESTAMP); #ifdef BRM_VERBOSE cerr << "next op is " << op +<< endl; #endif switch (op) { @@ -993,398 +1001,392 @@ static void* BRMRunner_si(void* arg) } */ -static void* EMRunner(void* arg) +static void* EMRunner([[maybe_unused]] void* arg) { - // keep track of LBID ranges allocated here and - // randomly allocate, lookup, delete, get/set HWM, and - // destroy the EM object. + // keep track of LBID ranges allocated here and + // randomly allocate, lookup, delete, get/set HWM, and + // destroy the EM object. #ifdef BRM_VERBOSE - uint64_t threadNum = (uint64_t)arg; + uint64_t threadNum = (uint64_t)arg; #endif - int op, listSize = 0; - uint32_t randstate; - struct EMEntries* head = NULL, *tmp; - struct timeval tv; - ExtentMap* em; - LBID_t lbid; - uint32_t colWidth; - PartitionNumberT partNum; - SegmentT segmentNum; - execplan::CalpontSystemCatalog::ColDataType colDataType; + int op, listSize = 0; + uint32_t randstate; + struct EMEntries *head = NULL, *tmp; + struct timeval tv; + ExtentMap* em; + LBID_t lbid; + uint32_t colWidth; + PartitionNumberT partNum; + SegmentT segmentNum; + execplan::CalpontSystemCatalog::ColDataType colDataType; #ifdef BRM_VERBOSE - cerr << "thread number " << threadNum << " started." << endl; + cerr << "thread number " << threadNum << " started." << endl; #endif - gettimeofday(&tv, NULL); - randstate = static_cast(tv.tv_usec); - //pthread_mutex_lock(&pthreadMutex); - em = new ExtentMap(); - //pthread_mutex_unlock(&pthreadMutex); + gettimeofday(&tv, NULL); + randstate = static_cast(tv.tv_usec); + // pthread_mutex_lock(&pthreadMutex); + em = new ExtentMap(); + // pthread_mutex_unlock(&pthreadMutex); - while (!threadStop) + while (!threadStop) + { + auto randNumber = rand_r(&randstate); + op = randNumber % 10; + + colWidth = colWidthsAvailable[randNumber % colWidthsAvailable.size()]; + partNum = randNumber % std::numeric_limits::max(); + segmentNum = randNumber % std::numeric_limits::max(); + colDataType = (execplan::CalpontSystemCatalog::ColDataType)( + randNumber % (int)execplan::CalpontSystemCatalog::ColDataType::TIMESTAMP); +#ifdef BRM_VERBOSE + cerr << "next op is " << op << endl; +#endif + + switch (op) { - auto randNumber = rand_r(&randstate); - op = randNumber % 10; + case 0: // allocate space for a new file + { + vector emEntriesVec; + struct EMEntries* newEm; + size_t numberOfExtents = randNumber % 4 + 1; + int OID; + uint32_t startBlockOffset; - colWidth = colWidthsAvailable[randNumber % colWidthsAvailable.size()]; - partNum = randNumber % std::numeric_limits::max(); - segmentNum = randNumber % std::numeric_limits::max(); - colDataType = (execplan::CalpontSystemCatalog::ColDataType) (randNumber % (int)execplan::CalpontSystemCatalog::ColDataType::TIMESTAMP); -#ifdef BRM_VERBOSE - cerr << "next op is " << op << endl; -#endif + pthread_mutex_lock(&pthreadMutex); + OID = oid++; + pthread_mutex_unlock(&pthreadMutex); - switch (op) + em->getExtents(OID, emEntriesVec, false, false, true); + size_t extentsNumberBefore = emEntriesVec.size(); + int allocdsize; + for (size_t i = 0; i < numberOfExtents; ++i) { - case 0: //allocate space for a new file - { - vector emEntriesVec; - struct EMEntries* newEm; - size_t numberOfExtents = randNumber % 4 + 1; - int OID; - uint32_t startBlockOffset; + em->createColumnExtent_DBroot(OID, colWidth, dbroot, colDataType, partNum, segmentNum, lbid, + allocdsize, startBlockOffset); + em->confirmChanges(); - pthread_mutex_lock(&pthreadMutex); - OID = oid++; - pthread_mutex_unlock(&pthreadMutex); - - em->getExtents(OID, emEntriesVec, false, false, true); - size_t extentsNumberBefore = emEntriesVec.size(); - int allocdsize; - for (size_t i = 0; i < numberOfExtents; ++i) - { - em->createColumnExtent_DBroot(OID, colWidth, dbroot, colDataType, - partNum, segmentNum, lbid, allocdsize, startBlockOffset); - em->confirmChanges(); - - newEm = new EMEntries(allocdsize, OID, startBlockOffset, lbid, - head, dbroot, partNum, segmentNum); - head = newEm; - listSize++; - } - - emEntriesVec.clear(); - em->getExtents(OID, emEntriesVec, false, false, true); - size_t extentsNumberAfter = emEntriesVec.size(); - - CPPUNIT_ASSERT(extentsNumberBefore + numberOfExtents == extentsNumberAfter); - -#ifdef BRM_VERBOSE - cerr << "created new space for OID " << newEm->OID << endl; -#endif - //em->checkConsistency(); - break; - } -/* - case 1: //allocate space for an existing file - { - if (listSize == 0) - break; - - struct EMEntries* newEm, *tmp; - size_t size = rand_r(&randstate) % 10; - int fileRand = rand_r(&randstate) % listSize; - int i, lastExtent, blockEnd, oid; - int tmpHWM, entries, allocdSize; - uint32_t startBlockOffset; - lbids.clear(); - - for (i = 0, tmp = head; i < fileRand; i++) - tmp = tmp->next; - - oid = tmp->OID; - - for (lastExtent = 0, tmp = head; tmp != NULL; tmp = tmp->next) - { - if (tmp->OID != oid) - continue; - - tmpHWM = tmp->HWM; - blockEnd = tmp->FBO + tmp->size; - - if (lastExtent < blockEnd) - lastExtent = blockEnd; - } - - for (size_t i = 0; i < size; ++i) - { - em->createColumnExtent_DBroot(oid, colWidth, dbroot, colDataType, - partNum, segmentNum, lbid, allocdSize, startBlockOffset); - em->confirmChanges(); - lbids.push_back(lbid); - } - - //em->createExtent(size, oid, lbids, allocdSize); - //em->confirmChanges(); - - entries = size / em->getExtentSize(); - - if ((size % em->getExtentSize()) != 0) - entries++; - - CPPUNIT_ASSERT((uint32_t)entries == lbids.size()); - - for (i = 0; i < entries; i++) - { - newEm = new EMEntries((i != entries) ? em->getExtentSize() : size % em->getExtentSize(), - oid, lastExtent + (i * em->getExtentSize()), - lbids[i], head, dbroot, partNum, segmentNum); - newEm->HWM = tmpHWM; - head = newEm; - listSize++; - } - -#ifdef BRM_VERBOSE - cerr << "created another extent for OID " << newEm->OID << endl; -#endif - em->checkConsistency(); - break; - } -*/ - - case 2: //delete an OID - { - if (listSize == 0) - break; - - struct EMEntries* tmp = nullptr, *prev = nullptr; - int fileRand = rand_r(&randstate) % listSize; - int i, oid; - - for (i = 0, tmp = head; i < fileRand; i++) - tmp = tmp->next; - - oid = tmp->OID; - - em->deleteOID(oid); - em->confirmChanges(); - - vector emEntriesVec; - em->getExtents(oid, emEntriesVec, false, false, true); - CPPUNIT_ASSERT(emEntriesVec.empty()); - - for (tmp = head; tmp != NULL;) - { - if (tmp->OID == oid) - { - if (tmp == head) - { - head = head->next; - delete tmp; - tmp = head; - } - else - { - prev->next = tmp->next; - delete tmp; - tmp = prev->next; - } - - listSize--; - } - else - { - prev = tmp; - tmp = tmp->next; - } - } - -#ifdef BRM_VERBOSE - cerr << "deleted OID " << oid << endl; -#endif - //em->checkConsistency(); - break; - } - - case 3: //lookup by LBID - { - if (listSize == 0) - break; - - int entryRand = rand_r(&randstate) % listSize; - int i, err, offset, oid; - struct EMEntries* tmp; - LBID_t target; - uint32_t fbo; - DBRootT localDbroot; - PartitionNumberT localPartNum; - SegmentT localSegmentNum; - - for (i = 0, tmp = head; i < entryRand; i++) - tmp = tmp->next; - - offset = rand_r(&randstate) % (tmp->size - 1); - - target = tmp->LBIDstart + offset; - err = em->lookupLocal(target, oid, localDbroot, localPartNum, localSegmentNum, fbo); -#ifdef BRM_VERBOSE - cerr << "looked up LBID " << target << " got oid " << oid << " fbo " << fbo << endl; - cerr << " oid should be " << tmp->OID << " fbo should be " << offset + tmp->FBO << endl; - cerr << "op 3 fbo " << fbo << " offset + tmp->FBO " << offset + tmp->FBO << endl; -#endif - CPPUNIT_ASSERT(err == 0); - CPPUNIT_ASSERT(oid == tmp->OID); - CPPUNIT_ASSERT(fbo == offset + tmp->FBO); - //em->checkConsistency(); - break; - } - - case 4: //lookup by OID, FBO - { - if (listSize == 0) - break; - - int entryRand = rand_r(&randstate) % listSize; - int i, oid, err, offset; - struct EMEntries* tmp; - LBID_t lbid; - - for (i = 0, tmp = head; i < entryRand; i++) - tmp = tmp->next; - - offset = rand_r(&randstate) % (tmp->size - 1); - oid = tmp->OID; - - err = em->lookupLocal(oid, tmp->partNum, tmp->segNum, offset + tmp->FBO, lbid); -#ifdef BRM_VERBOSE - cerr << "looked up OID " << oid << " fbo " << offset + tmp->FBO << - " got lbid " << lbid << endl; - cerr << " lbid should be " << tmp->LBIDstart + offset << endl; -#endif - CPPUNIT_ASSERT(err == 0); - CPPUNIT_ASSERT(lbid == tmp->LBIDstart + offset); - //em->checkConsistency(); - break; - } - - case 5: //getHWM - { - if (listSize == 0) - break; - - int entryRand = rand_r(&randstate) % listSize; - int i, status; - struct EMEntries* tmp; - uint32_t hwm; - - for (i = 0, tmp = head; i < entryRand; i++) - tmp = tmp->next; - - hwm = em->getLocalHWM(tmp->OID, tmp->partNum, tmp->segNum, status); -#ifdef BRM_VERBOSE_I - cerr << "stored HWM for OID " << tmp->OID << " is " << tmp->HWM - << " BRM says it's " << hwm << endl; -#endif - CPPUNIT_ASSERT(hwm == tmp->HWM); - //em->checkConsistency(); - break; - } - - case 6: //setHWM - { - if (listSize == 0) - break; - - int entryRand = rand_r(&randstate) % listSize; - int i, hwm, oid; - struct EMEntries* tmp; - - for (i = 0, tmp = head; i < entryRand; i++) - tmp = tmp->next; - - oid = tmp->OID; - hwm = rand_r(&randstate) % (tmp->size - 1); - bool firstNode = true; - em->setLocalHWM(oid, tmp->partNum, tmp->segNum, hwm, firstNode); - - em->confirmChanges(); - - tmp->HWM = hwm; - -#ifdef BRM_VERBOSE - cerr << "setHWM of OID " << oid << " to " << hwm << endl; -#endif - //em->checkConsistency(); - break; - } - -/* - case 7: // renew this EM object - { - delete em; - em = new ExtentMap(); -#ifdef BRM_VERBOSE - cerr << "got a new EM instance" << endl; -#endif - em->checkConsistency(); - break; - } - case 8: //getBulkInsertVars - { - if (listSize == 0) - break; - - HWM_t hwm; - VER_t txnID; - int entryRand = rand_r(&randstate) % listSize; - int i, err, offset; - EMEntries* tmp; - LBID_t lbid; - - for (i = 0, tmp = head; i < entryRand; i++) - tmp = tmp->next; - - offset = rand_r(&randstate) % tmp->size; - lbid = tmp->LBIDstart + offset; - err = em->getBulkInsertVars(lbid, hwm, txnID); - CPPUNIT_ASSERT(err == 0); - CPPUNIT_ASSERT(hwm == tmp->secondHWM); - CPPUNIT_ASSERT(txnID == tmp->txnID); - break; - } - - case 9: //setBulkInsertVars - { - if (listSize == 0) - break; - - int entryRand = rand_r(&randstate) % listSize; - int i, err, offset; - EMEntries* tmp; - - for (i = 0, tmp = head; i < entryRand; i++) - tmp = tmp->next; - - offset = rand_r(&randstate) % tmp->size; - tmp->secondHWM = rand_r(&randstate) % MAXINT; - tmp->txnID = rand_r(&randstate) % MAXINT; - err = em->setBulkInsertVars(tmp->LBIDstart + offset, - tmp->secondHWM, tmp->txnID); - em->confirmChanges(); - CPPUNIT_ASSERT(err == 0); - break; - } -*/ - default: - break; + newEm = new EMEntries(allocdsize, OID, startBlockOffset, lbid, head, dbroot, partNum, segmentNum); + head = newEm; + listSize++; } - } - delete em; + emEntriesVec.clear(); + em->getExtents(OID, emEntriesVec, false, false, true); + size_t extentsNumberAfter = emEntriesVec.size(); - while (head != NULL) - { - tmp = head->next; - delete head; - head = tmp; - } + CPPUNIT_ASSERT(extentsNumberBefore + numberOfExtents == extentsNumberAfter); #ifdef BRM_VERBOSE - cerr << "thread " << threadNum << " exiting" << endl; + cerr << "created new space for OID " << newEm->OID << endl; #endif - return NULL; + // em->checkConsistency(); + break; + } + /* + case 1: //allocate space for an existing file + { + if (listSize == 0) + break; + + struct EMEntries* newEm, *tmp; + size_t size = rand_r(&randstate) % 10; + int fileRand = rand_r(&randstate) % listSize; + int i, lastExtent, blockEnd, oid; + int tmpHWM, entries, allocdSize; + uint32_t startBlockOffset; + lbids.clear(); + + for (i = 0, tmp = head; i < fileRand; i++) + tmp = tmp->next; + + oid = tmp->OID; + + for (lastExtent = 0, tmp = head; tmp != NULL; tmp = tmp->next) + { + if (tmp->OID != oid) + continue; + + tmpHWM = tmp->HWM; + blockEnd = tmp->FBO + tmp->size; + + if (lastExtent < blockEnd) + lastExtent = blockEnd; + } + + for (size_t i = 0; i < size; ++i) + { + em->createColumnExtent_DBroot(oid, colWidth, dbroot, colDataType, + partNum, segmentNum, lbid, allocdSize, startBlockOffset); + em->confirmChanges(); + lbids.push_back(lbid); + } + + //em->createExtent(size, oid, lbids, allocdSize); + //em->confirmChanges(); + + entries = size / em->getExtentSize(); + + if ((size % em->getExtentSize()) != 0) + entries++; + + CPPUNIT_ASSERT((uint32_t)entries == lbids.size()); + + for (i = 0; i < entries; i++) + { + newEm = new EMEntries((i != entries) ? em->getExtentSize() : size % + em->getExtentSize(), oid, lastExtent + (i * em->getExtentSize()), lbids[i], head, dbroot, partNum, + segmentNum); newEm->HWM = tmpHWM; head = newEm; listSize++; + } + + #ifdef BRM_VERBOSE + cerr << "created another extent for OID " << newEm->OID << endl; + #endif + em->checkConsistency(); + break; + } + */ + + case 2: // delete an OID + { + if (listSize == 0) + break; + + struct EMEntries *tmp = nullptr, *prev = nullptr; + int fileRand = rand_r(&randstate) % listSize; + int i, oid; + + for (i = 0, tmp = head; i < fileRand; i++) + tmp = tmp->next; + + oid = tmp->OID; + + em->deleteOID(oid); + em->confirmChanges(); + + vector emEntriesVec; + em->getExtents(oid, emEntriesVec, false, false, true); + CPPUNIT_ASSERT(emEntriesVec.empty()); + + for (tmp = head; tmp != NULL;) + { + if (tmp->OID == oid) + { + if (tmp == head) + { + head = head->next; + delete tmp; + tmp = head; + } + else + { + prev->next = tmp->next; + delete tmp; + tmp = prev->next; + } + + listSize--; + } + else + { + prev = tmp; + tmp = tmp->next; + } + } + +#ifdef BRM_VERBOSE + cerr << "deleted OID " << oid << endl; +#endif + // em->checkConsistency(); + break; + } + + case 3: // lookup by LBID + { + if (listSize == 0) + break; + + int entryRand = rand_r(&randstate) % listSize; + int i, err, offset, oid; + struct EMEntries* tmp; + LBID_t target; + uint32_t fbo; + DBRootT localDbroot; + PartitionNumberT localPartNum; + SegmentT localSegmentNum; + + for (i = 0, tmp = head; i < entryRand; i++) + tmp = tmp->next; + + offset = rand_r(&randstate) % (tmp->size - 1); + + target = tmp->LBIDstart + offset; + err = em->lookupLocal(target, oid, localDbroot, localPartNum, localSegmentNum, fbo); +#ifdef BRM_VERBOSE + cerr << "looked up LBID " << target << " got oid " << oid << " fbo " << fbo << endl; + cerr << " oid should be " << tmp->OID << " fbo should be " << offset + tmp->FBO << endl; + cerr << "op 3 fbo " << fbo << " offset + tmp->FBO " << offset + tmp->FBO << endl; +#endif + CPPUNIT_ASSERT(err == 0); + CPPUNIT_ASSERT(oid == tmp->OID); + CPPUNIT_ASSERT(fbo == offset + tmp->FBO); + // em->checkConsistency(); + break; + } + + case 4: // lookup by OID, FBO + { + if (listSize == 0) + break; + + int entryRand = rand_r(&randstate) % listSize; + int i, oid, err, offset; + struct EMEntries* tmp; + LBID_t lbid; + + for (i = 0, tmp = head; i < entryRand; i++) + tmp = tmp->next; + + offset = rand_r(&randstate) % (tmp->size - 1); + oid = tmp->OID; + + err = em->lookupLocal(oid, tmp->partNum, tmp->segNum, offset + tmp->FBO, lbid); +#ifdef BRM_VERBOSE + cerr << "looked up OID " << oid << " fbo " << offset + tmp->FBO << " got lbid " << lbid << endl; + cerr << " lbid should be " << tmp->LBIDstart + offset << endl; +#endif + CPPUNIT_ASSERT(err == 0); + CPPUNIT_ASSERT(lbid == tmp->LBIDstart + offset); + // em->checkConsistency(); + break; + } + + case 5: // getHWM + { + if (listSize == 0) + break; + + int entryRand = rand_r(&randstate) % listSize; + int i, status; + struct EMEntries* tmp; + uint32_t hwm; + + for (i = 0, tmp = head; i < entryRand; i++) + tmp = tmp->next; + + hwm = em->getLocalHWM(tmp->OID, tmp->partNum, tmp->segNum, status); +#ifdef BRM_VERBOSE_I + cerr << "stored HWM for OID " << tmp->OID << " is " << tmp->HWM << " BRM says it's " << hwm << endl; +#endif + CPPUNIT_ASSERT(hwm == tmp->HWM); + // em->checkConsistency(); + break; + } + + case 6: // setHWM + { + if (listSize == 0) + break; + + int entryRand = rand_r(&randstate) % listSize; + int i, hwm, oid; + struct EMEntries* tmp; + + for (i = 0, tmp = head; i < entryRand; i++) + tmp = tmp->next; + + oid = tmp->OID; + hwm = rand_r(&randstate) % (tmp->size - 1); + bool firstNode = true; + em->setLocalHWM(oid, tmp->partNum, tmp->segNum, hwm, firstNode); + + em->confirmChanges(); + + tmp->HWM = hwm; + +#ifdef BRM_VERBOSE + cerr << "setHWM of OID " << oid << " to " << hwm << endl; +#endif + // em->checkConsistency(); + break; + } + + /* + case 7: // renew this EM object + { + delete em; + em = new ExtentMap(); + #ifdef BRM_VERBOSE + cerr << "got a new EM instance" << endl; + #endif + em->checkConsistency(); + break; + } + case 8: //getBulkInsertVars + { + if (listSize == 0) + break; + + HWM_t hwm; + VER_t txnID; + int entryRand = rand_r(&randstate) % listSize; + int i, err, offset; + EMEntries* tmp; + LBID_t lbid; + + for (i = 0, tmp = head; i < entryRand; i++) + tmp = tmp->next; + + offset = rand_r(&randstate) % tmp->size; + lbid = tmp->LBIDstart + offset; + err = em->getBulkInsertVars(lbid, hwm, txnID); + CPPUNIT_ASSERT(err == 0); + CPPUNIT_ASSERT(hwm == tmp->secondHWM); + CPPUNIT_ASSERT(txnID == tmp->txnID); + break; + } + + case 9: //setBulkInsertVars + { + if (listSize == 0) + break; + + int entryRand = rand_r(&randstate) % listSize; + int i, err, offset; + EMEntries* tmp; + + for (i = 0, tmp = head; i < entryRand; i++) + tmp = tmp->next; + + offset = rand_r(&randstate) % tmp->size; + tmp->secondHWM = rand_r(&randstate) % MAXINT; + tmp->txnID = rand_r(&randstate) % MAXINT; + err = em->setBulkInsertVars(tmp->LBIDstart + offset, + tmp->secondHWM, tmp->txnID); + em->confirmChanges(); + CPPUNIT_ASSERT(err == 0); + break; + } + */ + default: break; + } + } + + delete em; + + while (head != NULL) + { + tmp = head->next; + delete head; + head = tmp; + } + +#ifdef BRM_VERBOSE + cerr << "thread " << threadNum << " exiting" << endl; +#endif + return NULL; } /* @@ -1751,163 +1753,161 @@ static void* EMRunner_si(void* arg) } */ - class LongBRMTests : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(LongBRMTests); - CPPUNIT_TEST_SUITE(LongBRMTests); + CPPUNIT_TEST(longEMTest_1); + // CPPUNIT_TEST(longEMTest_2); + // CPPUNIT_TEST(longBRMTest_1); + // CPPUNIT_TEST(longBRMTest_2); - CPPUNIT_TEST(longEMTest_1); -// CPPUNIT_TEST(longEMTest_2); -// CPPUNIT_TEST(longBRMTest_1); -// CPPUNIT_TEST(longBRMTest_2); + CPPUNIT_TEST_SUITE_END(); - CPPUNIT_TEST_SUITE_END(); + private: + public: + void longEMTest_1() + { + const int threadCount = 10; + int i; + pthread_t threads[threadCount]; -private: -public: - void longEMTest_1() + cerr << endl + << "Multithreaded, multiple instance ExtentMap test. " + "This runs for 5 minutes." + << endl; + + threadStop = 0; + pthread_mutex_init(&pthreadMutex, nullptr); + + for (i = 0; i < threadCount; i++) { - const int threadCount = 10; - int i; - pthread_t threads[threadCount]; + if (pthread_create(&threads[i], NULL, EMRunner, reinterpret_cast(i + 1)) < 0) + throw logic_error("Error creating threads for the ExtentMap test"); - cerr << endl << "Multithreaded, multiple instance ExtentMap test. " - "This runs for 5 minutes." << endl; - - threadStop = 0; - pthread_mutex_init(&pthreadMutex, nullptr); - - for (i = 0; i < threadCount; i++) - { - if (pthread_create(&threads[i], NULL, EMRunner, - reinterpret_cast(i + 1)) < 0) - throw logic_error("Error creating threads for the ExtentMap test"); - - usleep(1000); - } - - sleep(300); - threadStop = 1; - - for (i = 0; i < threadCount; i++) - { - cerr << "Waiting for thread #" << i << endl; - pthread_join(threads[i], nullptr); - } + usleep(1000); } -/* - void longEMTest_2() + sleep(300); + threadStop = 1; + + for (i = 0; i < threadCount; i++) { - const int threadCount = 10; - int i; - pthread_t threads[threadCount]; - - cerr << endl << "Multithreaded, single instance ExtentMap test. " - "This runs for 5 minutes." << endl; - - threadStop = 0; - pthread_mutex_init(&pthreadMutex, NULL); - - for (i = 0; i < threadCount; i++) - { - if (pthread_create(&threads[i], NULL, EMRunner_si, - reinterpret_cast(i + 1)) < 0) - throw logic_error("Error creating threads for the ExtentMap test"); - - usleep(1000); - } - - sleep(60); - threadStop = 1; - - for (i = 0; i < threadCount; i++) - { - cerr << "Waiting for thread #" << i << endl; - pthread_join(threads[i], NULL); - } + cerr << "Waiting for thread #" << i << endl; + pthread_join(threads[i], nullptr); } - void longBRMTest_1() - { - const int threadCount = 10; - int i; - pthread_t threads[threadCount]; + } - cerr << endl << "Multithreaded, multiple instance DBRM test. " - "This runs for 5 minutes." << endl; + /* + void longEMTest_2() + { + const int threadCount = 10; + int i; + pthread_t threads[threadCount]; - threadStop = 0; - pthread_mutex_init(&pthreadMutex, NULL); - opCount = 0; + cerr << endl << "Multithreaded, single instance ExtentMap test. " + "This runs for 5 minutes." << endl; - for (i = 0; i < threadCount; i++) - { - if (pthread_create(&threads[i], NULL, BRMRunner_1, - reinterpret_cast(i + 1)) < 0) - throw logic_error("Error creating threads for the DBRM test"); + threadStop = 0; + pthread_mutex_init(&pthreadMutex, NULL); - usleep(1000); - } + for (i = 0; i < threadCount; i++) + { + if (pthread_create(&threads[i], NULL, EMRunner_si, + reinterpret_cast(i + 1)) < 0) + throw logic_error("Error creating threads for the ExtentMap test"); - sleep(300); - threadStop = 1; + usleep(1000); + } - for (i = 0; i < threadCount; i++) - { - cerr << "Waiting for thread #" << i << endl; - pthread_join(threads[i], NULL); - } + sleep(60); + threadStop = 1; - cerr << "opCount = " << opCount << endl; - } - void longBRMTest_2() - { - const int threadCount = 10; - int i; - pthread_t threads[threadCount]; + for (i = 0; i < threadCount; i++) + { + cerr << "Waiting for thread #" << i << endl; + pthread_join(threads[i], NULL); + } + } + void longBRMTest_1() + { + const int threadCount = 10; + int i; + pthread_t threads[threadCount]; - cerr << endl << "Multithreaded, single instance DBRM test. " - "This runs for 5 minutes." << endl; + cerr << endl << "Multithreaded, multiple instance DBRM test. " + "This runs for 5 minutes." << endl; - threadStop = 0; - pthread_mutex_init(&pthreadMutex, NULL); - opCount = 0; + threadStop = 0; + pthread_mutex_init(&pthreadMutex, NULL); + opCount = 0; - for (i = 0; i < threadCount; i++) - { - if (pthread_create(&threads[i], NULL, BRMRunner_si, - reinterpret_cast(i + 1)) < 0) - throw logic_error("Error creating threads for the DBRM test"); + for (i = 0; i < threadCount; i++) + { + if (pthread_create(&threads[i], NULL, BRMRunner_1, + reinterpret_cast(i + 1)) < 0) + throw logic_error("Error creating threads for the DBRM test"); - usleep(1000); - } + usleep(1000); + } - sleep(300); - threadStop = 1; + sleep(300); + threadStop = 1; - for (i = 0; i < threadCount; i++) - { - cerr << "Waiting for thread #" << i << endl; - pthread_join(threads[i], NULL); - } + for (i = 0; i < threadCount; i++) + { + cerr << "Waiting for thread #" << i << endl; + pthread_join(threads[i], NULL); + } - cerr << "opCount = " << opCount << endl; - } -*/ + cerr << "opCount = " << opCount << endl; + } + void longBRMTest_2() + { + const int threadCount = 10; + int i; + pthread_t threads[threadCount]; + cerr << endl << "Multithreaded, single instance DBRM test. " + "This runs for 5 minutes." << endl; + + threadStop = 0; + pthread_mutex_init(&pthreadMutex, NULL); + opCount = 0; + + for (i = 0; i < threadCount; i++) + { + if (pthread_create(&threads[i], NULL, BRMRunner_si, + reinterpret_cast(i + 1)) < 0) + throw logic_error("Error creating threads for the DBRM test"); + + usleep(1000); + } + + sleep(300); + threadStop = 1; + + for (i = 0; i < threadCount; i++) + { + cerr << "Waiting for thread #" << i << endl; + pthread_join(threads[i], NULL); + } + + cerr << "opCount = " << opCount << endl; + } + */ }; -CPPUNIT_TEST_SUITE_REGISTRATION( LongBRMTests ); +CPPUNIT_TEST_SUITE_REGISTRATION(LongBRMTests); #include #include -int main( int argc, char** argv) +int main(int /*argc*/, char** /*argv*/) { - CppUnit::TextUi::TestRunner runner; - CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry(); - runner.addTest( registry.makeTest() ); - idbdatafile::IDBPolicy::configIDBPolicy(); - bool wasSuccessful = runner.run( "", false ); - return (wasSuccessful ? 0 : 1); + CppUnit::TextUi::TestRunner runner; + CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry(); + runner.addTest(registry.makeTest()); + idbdatafile::IDBPolicy::configIDBPolicy(); + bool wasSuccessful = runner.run("", false); + return (wasSuccessful ? 0 : 1); } diff --git a/tests/bytestream.cpp b/tests/bytestream.cpp index 76e60826b..481cea8d8 100644 --- a/tests/bytestream.cpp +++ b/tests/bytestream.cpp @@ -910,7 +910,7 @@ void setupSignalHandlers() sigaction(SIGPIPE, &ign, 0); } -int main(int argc, char** argv) +int main(int /*argc*/, char** /*argv*/) { setupSignalHandlers(); diff --git a/tests/comparators-tests.cpp b/tests/comparators-tests.cpp index 9d237b477..a2aa79df8 100644 --- a/tests/comparators-tests.cpp +++ b/tests/comparators-tests.cpp @@ -128,7 +128,7 @@ class FilterDriver : public CppUnit::TestFixture // then initialize RGData. After that it adds two numeric values (v1 < v2)and two NULL. // Then creates comparator structures and run a number of tests. v1 < v2 void testComparatorWithDT(execplan::CalpontSystemCatalog::ColDataType cscDt, uint32_t width, - bool generateRandValues, uint8_t precision) + bool /*generateRandValues*/, uint8_t precision) { std::cout << std::endl << "------------------------------------------------------------" << std::endl; uint32_t oid = 3001; @@ -432,7 +432,7 @@ class FilterDriver : public CppUnit::TestFixture CPPUNIT_TEST_SUITE_REGISTRATION(FilterDriver); -int main(int argc, char** argv) +int main(int, char**) { CppUnit::TextUi::TestRunner runner; CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry(); diff --git a/tests/rewritetest.cpp b/tests/rewritetest.cpp index e3f2fbfe3..2f5bcb622 100755 --- a/tests/rewritetest.cpp +++ b/tests/rewritetest.cpp @@ -31,17 +31,19 @@ bool treeEqual(execplan::ParseTree* fst, execplan::ParseTree* snd, int depth = 0 auto comp = execplan::NodeSemanticComparator(); if (comp(fst, snd) || comp(fst, snd)) { - std::cerr << "Data " << fst->data()->data() << " differs from " << snd->data()->data() << " at level " << depth << '\n'; + std::cerr << "Data " << fst->data()->data() << " differs from " << snd->data()->data() << " at level " + << depth << '\n'; return false; } - return (treeEqual(fst->left(), snd->left(), depth + 1) && treeEqual(fst->right(), snd->right(), depth + 1)) || + return (treeEqual(fst->left(), snd->left(), depth + 1) && + treeEqual(fst->right(), snd->right(), depth + 1)) || (treeEqual(fst->left(), snd->right(), depth + 1) && treeEqual(fst->right(), snd->left(), depth + 1)); } #define REWRITE_TREE_TEST_DEBUG false - -void printTree(const std::string& queryName, execplan::ParseTree* tree, const std::string& treeName) +void printTree([[maybe_unused]] const std::string& queryName, [[maybe_unused]] execplan::ParseTree* tree, + [[maybe_unused]] const std::string& treeName) { #if REWRITE_TREE_TEST_DEBUG std::string dotPath = std::string("/tmp/") + queryName; @@ -68,7 +70,9 @@ struct ParseTreeTestParam } }; -class ParseTreeTest : public testing::TestWithParam<::ParseTreeTestParam> {}; +class ParseTreeTest : public testing::TestWithParam<::ParseTreeTestParam> +{ +}; TEST_P(ParseTreeTest, Rewrite) { @@ -96,466 +100,460 @@ TEST_P(ParseTreeTest, Rewrite) } } -INSTANTIATE_TEST_SUITE_P(TreeRewrites, ParseTreeTest, testing::Values( - /* - select t1.posname, t2.posname from t1,t2 - where - ( - t1.id = t2.id - and t1.pos + t2.pos < 1000 - ) - or - ( - t1.id = t2.id - and t1.pos + t2.pos > 15000 - ); - */ +INSTANTIATE_TEST_SUITE_P( + TreeRewrites, ParseTreeTest, + testing::Values( + /* + select t1.posname, t2.posname from t1,t2 + where + ( + t1.id = t2.id + and t1.pos + t2.pos < 1000 + ) + or + ( + t1.id = t2.id + and t1.pos + t2.pos > 15000 + ); + */ - ParseTreeTestParam{"Query_1", execplan::initial_Query_1, execplan::reference_Query_1}, + ParseTreeTestParam{"Query_1", execplan::initial_Query_1, execplan::reference_Query_1}, - /* - select t1.posname, t2.posname - from t1,t2 - where - t1.id = t2.id - and (t1.pos + t2.pos < 1000); - */ - ParseTreeTestParam{"Query_2", execplan::initial_Query_2}, + /* + select t1.posname, t2.posname + from t1,t2 + where + t1.id = t2.id + and (t1.pos + t2.pos < 1000); + */ + ParseTreeTestParam{"Query_2", execplan::initial_Query_2}, - /* - select t1.posname, t2.posname - from t1,t2 - where - (t1.pos + t2.pos < 1000) - or - (t1.pos + t2.pos > 16000) - or - (t1.posname < dcba); + /* + select t1.posname, t2.posname + from t1,t2 + where + (t1.pos + t2.pos < 1000) + or + (t1.pos + t2.pos > 16000) + or + (t1.posname < dcba); - */ - ParseTreeTestParam{"Query_3", execplan::initial_Query_3}, + */ + ParseTreeTestParam{"Query_3", execplan::initial_Query_3}, - /* - select t1.posname, t2.posname -from t1,t2 -where -(t1.pos > 20) -or -(t2.posname in (select t1.posname from t1 where t1.pos > 20)); - */ + /* + select t1.posname, t2.posname + from t1,t2 + where + (t1.pos > 20) + or + (t2.posname in (select t1.posname from t1 where t1.pos > 20)); + */ + ParseTreeTestParam{"Query_4", execplan::initial_Query_4}, - ParseTreeTestParam{"Query_4", execplan::initial_Query_4}, + /*select t1.posname, t2.posname from t1,t2 + where + ( + t1.id = t2.id + or t1.pos + t2.pos < 1000 + ) + and + ( + t1.id = t2.id + or t1.pos + t2.pos > 15000 + ); + */ + ParseTreeTestParam{"Query_5", execplan::initial_Query_5}, -/*select t1.posname, t2.posname from t1,t2 -where -( -t1.id = t2.id -or t1.pos + t2.pos < 1000 -) -and -( -t1.id = t2.id -or t1.pos + t2.pos > 15000 -); -*/ - ParseTreeTestParam{"Query_5", execplan::initial_Query_5}, + /*select t1.posname, t2.posname from t1,t2 + where + ( + t1.id = t2.rid + or t1.pos + t2.pos < 1000 + ) + and + ( + t1.id = t2.id + or t1.pos + t2.pos > 15000 + ); + */ + ParseTreeTestParam{"Query_6", execplan::initial_Query_6}, -/*select t1.posname, t2.posname from t1,t2 -where -( -t1.id = t2.rid -or t1.pos + t2.pos < 1000 -) -and -( -t1.id = t2.id -or t1.pos + t2.pos > 15000 -); -*/ - ParseTreeTestParam{"Query_6", execplan::initial_Query_6}, + /* + select t1.posname + from t1 + where + t1.posname in + ( + select t1.posname + from t1 + where posname > 'qwer' + and + id < 30 + ); -/* - select t1.posname -from t1 -where -t1.posname in -( -select t1.posname -from t1 -where posname > 'qwer' -and -id < 30 -); + */ + ParseTreeTestParam{"Query_7", execplan::initial_Query_7}, - */ - ParseTreeTestParam{"Query_7", execplan::initial_Query_7}, + /*select t1.posname, t2.posname + from t1,t2 + where t1.posname in + ( + select t1.posname + from t1 + where posname > 'qwer' + and id < 30 + ) + and t1.id = t2.id; + */ + ParseTreeTestParam{"Query_8", execplan::initial_Query_8}, -/*select t1.posname, t2.posname -from t1,t2 -where t1.posname in -( -select t1.posname -from t1 -where posname > 'qwer' -and id < 30 -) -and t1.id = t2.id; -*/ - ParseTreeTestParam{"Query_8", execplan::initial_Query_8}, + /*select t1.posname, t2.posname + from t1,t2 + where t1.posname in + ( + select t1.posname + from t1 + where posname > 'qwer' + and id < 30 + ) and + ( + t1.id = t2.id + and t1.id = t2.rid + ); + */ + ParseTreeTestParam{"Query_9", execplan::initial_Query_9}, -/*select t1.posname, t2.posname -from t1,t2 -where t1.posname in -( -select t1.posname -from t1 -where posname > 'qwer' -and id < 30 -) and -( -t1.id = t2.id -and t1.id = t2.rid -); -*/ - ParseTreeTestParam{"Query_9", execplan::initial_Query_9}, + /*select * from t1 + where + ( + posname > 'qwer' + and id < 30 + ) + or + ( + pos > 5000 + and place > 'abcdefghij' + ); + */ + ParseTreeTestParam{"Query_10", execplan::initial_Query_10}, -/*select * from t1 -where -( -posname > 'qwer' -and id < 30 -) -or -( -pos > 5000 -and place > 'abcdefghij' -); -*/ - ParseTreeTestParam{"Query_10", execplan::initial_Query_10}, + /*select * + from t1 + where + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ); + */ + ParseTreeTestParam{"Query_11", execplan::initial_Query_11, execplan::reference_Query_11}, -/*select * -from t1 -where -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -); -*/ - ParseTreeTestParam{"Query_11", execplan::initial_Query_11, execplan::reference_Query_11}, + /*select * + from t1 + where + ( + pos > 5000 + and id < 30 + ) + and + ( + pos > 5000 + and id < 30 + ); + */ + ParseTreeTestParam{"Query_12", execplan::initial_Query_12}, -/*select * -from t1 -where -( -pos > 5000 -and id < 30 -) -and -( -pos > 5000 -and id < 30 -); -*/ - ParseTreeTestParam{"Query_12", execplan::initial_Query_12}, + /*select * + from t1 + where + ( + pos > 5000 + or id < 30 + ) + or + ( + pos > 5000 + or id < 30 + ); + */ + ParseTreeTestParam{"Query_13", execplan::initial_Query_13}, -/*select * -from t1 -where -( -pos > 5000 -or id < 30 -) -or -( -pos > 5000 -or id < 30 -); -*/ - ParseTreeTestParam{"Query_13", execplan::initial_Query_13}, + /*select * + from t1 + where + ( + id in + ( + select id + from t2 + where posname > 'qwer' + and rid > 10 + ) + ) + and + ( + pos > 5000 + or id < 30 + ); + */ + ParseTreeTestParam{"Query_14", execplan::initial_Query_14}, -/*select * -from t1 -where -( -id in -( -select id -from t2 -where posname > 'qwer' -and rid > 10 -) -) -and -( -pos > 5000 -or id < 30 -); -*/ - ParseTreeTestParam{"Query_14", execplan::initial_Query_14}, + /*select * + from t1 + where + ( + id in + ( + select id + from t2 + where + ( + posname > 'qwer' + and rid < 10 + ) + or + ( + posname > 'qwer' + and rid > 40 + ) + ) + ) + and + ( + pos > 5000 + or id < 30); + */ + ParseTreeTestParam{"Query_15", execplan::initial_Query_15, execplan::reference_Query_15}, + /* + select * + from t1 + where + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ); + */ + ParseTreeTestParam{"Query_16", execplan::initial_Query_16, execplan::reference_Query_16}, + /* + select * + from t1 + where + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ); + */ + ParseTreeTestParam{"Query_17", execplan::initial_Query_17, execplan::reference_Query_17}, + /* + select * + from t1 + where + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ); + */ + ParseTreeTestParam{"Query_18", execplan::initial_Query_18, execplan::reference_Query_18}, + /* + select * + from t1 + where + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ) + or + ( + pos > 5000 + and id < 30 + ); -/*select * -from t1 -where -( -id in -( -select id -from t2 -where -( -posname > 'qwer' -and rid < 10 -) -or -( -posname > 'qwer' -and rid > 40 -) -) -) -and -( -pos > 5000 -or id < 30); -*/ - ParseTreeTestParam{"Query_15", execplan::initial_Query_15, execplan::reference_Query_15}, -/* -select * -from t1 -where -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -); -*/ - ParseTreeTestParam{"Query_16", execplan::initial_Query_16, execplan::reference_Query_16}, -/* -select * -from t1 -where -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -); - */ - ParseTreeTestParam{"Query_17", execplan::initial_Query_17, execplan::reference_Query_17}, -/* -select * -from t1 -where -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -); - */ - ParseTreeTestParam{"Query_18", execplan::initial_Query_18, execplan::reference_Query_18}, -/* - select * -from t1 -where -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -) -or -( -pos > 5000 -and id < 30 -); + */ + ParseTreeTestParam{"Query_19", execplan::initial_Query_19, execplan::reference_Query_19}, + /* + select * + from t1 + where + ( + pos > 5000 + and id < 30 + ) + or + ( + posname > 'qwer' + and + id < 30 + and + place > 'abcdefghij' + ); - */ - ParseTreeTestParam{"Query_19", execplan::initial_Query_19, execplan::reference_Query_19}, -/* -select * -from t1 -where -( -pos > 5000 -and id < 30 -) -or -( -posname > 'qwer' -and -id < 30 -and -place > 'abcdefghij' -); + */ + ParseTreeTestParam{"Query_20", execplan::initial_Query_20, execplan::reference_Query_20}, + /* + select * + from t1 + where + ( + pos > 5000 + and id < 30 + ) + or + ( + posname > 'qwer' + and + id < 30 + and + place > 'abcdefghij' + ) + or + ( + id < 30 + and + place < 'zyxqwertyu' + ); - */ - ParseTreeTestParam{"Query_20", execplan::initial_Query_20, execplan::reference_Query_20}, -/* -select * -from t1 -where -( -pos > 5000 -and id < 30 -) -or -( -posname > 'qwer' -and -id < 30 -and -place > 'abcdefghij' -) -or -( -id < 30 -and -place < 'zyxqwertyu' -); + */ + ParseTreeTestParam{"Query_21", execplan::initial_Query_21, execplan::reference_Query_21}, + /* + select * + from t1 + where + (pos > 5000 and id < 30) + or + (posname > 'qwer' and id < 30 and place > 'abcdefghij' and pos > 5000) + or + (id < 30 and place < 'zyxqwertyu' and pos > 5000) + or + (pos > 5000 and id < 30); - */ - ParseTreeTestParam{"Query_21", execplan::initial_Query_21, execplan::reference_Query_21}, -/* -select * -from t1 -where -(pos > 5000 and id < 30) -or -(posname > 'qwer' and id < 30 and place > 'abcdefghij' and pos > 5000) -or -(id < 30 and place < 'zyxqwertyu' and pos > 5000) -or -(pos > 5000 and id < 30); + */ + ParseTreeTestParam{"Query_22", execplan::initial_Query_22, execplan::reference_Query_22}, - */ - ParseTreeTestParam{"Query_22", execplan::initial_Query_22, execplan::reference_Query_22}, + /* + select * + from t1 + where + (5000 < pos and id < 30) + or + (posname > 'qwer' and id < 30 and place > 'abcdefghij' and 5000 < pos) + or + (30 > id and place < 'zyxqwertyu' and pos > 5000) + or + (pos > 5000 and id < 30); + */ -/* - select * -from t1 -where -(5000 < pos and id < 30) -or -(posname > 'qwer' and id < 30 and place > 'abcdefghij' and 5000 < pos) -or -(30 > id and place < 'zyxqwertyu' and pos > 5000) -or -(pos > 5000 and id < 30); - */ + ParseTreeTestParam{"Query_23", execplan::initial_Query_23, execplan::reference_Query_23}, + /* + select * + from t1 + where + (pos > 5000 and id < 30 and rid > 20) + or + (posname > 'qwer' and id < 30 and place > 'abcdefghij' and pos > 5000 and rid > 20) + or + (id < 30 and place < 'zyxqwertyu' and pos > 5000 and rid > 20) + or + (pos > 5000 and id < 30 and rid > 20) + or + (pos > 5000 and id < 30 and place < 'zyxqwertyu' and rid > 20); + */ - ParseTreeTestParam{"Query_23", execplan::initial_Query_23, execplan::reference_Query_23}, -/* -select * -from t1 -where -(pos > 5000 and id < 30 and rid > 20) -or -(posname > 'qwer' and id < 30 and place > 'abcdefghij' and pos > 5000 and rid > 20) -or -(id < 30 and place < 'zyxqwertyu' and pos > 5000 and rid > 20) -or -(pos > 5000 and id < 30 and rid > 20) -or -(pos > 5000 and id < 30 and place < 'zyxqwertyu' and rid > 20); - */ - - ParseTreeTestParam{"Query_27", execplan::initial_Query_27, execplan::reference_Query_27}, -/* -select * -from t1 -where -(pos > 5000 and id < 30 and rid > 20 and place < 'zyxqwertyu') -or -(posname > 'qwer' and id < 30 and place > 'abcdefghij' and place < 'zyxqwertyu' and pos > 5000 and rid > 20) -or -(id < 30 and place < 'zyxqwertyu' and pos > 5000 and rid > 20) -or -(pos > 5000 and id < 30 and rid > 20 and place < 'zyxqwertyu' and place < 'zyxqwertyu'); - */ - - ParseTreeTestParam{"Query_28", execplan::initial_Query_28, execplan::reference_Query_28}, - ParseTreeTestParam{"TPCH_19", execplan::initial_TPCH_19, execplan::reference_TPCH_19} -), - [](const ::testing::TestParamInfo& info) { - return info.param.queryName; - } -); + ParseTreeTestParam{"Query_27", execplan::initial_Query_27, execplan::reference_Query_27}, + /* + select * + from t1 + where + (pos > 5000 and id < 30 and rid > 20 and place < 'zyxqwertyu') + or + (posname > 'qwer' and id < 30 and place > 'abcdefghij' and place < 'zyxqwertyu' and pos > 5000 and rid + > 20) or (id < 30 and place < 'zyxqwertyu' and pos > 5000 and rid > 20) or (pos > 5000 and id < 30 and + rid > 20 and place < 'zyxqwertyu' and place < 'zyxqwertyu'); + */ + ParseTreeTestParam{"Query_28", execplan::initial_Query_28, execplan::reference_Query_28}, + ParseTreeTestParam{"TPCH_19", execplan::initial_TPCH_19, execplan::reference_TPCH_19}), + [](const ::testing::TestParamInfo& info) { return info.param.queryName; }); struct ComparatorTestParam { @@ -564,14 +562,15 @@ struct ComparatorTestParam std::vector existingFilters; bool contains; - friend std::ostream& operator<<(std::ostream& os, const ComparatorTestParam& bar) + friend std::ostream& operator<<(std::ostream& os, const ComparatorTestParam& bar) { return os << bar.queryName; } }; - -class ParseTreeComparatorTest : public testing::TestWithParam {}; +class ParseTreeComparatorTest : public testing::TestWithParam +{ +}; struct TestComparator { @@ -588,12 +587,13 @@ TEST_P(ParseTreeComparatorTest, CompareContains) std::set, TestComparator> container; for (auto const& f : GetParam().existingFilters) { - container.insert(std::make_unique(new execplan::SimpleFilter(f, execplan::SimpleFilter::ForTestPurposesWithoutColumnsOIDS{}))); + container.insert(std::make_unique( + new execplan::SimpleFilter(f, execplan::SimpleFilter::ForTestPurposesWithoutColumnsOIDS{}))); } auto filter = std::make_unique(new execplan::SimpleFilter( GetParam().filter, execplan::SimpleFilter::ForTestPurposesWithoutColumnsOIDS{})); - ASSERT_EQ(GetParam().contains, container.count(filter)!=0); + ASSERT_EQ(GetParam().contains, container.count(filter) != 0); } INSTANTIATE_TEST_SUITE_P( diff --git a/tools/cleartablelock/cleartablelock.cpp b/tools/cleartablelock/cleartablelock.cpp index 4d3b2e0f1..361d354a6 100644 --- a/tools/cleartablelock/cleartablelock.cpp +++ b/tools/cleartablelock/cleartablelock.cpp @@ -250,7 +250,7 @@ int createMsgQueClts(const std::vector& pmList, // code is returned. //------------------------------------------------------------------------------ int sendRequest(const std::vector >& msgQueClts, - const std::vector& pmList, BRM::DBRM* brm, const BRM::TableLockInfo& tInfo, + const std::vector& pmList, BRM::DBRM* /*brm*/, const BRM::TableLockInfo& tInfo, const std::string& tblName, ClearTableLockThread::CLRTBLLOCK_MSGTYPE msgType, std::string& errMsg) { @@ -266,7 +266,7 @@ int sendRequest(const std::vector(p)) { } - explicit DD2MM(const A& a, const B& b) : A(b), B(b) + explicit DD2MM(const A& /*a*/, const B& b) : A(b), B(b) { } }; diff --git a/utils/common/hasher.h b/utils/common/hasher.h index f55d3c971..4d85cb07a 100644 --- a/utils/common/hasher.h +++ b/utils/common/hasher.h @@ -266,7 +266,7 @@ class Hasher64_r return h; } - inline uint64_t finalize(uint64_t h, uint64_t len) const + inline uint64_t finalize(uint64_t h, uint64_t /*len*/) const { h ^= h >> r; h *= m; diff --git a/utils/common/service.h b/utils/common/service.h index d95bd0299..d43512f03 100644 --- a/utils/common/service.h +++ b/utils/common/service.h @@ -33,7 +33,7 @@ class Service // The pipe to send messages from the child to the parent Pipe m_pipe; - static void common_signal_handler_CHLD(int sig) + static void common_signal_handler_CHLD(int /*sig*/) { } diff --git a/utils/common/simd_sse.h b/utils/common/simd_sse.h index 4a8fb42df..a0ef7b298 100644 --- a/utils/common/simd_sse.h +++ b/utils/common/simd_sse.h @@ -184,7 +184,7 @@ class SimdFilterProcessor< return _mm_loadu_si128(reinterpret_cast(from)); } - MCS_FORCE_INLINE MaskType cmpDummy(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpDummy(SimdType /*x*/, SimdType /*y*/) { return MaskType{0x0, 0x0}; } @@ -219,12 +219,12 @@ class SimdFilterProcessor< return cmpDummy(x, y); } - MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType /*x*/, SimdType /*y*/) { return MaskType{0x0, 0x0}; } - MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType /*x*/, SimdType /*y*/) { return _mm_set_epi64x(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL); // ???? } @@ -261,17 +261,17 @@ class SimdFilterProcessor< _mm_storeu_si128(reinterpret_cast(dst), x); } - MCS_FORCE_INLINE SimdType blend(SimdType x, SimdType y, SimdType mask) const + MCS_FORCE_INLINE SimdType blend(SimdType x, SimdType /*y*/, SimdType /*mask*/) const { return x; } - MCS_FORCE_INLINE SimdType bwAnd(SimdType x, SimdType y) const + MCS_FORCE_INLINE SimdType bwAnd(SimdType x, SimdType /*y*/) const { return x; } - MCS_FORCE_INLINE SimdType cmpGtSimdType(SimdType x, SimdType y) const + MCS_FORCE_INLINE SimdType cmpGtSimdType(SimdType x, SimdType /*y*/) const { return x; } @@ -364,12 +364,12 @@ class SimdFilterProcessor< return (MaskType)_mm_cmpneq_pd(x, y); } - MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType /*x*/, SimdType /*y*/) { return MaskType{0x0, 0x0}; } - MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType /*x*/, SimdType /*y*/) { return _mm_set_epi64x(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL); } @@ -525,12 +525,12 @@ class SimdFilterProcessor< return (MaskType)_mm_cmpneq_ps(x, y); } - MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType /*x*/, SimdType /*y*/) { return MaskType{0x0, 0x0}; } - MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType /*x*/, SimdType /*y*/) { return _mm_set_epi64x(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL); } @@ -678,12 +678,12 @@ class SimdFilterProcessor< return _mm_cmpeq_epi64(x, y) ^ loadValue(0xFFFFFFFFFFFFFFFF); } - MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType /*x*/, SimdType /*y*/) { return MaskType{0x0, 0x0}; } - MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType /*x*/, SimdType /*y*/) { return loadValue(0xFFFFFFFFFFFFFFFF); } @@ -823,12 +823,12 @@ class SimdFilterProcessor< return _mm_cmpeq_epi64(x, y) ^ loadValue(0xFFFFFFFFFFFFFFFF); } - MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType /*x*/, SimdType /*y*/) { return MaskType{0x0, 0x0}; } - MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType /*x*/, SimdType /*y*/) { return loadValue(0xFFFFFFFFFFFFFFFF); } @@ -976,12 +976,12 @@ class SimdFilterProcessor< return _mm_cmpeq_epi32(x, y) ^ loadValue(0xFFFFFFFF); } - MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType /*x*/, SimdType /*y*/) { return MaskType{0x0, 0x0}; } - MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType /*x*/, SimdType /*y*/) { return loadValue(0xFFFF); } @@ -1129,12 +1129,12 @@ class SimdFilterProcessor< return _mm_cmpeq_epi32(x, y) ^ loadValue(0xFFFFFFFF); } - MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType /*x*/, SimdType /*y*/) { return MaskType{0x0, 0x0}; } - MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType /*x*/, SimdType /*y*/) { return loadValue(0xFFFFFFFF); } @@ -1309,12 +1309,12 @@ class SimdFilterProcessor< return _mm_cmpeq_epi16(x, y) ^ loadValue(0xFFFF); } - MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysFalse(SimdType /*x*/, SimdType /*y*/) { return MaskType{0x0, 0x0}; } - MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType x, SimdType y) + MCS_FORCE_INLINE MaskType cmpAlwaysTrue(SimdType /*x*/, SimdType /*y*/) { return loadValue(0xFFFF); } @@ -1476,12 +1476,12 @@ class SimdFilterProcessor::~STLPoolAllocator() template typename STLPoolAllocator::pointer STLPoolAllocator::allocate( - typename STLPoolAllocator::size_type s, typename STLPoolAllocator::const_pointer hint) + typename STLPoolAllocator::size_type s, typename STLPoolAllocator::const_pointer /*hint*/) { return (pointer)pa->allocate(s * sizeof(T)); } template void STLPoolAllocator::deallocate(typename STLPoolAllocator::pointer p, - typename STLPoolAllocator::size_type n) + typename STLPoolAllocator::size_type /*n*/) { pa->deallocate((void*)p); } diff --git a/utils/compress/idbcompress.cpp b/utils/compress/idbcompress.cpp index adc7a9cd5..97c999d7d 100644 --- a/utils/compress/idbcompress.cpp +++ b/utils/compress/idbcompress.cpp @@ -602,10 +602,9 @@ size_t CompressInterfaceLZ4::maxCompressedSize(size_t uncompSize) const return (LZ4_COMPRESSBOUND(uncompSize) + HEADER_SIZE); } -bool CompressInterfaceLZ4::getUncompressedSize(char* in, size_t inLen, size_t* outLen) const +bool CompressInterfaceLZ4::getUncompressedSize(char* /*in*/, size_t /*inLen*/, size_t* /*outLen*/) const { // LZ4 does not have such function. - idbassert(false); return false; } diff --git a/utils/dataconvert/dataconvert.cpp b/utils/dataconvert/dataconvert.cpp index fb21923dd..5deffaa8f 100644 --- a/utils/dataconvert/dataconvert.cpp +++ b/utils/dataconvert/dataconvert.cpp @@ -495,8 +495,8 @@ template void number_int_value(const std::string& data, cscDataType ty bool& pushwarning, bool noRoundup, int128_t& intVal, bool* saturate); uint64_t number_uint_value(const string& data, cscDataType typeCode, - const datatypes::SystemCatalog::TypeAttributesStd& ct, bool& pushwarning, - bool noRoundup) + const datatypes::SystemCatalog::TypeAttributesStd& /*ct*/, bool& pushwarning, + bool /*noRoundup*/) { // copy of the original input string valStr(data); diff --git a/utils/funcexp/func_abs.cpp b/utils/funcexp/func_abs.cpp index cd05ade7a..576242645 100644 --- a/utils/funcexp/func_abs.cpp +++ b/utils/funcexp/func_abs.cpp @@ -37,7 +37,7 @@ using namespace rowgroup; namespace funcexp { CalpontSystemCatalog::ColType Func_abs::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_add_time.cpp b/utils/funcexp/func_add_time.cpp index f69696537..ec4202ea0 100644 --- a/utils/funcexp/func_add_time.cpp +++ b/utils/funcexp/func_add_time.cpp @@ -38,7 +38,7 @@ using namespace dataconvert; namespace funcexp { -CalpontSystemCatalog::ColType Func_add_time::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_add_time::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; @@ -244,7 +244,7 @@ int64_t Func_add_time::getTimestampIntVal(rowgroup::Row& row, FunctionParm& parm } int64_t Func_add_time::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { int64_t val1 = parm[0]->data()->getTimeIntVal(row, isNull); diff --git a/utils/funcexp/func_ascii.cpp b/utils/funcexp/func_ascii.cpp index cc1f1d165..2b59b05eb 100644 --- a/utils/funcexp/func_ascii.cpp +++ b/utils/funcexp/func_ascii.cpp @@ -38,14 +38,14 @@ using namespace dataconvert; namespace funcexp { -CalpontSystemCatalog::ColType Func_ascii::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_ascii::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } int64_t Func_ascii::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + CalpontSystemCatalog::ColType& /*op_ct*/) { const auto& str = parm[0]->data()->getStrVal(row, isNull); diff --git a/utils/funcexp/func_between.cpp b/utils/funcexp/func_between.cpp index 80f3cbf24..4d859d73e 100644 --- a/utils/funcexp/func_between.cpp +++ b/utils/funcexp/func_between.cpp @@ -258,7 +258,7 @@ inline bool getBool(rowgroup::Row& row, funcexp::FunctionParm& pm, bool& isNull, return !isNull && strGE(cs, val, pm[1]->data()->getStrVal(row, isNull).safeString("")) && strLE(cs, val, pm[2]->data()->getStrVal(row, isNull).safeString("")); } - break; // XXX: gcc falsely complains here. + break; // XXX: gcc falsely complains here. default: { @@ -330,7 +330,8 @@ CalpontSystemCatalog::ColType Func_between::operationType(FunctionParm& fp, if (cc) { Result result = cc->result(); - result.intVal = dataconvert::DataConvert::timestampToInt(result.strVal.safeString(""), resultType.getTimeZone()); + result.intVal = + dataconvert::DataConvert::timestampToInt(result.strVal.safeString(""), resultType.getTimeZone()); cc->result(result); } } @@ -362,7 +363,7 @@ bool Func_between::getBoolVal(rowgroup::Row& row, FunctionParm& pm, bool& isNull } CalpontSystemCatalog::ColType Func_notbetween::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { PredicateOperator* op = new PredicateOperator(); CalpontSystemCatalog::ColType ct; diff --git a/utils/funcexp/func_bitwise.cpp b/utils/funcexp/func_bitwise.cpp index c0945bdff..e2cf95a25 100644 --- a/utils/funcexp/func_bitwise.cpp +++ b/utils/funcexp/func_bitwise.cpp @@ -71,7 +71,7 @@ datatypes::TUInt64Null ConvertToBitOperand(const T& val) } static datatypes::TUInt64Null DecimalToBitOperand(Row& row, const execplan::SPTP& parm, - const funcexp::Func& thisFunc) + const funcexp::Func& /*thisFunc*/) { bool tmpIsNull = false; datatypes::Decimal d = parm->data()->getDecimalVal(row, tmpIsNull); @@ -253,10 +253,9 @@ class Func_bitwise_null : public Func_BitOp Func_bitwise_null() : Func_BitOp("bitwise") { } - int64_t getIntVal(Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& operationColType) override + int64_t getIntVal(Row& /*row*/, FunctionParm& /*parm*/, bool& /*isNull*/, + CalpontSystemCatalog::ColType& /*operationColType*/) override { - isNull = true; return 0; } }; diff --git a/utils/funcexp/func_cast.cpp b/utils/funcexp/func_cast.cpp index 870c48167..147dbd760 100644 --- a/utils/funcexp/func_cast.cpp +++ b/utils/funcexp/func_cast.cpp @@ -52,43 +52,43 @@ struct lconv* convData = localeconv(); namespace funcexp { // Why isn't "return resultType" the base default behavior? -CalpontSystemCatalog::ColType Func_cast_signed::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_cast_signed::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } -CalpontSystemCatalog::ColType Func_cast_unsigned::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_cast_unsigned::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } -CalpontSystemCatalog::ColType Func_cast_char::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_cast_char::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } -CalpontSystemCatalog::ColType Func_cast_date::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_cast_date::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } -CalpontSystemCatalog::ColType Func_cast_datetime::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_cast_datetime::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } -CalpontSystemCatalog::ColType Func_cast_decimal::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_cast_decimal::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } -CalpontSystemCatalog::ColType Func_cast_double::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_cast_double::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_ceil.cpp b/utils/funcexp/func_ceil.cpp index d105b5c20..4db3fe55e 100644 --- a/utils/funcexp/func_ceil.cpp +++ b/utils/funcexp/func_ceil.cpp @@ -45,24 +45,27 @@ using namespace dataconvert; namespace funcexp { CalpontSystemCatalog::ColType Func_ceil::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } inline int64_t ceilDateTime(Row& row, FunctionParm& parm, bool& isNull) { - // the following is to handle the case of ceil(datetime), the last 20 bits are the miliseconds, the -1 is to make sure it could round up + // the following is to handle the case of ceil(datetime), the last 20 bits are the miliseconds, the -1 is to + // make sure it could round up return parm[0]->data()->getDatetimeIntVal(row, isNull) + 0xffffe; } inline int64_t ceilTimeStamp(Row& row, FunctionParm& parm, bool& isNull) { - // the following is to handle the case of ceil(timestamp), the last 20 bits are the miliseconds, the -1 is to make sure it could round up + // the following is to handle the case of ceil(timestamp), the last 20 bits are the miliseconds, the -1 is + // to make sure it could round up return parm[0]->data()->getTimestampIntVal(row, isNull) + 0xffffe; } inline int64_t ceilTime(Row& row, FunctionParm& parm, bool& isNull) { - // the following is to handle the case of ceil(time), the last 24 bits are the miliseconds, the -1 is to make sure it could round up + // the following is to handle the case of ceil(time), the last 24 bits are the miliseconds, the -1 is to + // make sure it could round up return parm[0]->data()->getTimeIntVal(row, isNull) + 0xfffffe; } diff --git a/utils/funcexp/func_char.cpp b/utils/funcexp/func_char.cpp index 0c4adeaf9..d0ab29c37 100644 --- a/utils/funcexp/func_char.cpp +++ b/utils/funcexp/func_char.cpp @@ -79,7 +79,7 @@ inline size_t getChar(int32_t num, char*& buf) namespace funcexp { CalpontSystemCatalog::ColType Func_char::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_char_length.cpp b/utils/funcexp/func_char_length.cpp index a966989fc..1e47c33a9 100644 --- a/utils/funcexp/func_char_length.cpp +++ b/utils/funcexp/func_char_length.cpp @@ -43,7 +43,7 @@ using namespace logging; namespace funcexp { CalpontSystemCatalog::ColType Func_char_length::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } diff --git a/utils/funcexp/func_coalesce.cpp b/utils/funcexp/func_coalesce.cpp index 0a8b28599..97e85240a 100644 --- a/utils/funcexp/func_coalesce.cpp +++ b/utils/funcexp/func_coalesce.cpp @@ -39,14 +39,14 @@ using namespace dataconvert; namespace funcexp { -CalpontSystemCatalog::ColType Func_coalesce::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_coalesce::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } int64_t Func_coalesce::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + CalpontSystemCatalog::ColType& /*op_ct*/) { int64_t val = 0; @@ -68,7 +68,7 @@ int64_t Func_coalesce::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& i } string Func_coalesce::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { string val; @@ -90,7 +90,7 @@ string Func_coalesce::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& is } int32_t Func_coalesce::getDateIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { int64_t val = 0; @@ -112,7 +112,7 @@ int32_t Func_coalesce::getDateIntVal(rowgroup::Row& row, FunctionParm& parm, boo } int64_t Func_coalesce::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { int64_t val = 0; @@ -134,7 +134,7 @@ int64_t Func_coalesce::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& parm, } int64_t Func_coalesce::getTimestampIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { int64_t val = 0; @@ -156,7 +156,7 @@ int64_t Func_coalesce::getTimestampIntVal(rowgroup::Row& row, FunctionParm& parm } int64_t Func_coalesce::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { int64_t val = 0; @@ -178,7 +178,7 @@ int64_t Func_coalesce::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm, boo } double Func_coalesce::getDoubleVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& ct) + execplan::CalpontSystemCatalog::ColType& /*ct*/) { double d = 0.0; @@ -200,7 +200,7 @@ double Func_coalesce::getDoubleVal(rowgroup::Row& row, FunctionParm& parm, bool& } long double Func_coalesce::getLongDoubleVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& ct) + execplan::CalpontSystemCatalog::ColType& /*ct*/) { long double d = 0.0; @@ -222,7 +222,7 @@ long double Func_coalesce::getLongDoubleVal(rowgroup::Row& row, FunctionParm& pa } execplan::IDB_Decimal Func_coalesce::getDecimalVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& ct) + execplan::CalpontSystemCatalog::ColType& /*ct*/) { IDB_Decimal d; diff --git a/utils/funcexp/func_concat_oracle.cpp b/utils/funcexp/func_concat_oracle.cpp index 55a07e053..9138b654a 100644 --- a/utils/funcexp/func_concat_oracle.cpp +++ b/utils/funcexp/func_concat_oracle.cpp @@ -31,7 +31,7 @@ using namespace dataconvert; namespace funcexp { CalpontSystemCatalog::ColType Func_concat_oracle::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_concat_ws.cpp b/utils/funcexp/func_concat_ws.cpp index 8d7d34549..98758d8e8 100644 --- a/utils/funcexp/func_concat_ws.cpp +++ b/utils/funcexp/func_concat_ws.cpp @@ -35,14 +35,14 @@ using namespace rowgroup; namespace funcexp { CalpontSystemCatalog::ColType Func_concat_ws::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); } string Func_concat_ws::getStrVal(Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& type) + CalpontSystemCatalog::ColType& /*type*/) { string delim; stringValue(parm[0], row, isNull, delim); @@ -51,7 +51,7 @@ string Func_concat_ws::getStrVal(Row& row, FunctionParm& parm, bool& isNull, // TODO: I don't think we need wide chars here. // Concatenation works without see Server implementation. -#if 0 +#if 0 wstring wstr; size_t strwclen = utf8::idb_mbstowcs(0, delim.c_str(), 0) + 1; wchar_t* wcbuf = new wchar_t[strwclen]; @@ -61,7 +61,7 @@ string Func_concat_ws::getStrVal(Row& row, FunctionParm& parm, bool& isNull, for ( unsigned int id = 1 ; id < parm.size() ; id++) { string tstr; - stringValue(parm[id], row, isNull, tstr); + stringValue(parm[id], row, isNull, tstr); if (isNull) { isNull = false; @@ -105,7 +105,7 @@ string Func_concat_ws::getStrVal(Row& row, FunctionParm& parm, bool& isNull, continue; } - if (!firstTime) // XXX: XXX: XXX: concatenation of empty strings will result in empty string. + if (!firstTime) // XXX: XXX: XXX: concatenation of empty strings will result in empty string. str += delim; firstTime = false; @@ -114,7 +114,8 @@ string Func_concat_ws::getStrVal(Row& row, FunctionParm& parm, bool& isNull, str += tmp; } - if (firstTime) { + if (firstTime) + { // all arguments are NULL. isNull = true; return str; diff --git a/utils/funcexp/func_conv.cpp b/utils/funcexp/func_conv.cpp index f485b502f..0b87ed657 100644 --- a/utils/funcexp/func_conv.cpp +++ b/utils/funcexp/func_conv.cpp @@ -268,14 +268,14 @@ const char* convNumToStr(int64_t val, char* dst, int radix) } // namespace helpers CalpontSystemCatalog::ColType Func_conv::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); } string Func_conv::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + CalpontSystemCatalog::ColType& /*op_ct*/) { const auto& res = parm[0]->data()->getStrVal(row, isNull); string str; diff --git a/utils/funcexp/func_convert_tz.cpp b/utils/funcexp/func_convert_tz.cpp index 494ad754c..99962fe3e 100644 --- a/utils/funcexp/func_convert_tz.cpp +++ b/utils/funcexp/func_convert_tz.cpp @@ -42,7 +42,7 @@ namespace funcexp { // need my_tz_find in dataconvert -CalpontSystemCatalog::ColType Func_convert_tz::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_convert_tz::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; @@ -55,7 +55,7 @@ int64_t Func_convert_tz::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& par } int64_t Func_convert_tz::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + CalpontSystemCatalog::ColType& /*op_ct*/) { messageqcpp::ByteStream bs; bool bFromTz = false; diff --git a/utils/funcexp/func_crc32.cpp b/utils/funcexp/func_crc32.cpp index 2a266e2fc..b576bc0b4 100644 --- a/utils/funcexp/func_crc32.cpp +++ b/utils/funcexp/func_crc32.cpp @@ -36,14 +36,14 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_crc32::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_crc32::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } int64_t Func_crc32::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { unsigned crc; switch (parm.size()) diff --git a/utils/funcexp/func_date.cpp b/utils/funcexp/func_date.cpp index e8191ed00..dd1aa04b2 100644 --- a/utils/funcexp/func_date.cpp +++ b/utils/funcexp/func_date.cpp @@ -40,7 +40,7 @@ using namespace logging; namespace funcexp { -CalpontSystemCatalog::ColType Func_date::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_date::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_date_add.cpp b/utils/funcexp/func_date_add.cpp index 6c5e27bb6..81a619462 100644 --- a/utils/funcexp/func_date_add.cpp +++ b/utils/funcexp/func_date_add.cpp @@ -718,7 +718,7 @@ uint64_t dateAdd(uint64_t time, const string& expr, IntervalColumn::interval_typ } } // namespace helpers -CalpontSystemCatalog::ColType Func_date_add::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_date_add::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { resultType.colDataType = CalpontSystemCatalog::DATETIME; @@ -760,7 +760,8 @@ int64_t Func_date_add::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& i case execplan::CalpontSystemCatalog::CHAR: case execplan::CalpontSystemCatalog::TEXT: { - val = dataconvert::DataConvert::stringToDatetime(parm[0]->data()->getStrVal(row, isNull).safeString("")); + val = + dataconvert::DataConvert::stringToDatetime(parm[0]->data()->getStrVal(row, isNull).safeString("")); break; } @@ -821,7 +822,8 @@ int64_t Func_date_add::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& i else funcType = static_cast(parm[3]->data()->getIntVal(row, isNull)); - uint64_t value = helpers::dateAdd(val, parm[1]->data()->getStrVal(row, isNull).safeString(""), unit, dateType, funcType); + uint64_t value = + helpers::dateAdd(val, parm[1]->data()->getStrVal(row, isNull).safeString(""), unit, dateType, funcType); if (value == 0) isNull = true; diff --git a/utils/funcexp/func_date_format.cpp b/utils/funcexp/func_date_format.cpp index bb595aa5d..d4b5fd686 100644 --- a/utils/funcexp/func_date_format.cpp +++ b/utils/funcexp/func_date_format.cpp @@ -59,13 +59,9 @@ const string IDB_date_format(const DateTime& dt, const string& format, bool& isN switch (format[i]) { - case 'M': - oss << helpers::monthFullNames[dt.month]; - break; + case 'M': oss << helpers::monthFullNames[dt.month]; break; - case 'b': - oss << helpers::monthAbNames[dt.month].c_str(); - break; + case 'b': oss << helpers::monthAbNames[dt.month].c_str(); break; case 'W': weekday = helpers::calc_mysql_weekday(dt.year, dt.month, dt.day, false, isNull); @@ -83,9 +79,7 @@ const string IDB_date_format(const DateTime& dt, const string& format, bool& isN oss << helpers::weekdayAbNames[weekday]; break; - case 'D': - oss << helpers::dayOfMonth[dt.day].c_str(); - break; + case 'D': oss << helpers::dayOfMonth[dt.day].c_str(); break; case 'Y': sprintf(buf, "%04d", dt.year); @@ -227,8 +221,8 @@ const string IDB_date_format(const DateTime& dt, const string& format, bool& isN } } // namespace helpers -CalpontSystemCatalog::ColType Func_date_format::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_date_format::operationType(FunctionParm& /*fp*/, + CalpontSystemCatalog::ColType& /*resultType*/) { CalpontSystemCatalog::ColType ct; ct.colDataType = CalpontSystemCatalog::VARCHAR; diff --git a/utils/funcexp/func_day.cpp b/utils/funcexp/func_day.cpp index 8cad752b5..bb31049d7 100644 --- a/utils/funcexp/func_day.cpp +++ b/utils/funcexp/func_day.cpp @@ -35,7 +35,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_day::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_day::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; @@ -80,7 +80,8 @@ int64_t Func_day::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::TEXT: case CalpontSystemCatalog::VARCHAR: - val = dataconvert::DataConvert::stringToDatetime(parm[0]->data()->getStrVal(row, isNull).safeString("")); + val = + dataconvert::DataConvert::stringToDatetime(parm[0]->data()->getStrVal(row, isNull).safeString("")); if (val == -1) { diff --git a/utils/funcexp/func_dayname.cpp b/utils/funcexp/func_dayname.cpp index a5c870207..9f3c702b9 100644 --- a/utils/funcexp/func_dayname.cpp +++ b/utils/funcexp/func_dayname.cpp @@ -36,7 +36,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_dayname::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_dayname::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; @@ -97,7 +97,8 @@ int64_t Func_dayname::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& is case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::TEXT: case CalpontSystemCatalog::VARCHAR: - val = dataconvert::DataConvert::stringToDatetime(parm[0]->data()->getStrVal(row, isNull).safeString("")); + val = + dataconvert::DataConvert::stringToDatetime(parm[0]->data()->getStrVal(row, isNull).safeString("")); if (val == -1) { diff --git a/utils/funcexp/func_dayofweek.cpp b/utils/funcexp/func_dayofweek.cpp index 0f8b07253..d22e3a139 100644 --- a/utils/funcexp/func_dayofweek.cpp +++ b/utils/funcexp/func_dayofweek.cpp @@ -36,7 +36,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_dayofweek::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_dayofweek::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; @@ -96,29 +96,29 @@ int64_t Func_dayofweek::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::TEXT: case CalpontSystemCatalog::VARCHAR: + { + const auto& valStr = parm[0]->data()->getStrVal(row, isNull); + + if (valStr.isNull()) { - const auto& valStr = parm[0]->data()->getStrVal(row, isNull); - - if (valStr.isNull()) - { - isNull = true; - return -1; - } - - val = dataconvert::DataConvert::stringToDatetime(valStr.safeString("")); - if (val == -1) - { - isNull = true; - return -1; - } - else - { - year = (uint32_t)((val >> 48) & 0xffff); - month = (uint32_t)((val >> 44) & 0xf); - day = (uint32_t)((val >> 38) & 0x3f); - } + isNull = true; + return -1; } - break; + + val = dataconvert::DataConvert::stringToDatetime(valStr.safeString("")); + if (val == -1) + { + isNull = true; + return -1; + } + else + { + year = (uint32_t)((val >> 48) & 0xffff); + month = (uint32_t)((val >> 44) & 0xf); + day = (uint32_t)((val >> 38) & 0x3f); + } + } + break; case CalpontSystemCatalog::BIGINT: case CalpontSystemCatalog::MEDINT: diff --git a/utils/funcexp/func_dayofyear.cpp b/utils/funcexp/func_dayofyear.cpp index 5cd0dd47a..e81f8d039 100644 --- a/utils/funcexp/func_dayofyear.cpp +++ b/utils/funcexp/func_dayofyear.cpp @@ -36,7 +36,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_dayofyear::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_dayofyear::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_decode.cpp b/utils/funcexp/func_decode.cpp index 9cccc6b61..375bf3323 100644 --- a/utils/funcexp/func_decode.cpp +++ b/utils/funcexp/func_decode.cpp @@ -45,7 +45,7 @@ void Func_decode::hash_password(ulong* result, const char* password, uint passwo result[1] = nr2 & (((ulong)1L << 31) - 1L); } -CalpontSystemCatalog::ColType Func_decode::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_decode::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_div.cpp b/utils/funcexp/func_div.cpp index d36e75c9e..f5fa505da 100644 --- a/utils/funcexp/func_div.cpp +++ b/utils/funcexp/func_div.cpp @@ -38,14 +38,14 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_div::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_div::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } int64_t Func_div::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + CalpontSystemCatalog::ColType& /*op_ct*/) { double val1 = parm[0]->data()->getDoubleVal(row, isNull); double val2 = parm[1]->data()->getDoubleVal(row, isNull); @@ -58,7 +58,7 @@ int64_t Func_div::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull // MCOL-179 InnoDB doesn't round or convert to int before dividing. return static_cast(val1 / val2); -#if 0 +#if 0 int64_t int_val2 = (int64_t)(val2 > 0 ? val2 + 0.5 : val2 - 0.5); if (int_val2 == 0) @@ -81,7 +81,7 @@ int64_t Func_div::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull } uint64_t Func_div::getUintVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { uint64_t val1 = parm[0]->data()->getUintVal(row, isNull); uint64_t val2 = parm[1]->data()->getUintVal(row, isNull); diff --git a/utils/funcexp/func_elt.cpp b/utils/funcexp/func_elt.cpp index 860dd1ae3..d6748933c 100644 --- a/utils/funcexp/func_elt.cpp +++ b/utils/funcexp/func_elt.cpp @@ -38,7 +38,7 @@ using namespace dataconvert; namespace funcexp { -CalpontSystemCatalog::ColType Func_elt::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_elt::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_encode.cpp b/utils/funcexp/func_encode.cpp index 442391c06..7d7090a33 100644 --- a/utils/funcexp/func_encode.cpp +++ b/utils/funcexp/func_encode.cpp @@ -46,7 +46,7 @@ void Func_encode::hash_password(ulong* result, const char* password, uint passwo result[1] = nr2 & (((ulong)1L << 31) - 1L); } -CalpontSystemCatalog::ColType Func_encode::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_encode::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_exp.cpp b/utils/funcexp/func_exp.cpp index d57b28556..df051ccd4 100644 --- a/utils/funcexp/func_exp.cpp +++ b/utils/funcexp/func_exp.cpp @@ -42,7 +42,7 @@ using namespace logging; namespace funcexp { CalpontSystemCatalog::ColType Func_exp::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_extract.cpp b/utils/funcexp/func_extract.cpp index 4f04bb220..0c3c72b80 100644 --- a/utils/funcexp/func_extract.cpp +++ b/utils/funcexp/func_extract.cpp @@ -177,7 +177,7 @@ long long timeGet(uint64_t time, IntervalColumn::interval_type unit) namespace funcexp { -CalpontSystemCatalog::ColType Func_extract::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_extract::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_find_in_set.cpp b/utils/funcexp/func_find_in_set.cpp index b732f4418..ddd467711 100644 --- a/utils/funcexp/func_find_in_set.cpp +++ b/utils/funcexp/func_find_in_set.cpp @@ -44,7 +44,7 @@ using namespace logging; namespace funcexp { -CalpontSystemCatalog::ColType Func_find_in_set::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_find_in_set::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_floor.cpp b/utils/funcexp/func_floor.cpp index 8acaff38e..f25716ade 100644 --- a/utils/funcexp/func_floor.cpp +++ b/utils/funcexp/func_floor.cpp @@ -41,7 +41,7 @@ using namespace dataconvert; namespace funcexp { CalpontSystemCatalog::ColType Func_floor::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } @@ -224,8 +224,8 @@ uint64_t Func_floor::getUintVal(Row& row, FunctionParm& parm, bool& isNull, case execplan::CalpontSystemCatalog::TIMESTAMP: { - string str = - DataConvert::timestampToString1(parm[0]->data()->getTimestampIntVal(row, isNull), op_ct.getTimeZone()); + string str = DataConvert::timestampToString1(parm[0]->data()->getTimestampIntVal(row, isNull), + op_ct.getTimeZone()); // strip off micro seconds str = str.substr(0, 14); @@ -518,8 +518,8 @@ IDB_Decimal Func_floor::getDecimalVal(Row& row, FunctionParm& parm, bool& isNull case execplan::CalpontSystemCatalog::TIMESTAMP: { - string str = - DataConvert::timestampToString1(parm[0]->data()->getTimestampIntVal(row, isNull), op_ct.getTimeZone()); + string str = DataConvert::timestampToString1(parm[0]->data()->getTimestampIntVal(row, isNull), + op_ct.getTimeZone()); // strip off micro seconds str = str.substr(0, 14); diff --git a/utils/funcexp/func_from_days.cpp b/utils/funcexp/func_from_days.cpp index a3e964ee8..f6b3b312f 100644 --- a/utils/funcexp/func_from_days.cpp +++ b/utils/funcexp/func_from_days.cpp @@ -37,7 +37,7 @@ using namespace dataconvert; namespace funcexp { -CalpontSystemCatalog::ColType Func_from_days::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_from_days::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; @@ -62,7 +62,7 @@ int32_t Func_from_days::getDateIntVal(rowgroup::Row& row, FunctionParm& parm, bo } int64_t Func_from_days::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { double val1 = parm[0]->data()->getDoubleVal(row, isNull); int64_t daynr = (int64_t)(val1 > 0 ? val1 + 0.5 : val1 - 0.5); diff --git a/utils/funcexp/func_from_unixtime.cpp b/utils/funcexp/func_from_unixtime.cpp index 176cec406..ce91cdae9 100644 --- a/utils/funcexp/func_from_unixtime.cpp +++ b/utils/funcexp/func_from_unixtime.cpp @@ -114,8 +114,8 @@ DateTime getDateTime(rowgroup::Row& row, FunctionParm& parm, bool& isNull) namespace funcexp { -CalpontSystemCatalog::ColType Func_from_unixtime::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_from_unixtime::operationType(FunctionParm& /*fp*/, + CalpontSystemCatalog::ColType& /*resultType*/) { CalpontSystemCatalog::ColType ct; ct.colDataType = CalpontSystemCatalog::VARCHAR; @@ -152,7 +152,7 @@ int32_t Func_from_unixtime::getDateIntVal(rowgroup::Row& row, FunctionParm& parm } int64_t Func_from_unixtime::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { DateTime dt = getDateTime(row, parm, isNull); @@ -166,7 +166,7 @@ int64_t Func_from_unixtime::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& } int64_t Func_from_unixtime::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { DateTime dt = getDateTime(row, parm, isNull); @@ -180,7 +180,7 @@ int64_t Func_from_unixtime::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm } int64_t Func_from_unixtime::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { DateTime dt = getDateTime(row, parm, isNull); diff --git a/utils/funcexp/func_get_format.cpp b/utils/funcexp/func_get_format.cpp index 7fa69ede9..bd802e175 100644 --- a/utils/funcexp/func_get_format.cpp +++ b/utils/funcexp/func_get_format.cpp @@ -53,7 +53,7 @@ string known_date_time_formats[5][4] = {{"USA", "%m.%d.%Y", "%Y-%m-%d %H.%i.%s", string know_types[3] = {"DATE", "DATETIME", "TIME"}; -CalpontSystemCatalog::ColType Func_get_format::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_get_format::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; @@ -98,9 +98,7 @@ string Func_get_format::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& { case 0: return known_date_time_formats[i][2]; break; - default: - isNull = true; - return ""; + default: isNull = true; return ""; } } } diff --git a/utils/funcexp/func_greatest.cpp b/utils/funcexp/func_greatest.cpp index 6d021cfbb..6fb517c6b 100644 --- a/utils/funcexp/func_greatest.cpp +++ b/utils/funcexp/func_greatest.cpp @@ -41,7 +41,7 @@ using namespace funcexp; namespace funcexp { -CalpontSystemCatalog::ColType Func_greatest::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_greatest::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { // operation type is not used by this functor @@ -50,7 +50,7 @@ CalpontSystemCatalog::ColType Func_greatest::operationType(FunctionParm& fp, } int64_t Func_greatest::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { double str = fp[0]->data()->getDoubleVal(row, isNull); @@ -68,7 +68,7 @@ int64_t Func_greatest::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isN } uint64_t Func_greatest::getUintVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { double str = fp[0]->data()->getDoubleVal(row, isNull); @@ -86,7 +86,7 @@ uint64_t Func_greatest::getUintVal(rowgroup::Row& row, FunctionParm& fp, bool& i } double Func_greatest::getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { double str = fp[0]->data()->getDoubleVal(row, isNull); @@ -104,7 +104,7 @@ double Func_greatest::getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& i } long double Func_greatest::getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { long double str = fp[0]->data()->getLongDoubleVal(row, isNull); @@ -122,7 +122,7 @@ long double Func_greatest::getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp } std::string Func_greatest::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { const auto& str = fp[0]->data()->getStrVal(row, isNull); CHARSET_INFO* cs = fp[0]->data()->resultType().getCharset(); @@ -143,7 +143,7 @@ std::string Func_greatest::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& } IDB_Decimal Func_greatest::getDecimalVal(Row& row, FunctionParm& fp, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { // double str = fp[0]->data()->getDoubleVal(row, isNull); IDB_Decimal str = fp[0]->data()->getDecimalVal(row, isNull); @@ -162,7 +162,7 @@ IDB_Decimal Func_greatest::getDecimalVal(Row& row, FunctionParm& fp, bool& isNul } int32_t Func_greatest::getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& ct) + execplan::CalpontSystemCatalog::ColType& /*ct*/) { int32_t str = fp[0]->data()->getDateIntVal(row, isNull); @@ -180,7 +180,7 @@ int32_t Func_greatest::getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& } int64_t Func_greatest::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& ct) + execplan::CalpontSystemCatalog::ColType& /*ct*/) { int64_t str = fp[0]->data()->getDatetimeIntVal(row, isNull); @@ -198,7 +198,7 @@ int64_t Func_greatest::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, b } int64_t Func_greatest::getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& ct) + execplan::CalpontSystemCatalog::ColType& /*ct*/) { int64_t str = fp[0]->data()->getTimestampIntVal(row, isNull); @@ -216,7 +216,7 @@ int64_t Func_greatest::getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, } int64_t Func_greatest::getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& ct) + execplan::CalpontSystemCatalog::ColType& /*ct*/) { // Strip off unused day int64_t greatestStr = fp[0]->data()->getTimeIntVal(row, isNull); diff --git a/utils/funcexp/func_hex.cpp b/utils/funcexp/func_hex.cpp index 5d2ee5aa9..bcd66b24f 100644 --- a/utils/funcexp/func_hex.cpp +++ b/utils/funcexp/func_hex.cpp @@ -55,7 +55,7 @@ void octet2hex(char* to, const char* str, uint32_t len) *to = '\0'; } -CalpontSystemCatalog::ColType Func_hex::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_hex::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; @@ -79,7 +79,7 @@ string Func_hex::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, case CalpontSystemCatalog::TIME: { const auto& arg = parm[0]->data()->getStrVal(row, isNull); - scoped_array hexPtr(new char[arg.length() * 2 + 1]); // XXX: code now the same as for BLOB. + scoped_array hexPtr(new char[arg.length() * 2 + 1]); // XXX: code now the same as for BLOB. octet2hex(hexPtr.get(), arg.str(), arg.length()); return string(hexPtr.get(), arg.length() * 2); } diff --git a/utils/funcexp/func_hour.cpp b/utils/funcexp/func_hour.cpp index 0550ef3ef..6839a5502 100644 --- a/utils/funcexp/func_hour.cpp +++ b/utils/funcexp/func_hour.cpp @@ -35,7 +35,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_hour::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_hour::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_idbpartition.cpp b/utils/funcexp/func_idbpartition.cpp index b7b5e6971..48982766d 100644 --- a/utils/funcexp/func_idbpartition.cpp +++ b/utils/funcexp/func_idbpartition.cpp @@ -43,8 +43,8 @@ using namespace logging; namespace funcexp { -CalpontSystemCatalog::ColType Func_idbpartition::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_idbpartition::operationType(FunctionParm& /*fp*/, + CalpontSystemCatalog::ColType& /*resultType*/) { // all integer CalpontSystemCatalog::ColType ct; @@ -54,7 +54,7 @@ CalpontSystemCatalog::ColType Func_idbpartition::operationType(FunctionParm& fp, } string Func_idbpartition::getStrVal(Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { LogicalPartition part(parm[0]->data()->getIntVal(row, isNull), parm[1]->data()->getIntVal(row, isNull), parm[2]->data()->getIntVal(row, isNull)); diff --git a/utils/funcexp/func_ifnull.cpp b/utils/funcexp/func_ifnull.cpp index 2dcb67736..b5260a362 100644 --- a/utils/funcexp/func_ifnull.cpp +++ b/utils/funcexp/func_ifnull.cpp @@ -45,7 +45,7 @@ namespace funcexp // CalpontSystemCatalog::ColType Func_ifnull::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_in.cpp b/utils/funcexp/func_in.cpp index aa0e7b9e7..3f3b9aaa0 100644 --- a/utils/funcexp/func_in.cpp +++ b/utils/funcexp/func_in.cpp @@ -297,7 +297,7 @@ inline bool getBoolForIn(rowgroup::Row& row, funcexp::FunctionParm& pm, bool& is namespace funcexp { CalpontSystemCatalog::ColType Func_in::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { PredicateOperator op; CalpontSystemCatalog::ColType ct; @@ -371,7 +371,7 @@ bool Func_in::getBoolVal(rowgroup::Row& row, FunctionParm& pm, bool& isNull, } CalpontSystemCatalog::ColType Func_notin::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { PredicateOperator* op = new PredicateOperator(); CalpontSystemCatalog::ColType ct; diff --git a/utils/funcexp/func_inet_aton.cpp b/utils/funcexp/func_inet_aton.cpp index 3f1e52d00..85a3a8034 100644 --- a/utils/funcexp/func_inet_aton.cpp +++ b/utils/funcexp/func_inet_aton.cpp @@ -27,7 +27,7 @@ #include "functioncolumn.h" #include "joblisttypes.h" #include "rowgroup.h" -//#include // included when debugging +// #include // included when debugging namespace funcexp { @@ -36,7 +36,7 @@ namespace funcexp // See mcs_add in udfsdk.h for explanation of this function. //------------------------------------------------------------------------------ execplan::CalpontSystemCatalog::ColType Func_inet_aton::operationType( - FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) + FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); // input type } @@ -46,7 +46,7 @@ execplan::CalpontSystemCatalog::ColType Func_inet_aton::operationType( // SELECT ... WHERE inet_aton(ipstring) = 11111111 will call getIntVal() //------------------------------------------------------------------------------ int64_t Func_inet_aton::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // std::cout << "In Func_inet_aton::getIntVal" << std::endl; @@ -70,7 +70,7 @@ int64_t Func_inet_aton::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& is // SELECT ... WHERE inet_aton(ipstring) = '11111111' will call getDoubleVal() //------------------------------------------------------------------------------ double Func_inet_aton::getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // std::cout << "In Func_inet_aton::getDoubleVal" << std::endl; @@ -98,7 +98,7 @@ double Func_inet_aton::getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& // Don't know if this function will ever be called. //------------------------------------------------------------------------------ std::string Func_inet_aton::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // std::cout << "In Func_inet_aton::getStrVal" << std::endl; @@ -122,7 +122,7 @@ std::string Func_inet_aton::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool // Don't know if this function will ever be called. //------------------------------------------------------------------------------ bool Func_inet_aton::getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { bool bValue = false; @@ -144,7 +144,7 @@ bool Func_inet_aton::getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNu // SELECT ... WHERE inet_aton(ipstring) = 11111111. will call getDecimalVal() //------------------------------------------------------------------------------ execplan::IDB_Decimal Func_inet_aton::getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { execplan::CalpontSystemCatalog::ColType colType = fp[0]->data()->resultType(); @@ -182,7 +182,7 @@ execplan::IDB_Decimal Func_inet_aton::getDecimalVal(rowgroup::Row& row, Function // Don't know if this function will ever be called. //------------------------------------------------------------------------------ int32_t Func_inet_aton::getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int32_t iValue = joblist::DATENULL; @@ -206,7 +206,7 @@ int32_t Func_inet_aton::getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool // Don't know if this function will ever be called. //------------------------------------------------------------------------------ int64_t Func_inet_aton::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int64_t iValue = joblist::DATETIMENULL; @@ -224,7 +224,7 @@ int64_t Func_inet_aton::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, } int64_t Func_inet_aton::getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int64_t iValue = joblist::TIMESTAMPNULL; @@ -242,7 +242,7 @@ int64_t Func_inet_aton::getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, } int64_t Func_inet_aton::getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int64_t iValue = joblist::TIMENULL; diff --git a/utils/funcexp/func_inet_ntoa.cpp b/utils/funcexp/func_inet_ntoa.cpp index 8ef517abf..a8421ec30 100644 --- a/utils/funcexp/func_inet_ntoa.cpp +++ b/utils/funcexp/func_inet_ntoa.cpp @@ -54,7 +54,7 @@ namespace funcexp // See mcs_add in udfsdk.h for explanation of this function. //------------------------------------------------------------------------------ execplan::CalpontSystemCatalog::ColType Func_inet_ntoa::operationType( - FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) + FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); // input type } @@ -135,7 +135,7 @@ double Func_inet_ntoa::getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& // This is the get function that makes sense to use. //------------------------------------------------------------------------------ std::string Func_inet_ntoa::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // std::cout << "In Func_inet_ntoa::getStrVal" << std::endl; @@ -178,8 +178,8 @@ std::string Func_inet_ntoa::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool // Return IP address as a boolean. // N/A so returning null. See explanation at the top of this source file. //------------------------------------------------------------------------------ -bool Func_inet_ntoa::getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) +bool Func_inet_ntoa::getBoolVal(rowgroup::Row& /*row*/, FunctionParm& /*fp*/, bool& isNull, + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // std::cout << "In Func_inet_ntoa::getBoolVal" << std::endl; bool bValue = false; @@ -192,8 +192,9 @@ bool Func_inet_ntoa::getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNu // Return IP address as a decimal value. // N/A so returning null. See explanation at the top of this source file. //------------------------------------------------------------------------------ -execplan::IDB_Decimal Func_inet_ntoa::getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) +execplan::IDB_Decimal Func_inet_ntoa::getDecimalVal(rowgroup::Row& /*row*/, FunctionParm& /*fp*/, + bool& isNull, + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // IDB_Decimal dValue = fp[0]->data()->getDecimalVal(row, isNull); execplan::IDB_Decimal dValue(joblist::NULL_INT64, 0, 0); @@ -206,8 +207,8 @@ execplan::IDB_Decimal Func_inet_ntoa::getDecimalVal(rowgroup::Row& row, Function // Return IP address as a date. // N/A so returning null. See explanation at the top of this source file. //------------------------------------------------------------------------------ -int32_t Func_inet_ntoa::getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) +int32_t Func_inet_ntoa::getDateIntVal(rowgroup::Row& /*row*/, FunctionParm& /*fp*/, bool& isNull, + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // std::cout << "In Func_inet_ntoa::getDateIntVal" << std::endl; @@ -222,8 +223,8 @@ int32_t Func_inet_ntoa::getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool // Return IP address as a date/time. // N/A so returning null. See explanation at the top of this source file. //------------------------------------------------------------------------------ -int64_t Func_inet_ntoa::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) +int64_t Func_inet_ntoa::getDatetimeIntVal(rowgroup::Row& /*row*/, FunctionParm& /*fp*/, bool& isNull, + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // std::cout << "In Func_inet_ntoa::getDatetimeVal" << std::endl; @@ -234,8 +235,8 @@ int64_t Func_inet_ntoa::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, return iValue; } -int64_t Func_inet_ntoa::getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) +int64_t Func_inet_ntoa::getTimestampIntVal(rowgroup::Row& /*row*/, FunctionParm& /*fp*/, bool& isNull, + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // std::cout << "In Func_inet_ntoa::getTimestampVal" << std::endl; @@ -246,8 +247,8 @@ int64_t Func_inet_ntoa::getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, return iValue; } -int64_t Func_inet_ntoa::getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) +int64_t Func_inet_ntoa::getTimeIntVal(rowgroup::Row& /*row*/, FunctionParm& /*fp*/, bool& isNull, + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // std::cout << "In Func_inet_ntoa::getTimeVal" << std::endl; diff --git a/utils/funcexp/func_insert.cpp b/utils/funcexp/func_insert.cpp index 72fd06e46..e8631ea7a 100644 --- a/utils/funcexp/func_insert.cpp +++ b/utils/funcexp/func_insert.cpp @@ -40,7 +40,7 @@ using namespace utf8; namespace funcexp { CalpontSystemCatalog::ColType Func_insert::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_instr.cpp b/utils/funcexp/func_instr.cpp index be60f6b14..95abb7ce2 100644 --- a/utils/funcexp/func_instr.cpp +++ b/utils/funcexp/func_instr.cpp @@ -33,8 +33,8 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_instr::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_instr::operationType(FunctionParm& /*fp*/, + CalpontSystemCatalog::ColType& /*resultType*/) { CalpontSystemCatalog::ColType ct; ct.colDataType = CalpontSystemCatalog::VARCHAR; diff --git a/utils/funcexp/func_isnull.cpp b/utils/funcexp/func_isnull.cpp index 4ff7e643a..3c1216eae 100644 --- a/utils/funcexp/func_isnull.cpp +++ b/utils/funcexp/func_isnull.cpp @@ -38,7 +38,7 @@ using namespace rowgroup; namespace funcexp { CalpontSystemCatalog::ColType Func_isnull::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type of idb_isnull should be the same as the argument type assert(fp.size() == 1); diff --git a/utils/funcexp/func_json_array_append.cpp b/utils/funcexp/func_json_array_append.cpp index c88d3f1fa..e038e37f1 100644 --- a/utils/funcexp/func_json_array_append.cpp +++ b/utils/funcexp/func_json_array_append.cpp @@ -14,14 +14,14 @@ using namespace funcexp::helpers; namespace funcexp { -CalpontSystemCatalog::ColType Func_json_array_append::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_json_array_append::operationType( + FunctionParm& fp, CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_array_append::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { const auto& js = fp[0]->data()->getStrVal(row, isNull); if (isNull) diff --git a/utils/funcexp/func_json_array_insert.cpp b/utils/funcexp/func_json_array_insert.cpp index 7e62ebb47..9e6c5186a 100644 --- a/utils/funcexp/func_json_array_insert.cpp +++ b/utils/funcexp/func_json_array_insert.cpp @@ -14,14 +14,14 @@ using namespace funcexp::helpers; namespace funcexp { -CalpontSystemCatalog::ColType Func_json_array_insert::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_json_array_insert::operationType( + FunctionParm& fp, CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_array_insert::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { const auto& js = fp[0]->data()->getStrVal(row, isNull); if (isNull) diff --git a/utils/funcexp/func_json_contains.cpp b/utils/funcexp/func_json_contains.cpp index f3fabd9a9..f399ddc60 100644 --- a/utils/funcexp/func_json_contains.cpp +++ b/utils/funcexp/func_json_contains.cpp @@ -148,7 +148,7 @@ static bool checkContains(json_engine_t* jsEg, json_engine_t* valEg) namespace funcexp { CalpontSystemCatalog::ColType Func_json_contains::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } @@ -157,7 +157,7 @@ CalpontSystemCatalog::ColType Func_json_contains::operationType(FunctionParm& fp * getBoolVal API definition */ bool Func_json_contains::getBoolVal(Row& row, FunctionParm& fp, bool& isNull, - CalpontSystemCatalog::ColType& type) + CalpontSystemCatalog::ColType& /*type*/) { bool isNullJS = false, isNullVal = false; const auto& js = fp[0]->data()->getStrVal(row, isNullJS); diff --git a/utils/funcexp/func_json_contains_path.cpp b/utils/funcexp/func_json_contains_path.cpp index 51cd4abf3..35106ac2f 100644 --- a/utils/funcexp/func_json_contains_path.cpp +++ b/utils/funcexp/func_json_contains_path.cpp @@ -17,7 +17,7 @@ using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_contains_path::operationType( - FunctionParm& fp, CalpontSystemCatalog::ColType& resultType) + FunctionParm& fp, CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } @@ -26,7 +26,7 @@ CalpontSystemCatalog::ColType Func_json_contains_path::operationType( * getBoolVal API definition */ bool Func_json_contains_path::getBoolVal(Row& row, FunctionParm& fp, bool& isNull, - CalpontSystemCatalog::ColType& type) + CalpontSystemCatalog::ColType& /*type*/) { const auto& js_ns = fp[0]->data()->getStrVal(row, isNull); if (isNull) diff --git a/utils/funcexp/func_json_depth.cpp b/utils/funcexp/func_json_depth.cpp index 88d52c8cf..66bcc22c9 100644 --- a/utils/funcexp/func_json_depth.cpp +++ b/utils/funcexp/func_json_depth.cpp @@ -14,13 +14,13 @@ using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_depth::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } int64_t Func_json_depth::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { const auto js = fp[0]->data()->getStrVal(row, isNull); if (isNull) diff --git a/utils/funcexp/func_json_equals.cpp b/utils/funcexp/func_json_equals.cpp index fa0cc7db8..0e0270cc2 100644 --- a/utils/funcexp/func_json_equals.cpp +++ b/utils/funcexp/func_json_equals.cpp @@ -16,7 +16,7 @@ using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_equals::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } @@ -25,7 +25,7 @@ CalpontSystemCatalog::ColType Func_json_equals::operationType(FunctionParm& fp, * getBoolVal API definition */ bool Func_json_equals::getBoolVal(Row& row, FunctionParm& fp, bool& isNull, - CalpontSystemCatalog::ColType& type) + CalpontSystemCatalog::ColType& /*type*/) { // auto release the DYNAMIC_STRING using DynamicString = unique_ptr; @@ -54,7 +54,7 @@ bool Func_json_equals::getBoolVal(Row& row, FunctionParm& fp, bool& isNull, const string_view js1 = js1_ns.unsafeStringRef(); const string_view js2 = js2_ns.unsafeStringRef(); - + bool result = false; if (json_normalize(str1.get(), js1.data(), js1.size(), getCharset(fp[0]))) { diff --git a/utils/funcexp/func_json_exists.cpp b/utils/funcexp/func_json_exists.cpp index b76e86ae8..f7a3325ee 100644 --- a/utils/funcexp/func_json_exists.cpp +++ b/utils/funcexp/func_json_exists.cpp @@ -13,7 +13,7 @@ using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_exists::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } @@ -22,7 +22,7 @@ CalpontSystemCatalog::ColType Func_json_exists::operationType(FunctionParm& fp, * getBoolVal API definition */ bool Func_json_exists::getBoolVal(Row& row, FunctionParm& fp, bool& isNull, - CalpontSystemCatalog::ColType& type) + CalpontSystemCatalog::ColType& /*type*/) { const auto js = fp[0]->data()->getStrVal(row, isNull); if (isNull) diff --git a/utils/funcexp/func_json_extract.cpp b/utils/funcexp/func_json_extract.cpp index 1613717e8..f2975a8ee 100644 --- a/utils/funcexp/func_json_extract.cpp +++ b/utils/funcexp/func_json_extract.cpp @@ -143,17 +143,16 @@ int Func_json_extract::doExtract(Row& row, FunctionParm& fp, json_value_types* t retJS.swap(tmp); return 0; - } CalpontSystemCatalog::ColType Func_json_extract::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_extract::getStrVal(Row& row, FunctionParm& fp, bool& isNull, - CalpontSystemCatalog::ColType& type) + CalpontSystemCatalog::ColType& /*type*/) { string retJS; json_value_types valType; @@ -164,8 +163,8 @@ string Func_json_extract::getStrVal(Row& row, FunctionParm& fp, bool& isNull, return ""; } -int64_t Func_json_extract::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) +int64_t Func_json_extract::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& /*isNull*/, + execplan::CalpontSystemCatalog::ColType& /*type*/) { string retJS; json_value_types valType; @@ -190,8 +189,8 @@ int64_t Func_json_extract::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& return ret; } -double Func_json_extract::getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) +double Func_json_extract::getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& /*isNull*/, + execplan::CalpontSystemCatalog::ColType& /*type*/) { string retJS; json_value_types valType; @@ -217,7 +216,7 @@ double Func_json_extract::getDoubleVal(rowgroup::Row& row, FunctionParm& fp, boo } execplan::IDB_Decimal Func_json_extract::getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { json_value_types valType; string retJS; diff --git a/utils/funcexp/func_json_format.cpp b/utils/funcexp/func_json_format.cpp index 178474935..73f88fdab 100644 --- a/utils/funcexp/func_json_format.cpp +++ b/utils/funcexp/func_json_format.cpp @@ -17,13 +17,13 @@ using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_format::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_format::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { const auto& js = fp[0]->data()->getStrVal(row, isNull); if (isNull) diff --git a/utils/funcexp/func_json_insert.cpp b/utils/funcexp/func_json_insert.cpp index b10a8314c..1a59d974e 100644 --- a/utils/funcexp/func_json_insert.cpp +++ b/utils/funcexp/func_json_insert.cpp @@ -15,13 +15,13 @@ using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_insert::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_insert::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { const auto& js = fp[0]->data()->getStrVal(row, isNull); if (isNull) diff --git a/utils/funcexp/func_json_keys.cpp b/utils/funcexp/func_json_keys.cpp index ac17750b9..8634fce50 100644 --- a/utils/funcexp/func_json_keys.cpp +++ b/utils/funcexp/func_json_keys.cpp @@ -46,18 +46,18 @@ bool checkKeyInList(const string& res, const uchar* key, const int keyLen) namespace funcexp { CalpontSystemCatalog::ColType Func_json_keys::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_keys::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { const auto js = fp[0]->data()->getStrVal(row, isNull); if (isNull) return ""; - + IntType keySize = 0; string ret; json_engine_t jsEg; diff --git a/utils/funcexp/func_json_length.cpp b/utils/funcexp/func_json_length.cpp index 99763ef72..474e8bbca 100644 --- a/utils/funcexp/func_json_length.cpp +++ b/utils/funcexp/func_json_length.cpp @@ -15,13 +15,13 @@ using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_length::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } int64_t Func_json_length::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { const auto& js = fp[0]->data()->getStrVal(row, isNull); if (isNull) diff --git a/utils/funcexp/func_json_merge.cpp b/utils/funcexp/func_json_merge.cpp index 4041571e7..3d4b241bb 100644 --- a/utils/funcexp/func_json_merge.cpp +++ b/utils/funcexp/func_json_merge.cpp @@ -209,13 +209,13 @@ int doMerge(string& retJS, json_engine_t* jsEg1, json_engine_t* jsEg2) namespace funcexp { CalpontSystemCatalog::ColType Func_json_merge::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_merge::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { const auto js = fp[0]->data()->getStrVal(row, isNull); if (isNull) diff --git a/utils/funcexp/func_json_merge_patch.cpp b/utils/funcexp/func_json_merge_patch.cpp index 05561e193..250c11736 100644 --- a/utils/funcexp/func_json_merge_patch.cpp +++ b/utils/funcexp/func_json_merge_patch.cpp @@ -260,14 +260,14 @@ int doMergePatch(string& retJS, json_engine_t* jsEg1, json_engine_t* jsEg2, bool namespace funcexp { -CalpontSystemCatalog::ColType Func_json_merge_patch::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_json_merge_patch::operationType( + FunctionParm& fp, CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_merge_patch::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { // JSON_MERGE_PATCH return NULL if any argument is NULL bool isEmpty = false, hasNullArg = false; diff --git a/utils/funcexp/func_json_normalize.cpp b/utils/funcexp/func_json_normalize.cpp index 6dbf28d2e..0470f8a80 100644 --- a/utils/funcexp/func_json_normalize.cpp +++ b/utils/funcexp/func_json_normalize.cpp @@ -16,14 +16,14 @@ using namespace funcexp::helpers; namespace funcexp { -CalpontSystemCatalog::ColType Func_json_normalize::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_json_normalize::operationType( + FunctionParm& fp, CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_normalize::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { const auto js_ns = fp[0]->data()->getStrVal(row, isNull); if (isNull) diff --git a/utils/funcexp/func_json_overlaps.cpp b/utils/funcexp/func_json_overlaps.cpp index 3df4abc9d..b8933a79b 100644 --- a/utils/funcexp/func_json_overlaps.cpp +++ b/utils/funcexp/func_json_overlaps.cpp @@ -267,7 +267,7 @@ bool checkOverlaps(json_engine_t* jsEg1, json_engine_t* jsEg2, bool compareWhole namespace funcexp { CalpontSystemCatalog::ColType Func_json_overlaps::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } @@ -275,8 +275,8 @@ CalpontSystemCatalog::ColType Func_json_overlaps::operationType(FunctionParm& fp /** * getBoolVal API definition */ -bool Func_json_overlaps::getBoolVal(Row& row, FunctionParm& fp, bool& isNull, - CalpontSystemCatalog::ColType& type) +bool Func_json_overlaps::getBoolVal(Row& row, FunctionParm& fp, bool& /*isNull*/, + CalpontSystemCatalog::ColType& /*type*/) { bool isNullJS1 = false, isNullJS2 = false; const auto js1 = fp[0]->data()->getStrVal(row, isNullJS1); diff --git a/utils/funcexp/func_json_query.cpp b/utils/funcexp/func_json_query.cpp index 447f7dedd..e019fbcd2 100644 --- a/utils/funcexp/func_json_query.cpp +++ b/utils/funcexp/func_json_query.cpp @@ -18,7 +18,6 @@ class QueryJSONPathWrapper : public JSONPathWrapper { return je->checkAndGetComplexVal(res, error); } - }; bool JSONEgWrapper::checkAndGetComplexVal(string& ret, int* error) @@ -43,13 +42,13 @@ bool JSONEgWrapper::checkAndGetComplexVal(string& ret, int* error) } CalpontSystemCatalog::ColType Func_json_query::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_query::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { string ret; QueryJSONPathWrapper qpw; diff --git a/utils/funcexp/func_json_quote.cpp b/utils/funcexp/func_json_quote.cpp index 30b2246eb..8ab3e0784 100644 --- a/utils/funcexp/func_json_quote.cpp +++ b/utils/funcexp/func_json_quote.cpp @@ -20,13 +20,13 @@ using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_quote::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } std::string Func_json_quote::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { const auto js = fp[0]->data()->getStrVal(row, isNull); if (isNull || !isCharType(fp[0]->data()->resultType().colDataType)) diff --git a/utils/funcexp/func_json_remove.cpp b/utils/funcexp/func_json_remove.cpp index 98558869c..ca9e958ea 100644 --- a/utils/funcexp/func_json_remove.cpp +++ b/utils/funcexp/func_json_remove.cpp @@ -15,13 +15,13 @@ using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_remove::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_remove::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { const auto& js = fp[0]->data()->getStrVal(row, isNull); diff --git a/utils/funcexp/func_json_search.cpp b/utils/funcexp/func_json_search.cpp index c7cb6830e..dea9214ab 100644 --- a/utils/funcexp/func_json_search.cpp +++ b/utils/funcexp/func_json_search.cpp @@ -54,12 +54,12 @@ namespace funcexp { const static int wildOne = '_'; const static int wildMany = '%'; -int Func_json_search::cmpJSValWild(json_engine_t* jsEg, const utils::NullString& cmpStr, const CHARSET_INFO* cs) +int Func_json_search::cmpJSValWild(json_engine_t* jsEg, const utils::NullString& cmpStr, + const CHARSET_INFO* cs) { if (jsEg->value_type != JSON_VALUE_STRING || !jsEg->value_escaped) return cs->wildcmp((const char*)jsEg->value, (const char*)(jsEg->value + jsEg->value_len), - (const char*)cmpStr.str(), (const char*)cmpStr.end(), escape, - wildOne, wildMany) + (const char*)cmpStr.str(), (const char*)cmpStr.end(), escape, wildOne, wildMany) ? 0 : 1; @@ -71,21 +71,18 @@ int Func_json_search::cmpJSValWild(json_engine_t* jsEg, const utils::NullString& (uchar*)buf, (uchar*)(buf + strLen))) <= 0) return 0; - return cs->wildcmp(buf, buf + strLen, cmpStr.str(), cmpStr.end(), escape, wildOne, - wildMany) - ? 0 - : 1; + return cs->wildcmp(buf, buf + strLen, cmpStr.str(), cmpStr.end(), escape, wildOne, wildMany) ? 0 : 1; } } CalpontSystemCatalog::ColType Func_json_search::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_search::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { string ret; bool isNullJS = false, isNullVal = false; diff --git a/utils/funcexp/func_json_type.cpp b/utils/funcexp/func_json_type.cpp index 333c01179..be248a794 100644 --- a/utils/funcexp/func_json_type.cpp +++ b/utils/funcexp/func_json_type.cpp @@ -14,13 +14,13 @@ using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_type::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_type::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { const auto js = fp[0]->data()->getStrVal(row, isNull); if (isNull) diff --git a/utils/funcexp/func_json_unquote.cpp b/utils/funcexp/func_json_unquote.cpp index 5063022fe..35f11694c 100644 --- a/utils/funcexp/func_json_unquote.cpp +++ b/utils/funcexp/func_json_unquote.cpp @@ -14,7 +14,7 @@ using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_unquote::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } diff --git a/utils/funcexp/func_json_valid.cpp b/utils/funcexp/func_json_valid.cpp index e0a010d59..8d118c75f 100644 --- a/utils/funcexp/func_json_valid.cpp +++ b/utils/funcexp/func_json_valid.cpp @@ -14,7 +14,7 @@ using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_valid::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } @@ -23,7 +23,7 @@ CalpontSystemCatalog::ColType Func_json_valid::operationType(FunctionParm& fp, * getBoolVal API definition */ bool Func_json_valid::getBoolVal(Row& row, FunctionParm& fp, bool& isNull, - CalpontSystemCatalog::ColType& type) + CalpontSystemCatalog::ColType& /*type*/) { const auto js = fp[0]->data()->getStrVal(row, isNull); if (isNull) diff --git a/utils/funcexp/func_json_value.cpp b/utils/funcexp/func_json_value.cpp index 265bfc40f..7bc2ee4dc 100644 --- a/utils/funcexp/func_json_value.cpp +++ b/utils/funcexp/func_json_value.cpp @@ -70,11 +70,11 @@ bool JSONPathWrapper::extract(std::string& ret, rowgroup::Row& row, execplan::SP int error = 0; - if (json_path_setup(&p, getCharset(funcParamPath), (const uchar*)sjsp.str(), - (const uchar*)sjsp.end())) + if (json_path_setup(&p, getCharset(funcParamPath), (const uchar*)sjsp.str(), (const uchar*)sjsp.end())) return true; - JSONEgWrapper je(getCharset(funcParamJS), reinterpret_cast(js.str()), reinterpret_cast(js.end())); + JSONEgWrapper je(getCharset(funcParamJS), reinterpret_cast(js.str()), + reinterpret_cast(js.end())); currStep = p.steps; @@ -96,7 +96,7 @@ bool JSONPathWrapper::extract(std::string& ret, rowgroup::Row& row, execplan::SP } CalpontSystemCatalog::ColType Func_json_value::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } @@ -115,11 +115,10 @@ class JSONPathWrapperValue : public JSONPathWrapper { return je->checkAndGetScalar(res, error); } - }; string Func_json_value::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { string ret; JSONPathWrapperValue pw; diff --git a/utils/funcexp/func_last_day.cpp b/utils/funcexp/func_last_day.cpp index e74a2d514..7851167fa 100644 --- a/utils/funcexp/func_last_day.cpp +++ b/utils/funcexp/func_last_day.cpp @@ -37,7 +37,7 @@ using namespace dataconvert; namespace funcexp { -CalpontSystemCatalog::ColType Func_last_day::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_last_day::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_lcase.cpp b/utils/funcexp/func_lcase.cpp index 674a4b044..cd71238da 100644 --- a/utils/funcexp/func_lcase.cpp +++ b/utils/funcexp/func_lcase.cpp @@ -37,7 +37,7 @@ using namespace joblist; namespace funcexp { CalpontSystemCatalog::ColType Func_lcase::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_least.cpp b/utils/funcexp/func_least.cpp index 0527d32b2..d89a71f3f 100644 --- a/utils/funcexp/func_least.cpp +++ b/utils/funcexp/func_least.cpp @@ -41,7 +41,7 @@ using namespace funcexp; namespace funcexp { -CalpontSystemCatalog::ColType Func_least::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_least::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { // operation type is not used by this functor @@ -50,7 +50,7 @@ CalpontSystemCatalog::ColType Func_least::operationType(FunctionParm& fp, } int64_t Func_least::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { double str = fp[0]->data()->getDoubleVal(row, isNull); @@ -68,7 +68,7 @@ int64_t Func_least::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull } double Func_least::getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { double str = fp[0]->data()->getDoubleVal(row, isNull); @@ -86,7 +86,7 @@ double Func_least::getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNu } long double Func_least::getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { long double str = fp[0]->data()->getLongDoubleVal(row, isNull); @@ -104,7 +104,7 @@ long double Func_least::getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, b } std::string Func_least::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { auto leastStr = fp[0]->data()->getStrVal(row, isNull); CHARSET_INFO* cs = fp[0]->data()->resultType().getCharset(); @@ -123,7 +123,7 @@ std::string Func_least::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& is } IDB_Decimal Func_least::getDecimalVal(Row& row, FunctionParm& fp, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { IDB_Decimal str = fp[0]->data()->getDecimalVal(row, isNull); @@ -141,7 +141,7 @@ IDB_Decimal Func_least::getDecimalVal(Row& row, FunctionParm& fp, bool& isNull, } int32_t Func_least::getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int32_t str = fp[0]->data()->getDateIntVal(row, isNull); @@ -159,7 +159,7 @@ int32_t Func_least::getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& is } int64_t Func_least::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int64_t str = fp[0]->data()->getDatetimeIntVal(row, isNull); @@ -177,7 +177,7 @@ int64_t Func_least::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool } int64_t Func_least::getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int64_t str = fp[0]->data()->getTimestampIntVal(row, isNull); @@ -195,7 +195,7 @@ int64_t Func_least::getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, boo } int64_t Func_least::getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // Strip off unused day int64_t leastStr = fp[0]->data()->getTimeIntVal(row, isNull); diff --git a/utils/funcexp/func_left.cpp b/utils/funcexp/func_left.cpp index eefdeecfd..8a0383634 100644 --- a/utils/funcexp/func_left.cpp +++ b/utils/funcexp/func_left.cpp @@ -36,7 +36,7 @@ using namespace joblist; namespace funcexp { CalpontSystemCatalog::ColType Func_left::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -48,7 +48,7 @@ std::string Func_left::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isN CHARSET_INFO* cs = type.getCharset(); // The original string const auto& src = fp[0]->data()->getStrVal(row, isNull); - if (isNull || src.length() < 1) // null or empty string. + if (isNull || src.length() < 1) // null or empty string. return ""; // binLen represents the number of bytes in src size_t binLen = src.length(); diff --git a/utils/funcexp/func_length.cpp b/utils/funcexp/func_length.cpp index 13ae4463b..70493a6ce 100644 --- a/utils/funcexp/func_length.cpp +++ b/utils/funcexp/func_length.cpp @@ -35,8 +35,8 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_length::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_length::operationType(FunctionParm& /*fp*/, + CalpontSystemCatalog::ColType& /*resultType*/) { CalpontSystemCatalog::ColType ct; ct.colDataType = CalpontSystemCatalog::VARCHAR; diff --git a/utils/funcexp/func_lpad.cpp b/utils/funcexp/func_lpad.cpp index 81700d6a4..39d7342dd 100644 --- a/utils/funcexp/func_lpad.cpp +++ b/utils/funcexp/func_lpad.cpp @@ -42,7 +42,7 @@ namespace funcexp const string Func_lpad::fPad = " "; CalpontSystemCatalog::ColType Func_lpad::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_ltrim.cpp b/utils/funcexp/func_ltrim.cpp index 488db3623..4d1fc3634 100644 --- a/utils/funcexp/func_ltrim.cpp +++ b/utils/funcexp/func_ltrim.cpp @@ -37,7 +37,7 @@ using namespace joblist; namespace funcexp { CalpontSystemCatalog::ColType Func_ltrim::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_ltrim_oracle.cpp b/utils/funcexp/func_ltrim_oracle.cpp index 9c6247e46..b7e6e2f96 100644 --- a/utils/funcexp/func_ltrim_oracle.cpp +++ b/utils/funcexp/func_ltrim_oracle.cpp @@ -37,7 +37,7 @@ using namespace joblist; namespace funcexp { CalpontSystemCatalog::ColType Func_ltrim_oracle::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_makedate.cpp b/utils/funcexp/func_makedate.cpp index ea21e419f..2321c78a3 100644 --- a/utils/funcexp/func_makedate.cpp +++ b/utils/funcexp/func_makedate.cpp @@ -166,7 +166,7 @@ uint64_t makedate(rowgroup::Row& row, FunctionParm& parm, bool& isNull) namespace funcexp { -CalpontSystemCatalog::ColType Func_makedate::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_makedate::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_maketime.cpp b/utils/funcexp/func_maketime.cpp index ad918ccce..b1d7117ed 100644 --- a/utils/funcexp/func_maketime.cpp +++ b/utils/funcexp/func_maketime.cpp @@ -37,7 +37,7 @@ using namespace dataconvert; namespace funcexp { -CalpontSystemCatalog::ColType Func_maketime::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_maketime::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_math.cpp b/utils/funcexp/func_math.cpp index 21214141f..bd86ccb6e 100644 --- a/utils/funcexp/func_math.cpp +++ b/utils/funcexp/func_math.cpp @@ -77,7 +77,7 @@ namespace funcexp // CalpontSystemCatalog::ColType Func_acos::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -205,7 +205,7 @@ double Func_acos::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, Calpo // CalpontSystemCatalog::ColType Func_asin::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -333,7 +333,7 @@ double Func_asin::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, Calpo // CalpontSystemCatalog::ColType Func_atan::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -537,7 +537,7 @@ double Func_atan::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, Calpo // CalpontSystemCatalog::ColType Func_cos::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -665,7 +665,7 @@ double Func_cos::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, Calpon // CalpontSystemCatalog::ColType Func_cot::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -847,7 +847,7 @@ double Func_cot::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, Calpon // CalpontSystemCatalog::ColType Func_log::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -1058,7 +1058,7 @@ double Func_log::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, Calpon // CalpontSystemCatalog::ColType Func_log2::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -1191,7 +1191,7 @@ double Func_log2::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, Calpo // CalpontSystemCatalog::ColType Func_log10::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -1325,7 +1325,7 @@ double Func_log10::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, Calp // CalpontSystemCatalog::ColType Func_sin::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -1467,7 +1467,7 @@ double Func_sin::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, Calpon // CalpontSystemCatalog::ColType Func_sqrt::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -1595,7 +1595,7 @@ double Func_sqrt::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, Calpo // CalpontSystemCatalog::ColType Func_tan::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -1723,7 +1723,7 @@ double Func_tan::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, Calpon // CalpontSystemCatalog::ColType Func_format::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -2033,7 +2033,7 @@ string Func_format::getStrVal(Row& row, FunctionParm& parm, bool& isNull, // CalpontSystemCatalog::ColType Func_radians::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -2162,7 +2162,7 @@ double Func_radians::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, Ca // CalpontSystemCatalog::ColType Func_degrees::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_md5.cpp b/utils/funcexp/func_md5.cpp index 02e32eb61..d6db8ad22 100644 --- a/utils/funcexp/func_md5.cpp +++ b/utils/funcexp/func_md5.cpp @@ -163,7 +163,6 @@ class md5 uint4 m_Count[2]; uchar m_Buffer[64]; uchar m_Digest[16]; - uchar m_Finalized; }; ///////////////////////////////////////////////////////////////////////// @@ -495,14 +494,14 @@ void md5::Decode(uint4* dest, uchar* src, uint4 nLength) namespace funcexp { CalpontSystemCatalog::ColType Func_md5::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); } string Func_md5::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + CalpontSystemCatalog::ColType& /*op_ct*/) { const auto& arg = parm[0]->data()->getStrVal(row, isNull); if (arg.isNull()) @@ -515,4 +514,3 @@ string Func_md5::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, } } // namespace funcexp - diff --git a/utils/funcexp/func_microsecond.cpp b/utils/funcexp/func_microsecond.cpp index 8c94647bf..e3fa55d08 100644 --- a/utils/funcexp/func_microsecond.cpp +++ b/utils/funcexp/func_microsecond.cpp @@ -36,14 +36,14 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_microsecond::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_microsecond::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } int64_t Func_microsecond::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + CalpontSystemCatalog::ColType& /*op_ct*/) { int64_t val = 0; uint32_t microSecond = 0; diff --git a/utils/funcexp/func_minute.cpp b/utils/funcexp/func_minute.cpp index 8e5724547..69d65b25e 100644 --- a/utils/funcexp/func_minute.cpp +++ b/utils/funcexp/func_minute.cpp @@ -35,7 +35,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_minute::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_minute::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_mod.cpp b/utils/funcexp/func_mod.cpp index a7b99430a..141192dce 100644 --- a/utils/funcexp/func_mod.cpp +++ b/utils/funcexp/func_mod.cpp @@ -41,14 +41,14 @@ using namespace logging; namespace funcexp { -CalpontSystemCatalog::ColType Func_mod::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_mod::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } IDB_Decimal Func_mod::getDecimalVal(Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& operationColType) + CalpontSystemCatalog::ColType& /*operationColType*/) { if (parm.size() < 2) { @@ -115,7 +115,7 @@ IDB_Decimal Func_mod::getDecimalVal(Row& row, FunctionParm& parm, bool& isNull, } double Func_mod::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& operationColType) + execplan::CalpontSystemCatalog::ColType& /*operationColType*/) { if (parm.size() < 2) { @@ -214,7 +214,7 @@ double Func_mod::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, } long double Func_mod::getLongDoubleVal(Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& operationColType) + CalpontSystemCatalog::ColType& /*operationColType*/) { if (parm.size() < 2) { @@ -313,7 +313,7 @@ long double Func_mod::getLongDoubleVal(Row& row, FunctionParm& parm, bool& isNul } int64_t Func_mod::getIntVal(Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& operationColType) + CalpontSystemCatalog::ColType& /*operationColType*/) { if (parm.size() < 2) { @@ -406,7 +406,7 @@ int64_t Func_mod::getIntVal(Row& row, FunctionParm& parm, bool& isNull, } uint64_t Func_mod::getUintVal(Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& operationColType) + CalpontSystemCatalog::ColType& /*operationColType*/) { if (parm.size() < 2) { diff --git a/utils/funcexp/func_month.cpp b/utils/funcexp/func_month.cpp index ea66abf32..8b00dcf0a 100644 --- a/utils/funcexp/func_month.cpp +++ b/utils/funcexp/func_month.cpp @@ -35,7 +35,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_month::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_month::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_monthname.cpp b/utils/funcexp/func_monthname.cpp index 217a25a67..a659fb74f 100644 --- a/utils/funcexp/func_monthname.cpp +++ b/utils/funcexp/func_monthname.cpp @@ -36,7 +36,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_monthname::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_monthname::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; @@ -165,9 +165,7 @@ int64_t Func_monthname::getIntValInternal(rowgroup::Row& row, FunctionParm& parm break; - default: - isNull = true; - return -1; + default: isNull = true; return -1; } return -1; @@ -179,8 +177,8 @@ int64_t Func_monthname::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& return getIntValInternal(row, parm, isNull, op_ct); } -double Func_monthname::getDoubleVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) +double Func_monthname::getDoubleVal(rowgroup::Row& /*row*/, FunctionParm& /*parm*/, bool& /*isNull*/, + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { return 0; } diff --git a/utils/funcexp/func_nullif.cpp b/utils/funcexp/func_nullif.cpp index 0097c09f2..b819b5b64 100644 --- a/utils/funcexp/func_nullif.cpp +++ b/utils/funcexp/func_nullif.cpp @@ -46,14 +46,14 @@ using namespace funcexp; namespace funcexp { -CalpontSystemCatalog::ColType Func_nullif::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_nullif::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } int64_t Func_nullif::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int64_t exp1 = parm[0]->data()->getIntVal(row, isNull); @@ -61,10 +61,8 @@ int64_t Func_nullif::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isN if (isNull) return exp1; - int64_t exp2 = 0; - switch (parm[1]->data()->resultType().colDataType) { case execplan::CalpontSystemCatalog::BIGINT: @@ -240,7 +238,7 @@ int64_t Func_nullif::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isN } uint64_t Func_nullif::getUintVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { uint64_t exp1 = parm[0]->data()->getUintVal(row, isNull); @@ -358,7 +356,7 @@ uint64_t Func_nullif::getUintVal(rowgroup::Row& row, FunctionParm& parm, bool& i } string Func_nullif::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { string exp1 = parm[0]->data()->getStrVal(row, isNull).safeString(""); @@ -409,7 +407,7 @@ string Func_nullif::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNu } int32_t Func_nullif::getDateIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + execplan::CalpontSystemCatalog::ColType& /*ct*/) { int64_t exp1 = parm[0]->data()->getDateIntVal(row, isNull); @@ -501,7 +499,7 @@ int32_t Func_nullif::getDateIntVal(rowgroup::Row& row, FunctionParm& parm, bool& } int64_t Func_nullif::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + execplan::CalpontSystemCatalog::ColType& /*ct*/) { int64_t exp1 = parm[0]->data()->getDatetimeIntVal(row, isNull); @@ -571,7 +569,7 @@ int64_t Func_nullif::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& parm, b } int64_t Func_nullif::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + execplan::CalpontSystemCatalog::ColType& /*ct*/) { int64_t exp1 = parm[0]->data()->getTimeIntVal(row, isNull); @@ -627,7 +625,7 @@ int64_t Func_nullif::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& } int64_t Func_nullif::getTimestampIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + execplan::CalpontSystemCatalog::ColType& /*ct*/) { int64_t exp1 = parm[0]->data()->getTimestampIntVal(row, isNull); @@ -683,7 +681,7 @@ int64_t Func_nullif::getTimestampIntVal(rowgroup::Row& row, FunctionParm& parm, } double Func_nullif::getDoubleVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { double exp1 = parm[0]->data()->getDoubleVal(row, isNull); @@ -776,7 +774,7 @@ double Func_nullif::getDoubleVal(rowgroup::Row& row, FunctionParm& parm, bool& i } long double Func_nullif::getLongDoubleVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { long double exp1 = parm[0]->data()->getLongDoubleVal(row, isNull); @@ -1007,8 +1005,8 @@ execplan::IDB_Decimal Func_nullif::getDecimalVal(rowgroup::Row& row, FunctionPar string value; if (parm[1]->data()->resultType().colDataType == execplan::CalpontSystemCatalog::TIMESTAMP) - value = - DataConvert::timestampToString1(parm[1]->data()->getTimestampIntVal(row, isNull), op_ct.getTimeZone()); + value = DataConvert::timestampToString1(parm[1]->data()->getTimestampIntVal(row, isNull), + op_ct.getTimeZone()); else value = DataConvert::datetimeToString1(parm[1]->data()->getDatetimeIntVal(row, isNull)); diff --git a/utils/funcexp/func_period_add.cpp b/utils/funcexp/func_period_add.cpp index 4038651ed..ec94005a6 100644 --- a/utils/funcexp/func_period_add.cpp +++ b/utils/funcexp/func_period_add.cpp @@ -36,14 +36,14 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_period_add::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_period_add::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } int64_t Func_period_add::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + CalpontSystemCatalog::ColType& /*op_ct*/) { int64_t period = parm[0]->data()->getIntVal(row, isNull); diff --git a/utils/funcexp/func_period_diff.cpp b/utils/funcexp/func_period_diff.cpp index 452c9024d..1a091716a 100644 --- a/utils/funcexp/func_period_diff.cpp +++ b/utils/funcexp/func_period_diff.cpp @@ -94,14 +94,14 @@ int64_t getArgSInt64Val(rowgroup::Row& row, TreeNode* exp, bool& isNull) return 0; } -CalpontSystemCatalog::ColType Func_period_diff::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_period_diff::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } int64_t Func_period_diff::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + CalpontSystemCatalog::ColType& /*op_ct*/) { uint64_t period1 = (uint64_t)getArgSInt64Val(row, parm[0]->data(), isNull); diff --git a/utils/funcexp/func_pow.cpp b/utils/funcexp/func_pow.cpp index c77412c46..eea84d5e6 100644 --- a/utils/funcexp/func_pow.cpp +++ b/utils/funcexp/func_pow.cpp @@ -42,7 +42,7 @@ using namespace logging; namespace funcexp { CalpontSystemCatalog::ColType Func_pow::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_quarter.cpp b/utils/funcexp/func_quarter.cpp index 5f1fd0033..d7cdec690 100644 --- a/utils/funcexp/func_quarter.cpp +++ b/utils/funcexp/func_quarter.cpp @@ -36,7 +36,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_quarter::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_quarter::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_quote.cpp b/utils/funcexp/func_quote.cpp index ed1e3651c..cf6126436 100644 --- a/utils/funcexp/func_quote.cpp +++ b/utils/funcexp/func_quote.cpp @@ -26,14 +26,14 @@ using namespace rowgroup; namespace funcexp { -CalpontSystemCatalog::ColType Func_quote::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_quote::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } std::string Func_quote::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { string str; diff --git a/utils/funcexp/func_rand.cpp b/utils/funcexp/func_rand.cpp index b7da263d9..c5d2d58c0 100644 --- a/utils/funcexp/func_rand.cpp +++ b/utils/funcexp/func_rand.cpp @@ -56,14 +56,14 @@ double Func_rand::getRand() return (((double)fSeed1) / (double)maxValue); } -CalpontSystemCatalog::ColType Func_rand::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_rand::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } double Func_rand::getDoubleVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // NOTE: this function needs to use 32bit ints otherwise it will break for negative values uint32_t seedParm = 0; diff --git a/utils/funcexp/func_regexp.cpp b/utils/funcexp/func_regexp.cpp index 4404d7650..742d45266 100644 --- a/utils/funcexp/func_regexp.cpp +++ b/utils/funcexp/func_regexp.cpp @@ -24,8 +24,10 @@ #include #include using namespace std; - +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include "utils/pcre2/jpcre2.hpp" +#pragma GCC diagnostic pop #include "functor_bool.h" #include "functor_str.h" @@ -261,28 +263,28 @@ inline RegExpParams getEpressionAndPattern(rowgroup::Row& row, funcexp::Function namespace funcexp { -CalpontSystemCatalog::ColType Func_regexp_replace::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_regexp_replace::operationType( + FunctionParm& fp, CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); } CalpontSystemCatalog::ColType Func_regexp_substr::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); } CalpontSystemCatalog::ColType Func_regexp_instr::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); } -CalpontSystemCatalog::ColType Func_regexp::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_regexp::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_repeat.cpp b/utils/funcexp/func_repeat.cpp index 405e01838..f828ef481 100644 --- a/utils/funcexp/func_repeat.cpp +++ b/utils/funcexp/func_repeat.cpp @@ -38,7 +38,7 @@ using namespace joblist; namespace funcexp { -CalpontSystemCatalog::ColType Func_repeat::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_repeat::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { // operation type is not used by this functor @@ -47,7 +47,7 @@ CalpontSystemCatalog::ColType Func_repeat::operationType(FunctionParm& fp, } std::string Func_repeat::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { string str; diff --git a/utils/funcexp/func_replace.cpp b/utils/funcexp/func_replace.cpp index a36f2135d..85e4c62d3 100644 --- a/utils/funcexp/func_replace.cpp +++ b/utils/funcexp/func_replace.cpp @@ -37,7 +37,7 @@ using namespace joblist; namespace funcexp { CalpontSystemCatalog::ColType Func_replace::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -78,7 +78,7 @@ std::string Func_replace::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& { // Count the number of fromstr in strend so we can reserve buffer space. size_t count = 0; - while ( string::npos != (pos = str.find(fromstr, pos))) + while (string::npos != (pos = str.find(fromstr, pos))) { ++count; pos += fromLen; diff --git a/utils/funcexp/func_replace_oracle.cpp b/utils/funcexp/func_replace_oracle.cpp index 2ebc09c99..f715daf7a 100644 --- a/utils/funcexp/func_replace_oracle.cpp +++ b/utils/funcexp/func_replace_oracle.cpp @@ -30,8 +30,8 @@ using namespace joblist; namespace funcexp { -CalpontSystemCatalog::ColType Func_replace_oracle::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_replace_oracle::operationType( + FunctionParm& fp, CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); @@ -60,7 +60,7 @@ std::string Func_replace_oracle::getStrVal(rowgroup::Row& row, FunctionParm& fp, const auto& ntostr = fp[2]->data()->getStrVal(row, isNull); if (ntostr.isNull()) return ""; - + const auto& tostr = ntostr.unsafeStringRef(); size_t toLen = tostr.length(); diff --git a/utils/funcexp/func_reverse.cpp b/utils/funcexp/func_reverse.cpp index db57d0953..012c74d80 100644 --- a/utils/funcexp/func_reverse.cpp +++ b/utils/funcexp/func_reverse.cpp @@ -37,7 +37,7 @@ using namespace joblist; namespace funcexp { CalpontSystemCatalog::ColType Func_reverse::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_right.cpp b/utils/funcexp/func_right.cpp index 6a1a7d0e2..266f3e076 100644 --- a/utils/funcexp/func_right.cpp +++ b/utils/funcexp/func_right.cpp @@ -37,7 +37,7 @@ using namespace joblist; namespace funcexp { CalpontSystemCatalog::ColType Func_right::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_round.cpp b/utils/funcexp/func_round.cpp index 2b7d68b72..8285af5b1 100644 --- a/utils/funcexp/func_round.cpp +++ b/utils/funcexp/func_round.cpp @@ -419,7 +419,6 @@ IDB_Decimal Func_round::getDecimalVal(Row& row, FunctionParm& parm, bool& isNull p = nvp; } - if (d < -datatypes::INT128MAXPRECISION) { decimal.s128Value = 0; @@ -749,51 +748,63 @@ string Func_round::getStrVal(Row& row, FunctionParm& parm, bool& isNull, Calpont } int64_t Func_round::getDatetimeIntVal(Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + CalpontSystemCatalog::ColType& /*op_ct*/) { int32_t s = parm.size() > 1 ? parm[1]->data()->getIntVal(row, isNull) : 0; if (isNull) return 0; s = (s > MAX_MICROSECOND_PRECISION) ? MAX_MICROSECOND_PRECISION : s; - if (s < 0) + if (s < 0) { s = 0; } - int64_t x = parm[0]->data()->getDatetimeIntVal(row, isNull) + (s <= MAX_MICROSECOND_PRECISION - 1 ? 5 * helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s - 1] : 0) + (s == 0 ? 48576 : 0); // 48576 = 0xfffff - 1000000; + int64_t x = + parm[0]->data()->getDatetimeIntVal(row, isNull) + + (s <= MAX_MICROSECOND_PRECISION - 1 ? 5 * helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s - 1] : 0) + + (s == 0 ? 48576 : 0); // 48576 = 0xfffff - 1000000; int32_t m_x = x & 0xfffff; - return (x ^ m_x) | (m_x / helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s] * helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s]); + return (x ^ m_x) | (m_x / helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s] * + helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s]); } int64_t Func_round::getTimestampIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int32_t s = parm.size() > 1 ? parm[1]->data()->getIntVal(row, isNull) : 0; if (isNull) return 0; s = (s > MAX_MICROSECOND_PRECISION) ? MAX_MICROSECOND_PRECISION : s; - if (s < 0) + if (s < 0) { s = 0; } - int64_t x = parm[0]->data()->getTimestampIntVal(row, isNull) + (s <= MAX_MICROSECOND_PRECISION - 1 ? 5 * helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s - 1] : 0) + (s == 0 ? 48576 : 0); // 48576 = 0xfffff - 1000000; + int64_t x = + parm[0]->data()->getTimestampIntVal(row, isNull) + + (s <= MAX_MICROSECOND_PRECISION - 1 ? 5 * helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s - 1] : 0) + + (s == 0 ? 48576 : 0); // 48576 = 0xfffff - 1000000; int32_t m_x = x & 0xfffff; - return (x ^ m_x) | (m_x / helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s] * helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s]); + return (x ^ m_x) | (m_x / helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s] * + helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s]); } int64_t Func_round::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int32_t s = parm.size() > 1 ? parm[1]->data()->getIntVal(row, isNull) : 0; if (isNull) return 0; s = (s > MAX_MICROSECOND_PRECISION) ? MAX_MICROSECOND_PRECISION : s; - if (s < 0) + if (s < 0) { s = 0; } - int64_t x = parm[0]->data()->getTimeIntVal(row, isNull) + (s <= MAX_MICROSECOND_PRECISION - 1 ? 5 * helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - 1 - s] : 0) + (s == 0 ? 15777215 : 0); // 15777215 = 0xffffff - 1000000; + int64_t x = + parm[0]->data()->getTimeIntVal(row, isNull) + + (s <= MAX_MICROSECOND_PRECISION - 1 ? 5 * helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - 1 - s] : 0) + + (s == 0 ? 15777215 : 0); // 15777215 = 0xffffff - 1000000; int32_t m_x = x & 0xffffff; - return (x ^ m_x) | (m_x / helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s] * helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s]); + return (x ^ m_x) | (m_x / helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s] * + helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s]); } } // namespace funcexp diff --git a/utils/funcexp/func_rpad.cpp b/utils/funcexp/func_rpad.cpp index e7cfe04ef..2cfbf931c 100644 --- a/utils/funcexp/func_rpad.cpp +++ b/utils/funcexp/func_rpad.cpp @@ -41,7 +41,7 @@ namespace funcexp const string Func_rpad::fPad = " "; CalpontSystemCatalog::ColType Func_rpad::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_rtrim.cpp b/utils/funcexp/func_rtrim.cpp index d5f439cf5..dec10936e 100644 --- a/utils/funcexp/func_rtrim.cpp +++ b/utils/funcexp/func_rtrim.cpp @@ -37,7 +37,7 @@ using namespace joblist; namespace funcexp { CalpontSystemCatalog::ColType Func_rtrim::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_rtrim_oracle.cpp b/utils/funcexp/func_rtrim_oracle.cpp index 0b4207910..9eee9e0a6 100644 --- a/utils/funcexp/func_rtrim_oracle.cpp +++ b/utils/funcexp/func_rtrim_oracle.cpp @@ -37,7 +37,7 @@ using namespace joblist; namespace funcexp { CalpontSystemCatalog::ColType Func_rtrim_oracle::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_sec_to_time.cpp b/utils/funcexp/func_sec_to_time.cpp index c6ba83f2b..d9e2932f1 100644 --- a/utils/funcexp/func_sec_to_time.cpp +++ b/utils/funcexp/func_sec_to_time.cpp @@ -41,14 +41,14 @@ using namespace execplan; using namespace logging; namespace funcexp { -CalpontSystemCatalog::ColType Func_sec_to_time::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_sec_to_time::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } string Func_sec_to_time::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { int64_t val = 0; CalpontSystemCatalog::ColType curCt = parm[0]->data()->resultType(); diff --git a/utils/funcexp/func_second.cpp b/utils/funcexp/func_second.cpp index 6136c3ede..146ae31e5 100644 --- a/utils/funcexp/func_second.cpp +++ b/utils/funcexp/func_second.cpp @@ -35,7 +35,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_second::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_second::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_sha.cpp b/utils/funcexp/func_sha.cpp index 4603c09ed..c6b2723b4 100644 --- a/utils/funcexp/func_sha.cpp +++ b/utils/funcexp/func_sha.cpp @@ -580,11 +580,11 @@ void SHA1::PadMessage() Message_Block[56] = (Length_High >> 24) & 0xFF; Message_Block[57] = (Length_High >> 16) & 0xFF; Message_Block[58] = (Length_High >> 8) & 0xFF; - Message_Block[59] = (Length_High)&0xFF; + Message_Block[59] = (Length_High) & 0xFF; Message_Block[60] = (Length_Low >> 24) & 0xFF; Message_Block[61] = (Length_Low >> 16) & 0xFF; Message_Block[62] = (Length_Low >> 8) & 0xFF; - Message_Block[63] = (Length_Low)&0xFF; + Message_Block[63] = (Length_Low) & 0xFF; ProcessMessageBlock(); } @@ -614,7 +614,7 @@ unsigned SHA1::CircularShift(int bits, unsigned word) /** Definition of class Func_sha */ -CalpontSystemCatalog::ColType Func_sha::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_sha::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_sign.cpp b/utils/funcexp/func_sign.cpp index 426fbb0c3..376c87f14 100644 --- a/utils/funcexp/func_sign.cpp +++ b/utils/funcexp/func_sign.cpp @@ -33,8 +33,8 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_sign::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_sign::operationType(FunctionParm& /*fp*/, + CalpontSystemCatalog::ColType& /*resultType*/) { CalpontSystemCatalog::ColType ct; ct.colDataType = CalpontSystemCatalog::BIGINT; @@ -43,7 +43,7 @@ CalpontSystemCatalog::ColType Func_sign::operationType(FunctionParm& fp, } int64_t Func_sign::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + CalpontSystemCatalog::ColType& /*op_ct*/) { double val = parm[0]->data()->getDoubleVal(row, isNull); diff --git a/utils/funcexp/func_space.cpp b/utils/funcexp/func_space.cpp index 38136f9ad..2e0b3d456 100644 --- a/utils/funcexp/func_space.cpp +++ b/utils/funcexp/func_space.cpp @@ -26,14 +26,14 @@ using namespace rowgroup; namespace funcexp { -CalpontSystemCatalog::ColType Func_space::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_space::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } std::string Func_space::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { CalpontSystemCatalog::ColDataType ct = fp[0]->data()->resultType().colDataType; diff --git a/utils/funcexp/func_str_to_date.cpp b/utils/funcexp/func_str_to_date.cpp index f3caf3921..8d5c31b0d 100644 --- a/utils/funcexp/func_str_to_date.cpp +++ b/utils/funcexp/func_str_to_date.cpp @@ -42,7 +42,7 @@ namespace using namespace funcexp; dataconvert::DateTime getDateTime(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct, long timeZone) + CalpontSystemCatalog::ColType& /*ct*/, long timeZone) { TimeExtractor extractor; dataconvert::DateTime dateTime; @@ -176,7 +176,7 @@ dataconvert::DateTime getDateTime(rowgroup::Row& row, FunctionParm& parm, bool& namespace funcexp { -CalpontSystemCatalog::ColType Func_str_to_date::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_str_to_date::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_strcmp.cpp b/utils/funcexp/func_strcmp.cpp index 57b60a39b..8d786b8da 100644 --- a/utils/funcexp/func_strcmp.cpp +++ b/utils/funcexp/func_strcmp.cpp @@ -40,7 +40,7 @@ using namespace funcexp; namespace funcexp { -CalpontSystemCatalog::ColType Func_strcmp::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_strcmp::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { // operation type is not used by this functor @@ -49,7 +49,7 @@ CalpontSystemCatalog::ColType Func_strcmp::operationType(FunctionParm& fp, } int64_t Func_strcmp::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& type) + execplan::CalpontSystemCatalog::ColType& /*type*/) { CHARSET_INFO* cs = fp[0]->data()->resultType().getCharset(); const auto& str = fp[0]->data()->getStrVal(row, isNull); diff --git a/utils/funcexp/func_substr.cpp b/utils/funcexp/func_substr.cpp index 1ef499fb5..85c9f4bd5 100644 --- a/utils/funcexp/func_substr.cpp +++ b/utils/funcexp/func_substr.cpp @@ -37,7 +37,7 @@ using namespace joblist; namespace funcexp { CalpontSystemCatalog::ColType Func_substr::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_substring_index.cpp b/utils/funcexp/func_substring_index.cpp index f7a77458f..7ab078f02 100644 --- a/utils/funcexp/func_substring_index.cpp +++ b/utils/funcexp/func_substring_index.cpp @@ -36,8 +36,8 @@ using namespace joblist; namespace funcexp { -CalpontSystemCatalog::ColType Func_substring_index::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_substring_index::operationType( + FunctionParm& fp, CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_sysdate.cpp b/utils/funcexp/func_sysdate.cpp index 780492f37..b893b509c 100644 --- a/utils/funcexp/func_sysdate.cpp +++ b/utils/funcexp/func_sysdate.cpp @@ -42,14 +42,14 @@ using namespace dataconvert; namespace funcexp { -CalpontSystemCatalog::ColType Func_sysdate::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_sysdate::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } -int64_t Func_sysdate::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& operationColType) +int64_t Func_sysdate::getIntVal(rowgroup::Row& /*row*/, FunctionParm& /*parm*/, bool& /*isNull*/, + CalpontSystemCatalog::ColType& /*operationColType*/) { struct tm tmp_tm; time_t now; @@ -67,8 +67,8 @@ int64_t Func_sysdate::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& is return *(reinterpret_cast(&aDatetime)); } -string Func_sysdate::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& operationColType) +string Func_sysdate::getStrVal(rowgroup::Row& /*row*/, FunctionParm& /*parm*/, bool& /*isNull*/, + CalpontSystemCatalog::ColType& /*operationColType*/) { time_t now; now = time(NULL); diff --git a/utils/funcexp/func_time.cpp b/utils/funcexp/func_time.cpp index e898f7820..478e44663 100644 --- a/utils/funcexp/func_time.cpp +++ b/utils/funcexp/func_time.cpp @@ -35,8 +35,8 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_time::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_time::operationType(FunctionParm& /*fp*/, + CalpontSystemCatalog::ColType& /*resultType*/) { CalpontSystemCatalog::ColType ct; ct.colDataType = CalpontSystemCatalog::VARCHAR; @@ -160,7 +160,7 @@ int64_t Func_time::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, } double Func_time::getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { // convert time value to int followiing mysql. e.g. 23:34:34 => 233434 int64_t datetimevalue = dataconvert::DataConvert::stringToDatetime(fp[0]->data()->getStrVal(row, isNull)); diff --git a/utils/funcexp/func_time_format.cpp b/utils/funcexp/func_time_format.cpp index c2d3c7663..e90c8f8dc 100644 --- a/utils/funcexp/func_time_format.cpp +++ b/utils/funcexp/func_time_format.cpp @@ -35,8 +35,8 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_time_format::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) +CalpontSystemCatalog::ColType Func_time_format::operationType(FunctionParm& /*fp*/, + CalpontSystemCatalog::ColType& /*resultType*/) { CalpontSystemCatalog::ColType ct; ct.colDataType = CalpontSystemCatalog::VARCHAR; diff --git a/utils/funcexp/func_time_to_sec.cpp b/utils/funcexp/func_time_to_sec.cpp index 5a010f20c..6084a7649 100644 --- a/utils/funcexp/func_time_to_sec.cpp +++ b/utils/funcexp/func_time_to_sec.cpp @@ -36,7 +36,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_time_to_sec::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_time_to_sec::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_timediff.cpp b/utils/funcexp/func_timediff.cpp index 68d4000bb..268049042 100644 --- a/utils/funcexp/func_timediff.cpp +++ b/utils/funcexp/func_timediff.cpp @@ -101,7 +101,7 @@ bool treatIntAsDatetime(const std::string& text) return (text.length() > 8) || (text.length() >= 8 && !isNeg); } -CalpontSystemCatalog::ColType Func_timediff::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_timediff::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_timestampdiff.cpp b/utils/funcexp/func_timestampdiff.cpp index 6ad2f3952..7d94128d5 100644 --- a/utils/funcexp/func_timestampdiff.cpp +++ b/utils/funcexp/func_timestampdiff.cpp @@ -39,7 +39,7 @@ using namespace dataconvert; namespace funcexp { -CalpontSystemCatalog::ColType Func_timestampdiff::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_timestampdiff::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_to_days.cpp b/utils/funcexp/func_to_days.cpp index ef0d17fe2..bc4ad36c2 100644 --- a/utils/funcexp/func_to_days.cpp +++ b/utils/funcexp/func_to_days.cpp @@ -41,7 +41,7 @@ using namespace logging; namespace funcexp { -CalpontSystemCatalog::ColType Func_to_days::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_to_days::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_trim.cpp b/utils/funcexp/func_trim.cpp index 0705a7dcc..fdb343c59 100644 --- a/utils/funcexp/func_trim.cpp +++ b/utils/funcexp/func_trim.cpp @@ -37,7 +37,7 @@ using namespace joblist; namespace funcexp { CalpontSystemCatalog::ColType Func_trim::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_trim_oracle.cpp b/utils/funcexp/func_trim_oracle.cpp index d8240a282..17e9e8566 100644 --- a/utils/funcexp/func_trim_oracle.cpp +++ b/utils/funcexp/func_trim_oracle.cpp @@ -31,7 +31,7 @@ using namespace joblist; namespace funcexp { CalpontSystemCatalog::ColType Func_trim_oracle::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_truncate.cpp b/utils/funcexp/func_truncate.cpp index cccaa3666..b83596506 100644 --- a/utils/funcexp/func_truncate.cpp +++ b/utils/funcexp/func_truncate.cpp @@ -136,7 +136,7 @@ int64_t Func_truncate::getIntVal(Row& row, FunctionParm& parm, bool& isNull, } uint64_t Func_truncate::getUintVal(Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { uint64_t val = parm[0]->data()->getUintVal(row, isNull); @@ -205,8 +205,7 @@ double Func_truncate::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, return x; } - default: - break; + default: break; } IDB_Decimal x = getDecimalVal(row, parm, isNull, op_ct); @@ -667,7 +666,7 @@ string Func_truncate::getStrVal(Row& row, FunctionParm& parm, bool& isNull, } int64_t Func_truncate::getTimestampIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int32_t s = parm.size() > 1 ? parm[1]->data()->getIntVal(row, isNull) : 0; if (isNull) @@ -679,11 +678,12 @@ int64_t Func_truncate::getTimestampIntVal(rowgroup::Row& row, FunctionParm& parm } int64_t x = parm[0]->data()->getTimestampIntVal(row, isNull); int32_t m_x = x & 0xfffff; - return (x ^ m_x) | (m_x / helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s] * helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s]); + return (x ^ m_x) | (m_x / helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s] * + helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s]); } int64_t Func_truncate::getDatetimeIntVal(Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int32_t s = parm.size() > 1 ? parm[1]->data()->getIntVal(row, isNull) : 0; if (isNull) @@ -695,11 +695,12 @@ int64_t Func_truncate::getDatetimeIntVal(Row& row, FunctionParm& parm, bool& isN } int64_t x = parm[0]->data()->getDatetimeIntVal(row, isNull); int32_t m_x = x & 0xfffff; - return (x ^ m_x) | (m_x / helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s] * helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s]); + return (x ^ m_x) | (m_x / helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s] * + helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s]); } int64_t Func_truncate::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) { int32_t s = parm.size() > 1 ? parm[1]->data()->getIntVal(row, isNull) : 0; if (isNull) @@ -711,8 +712,8 @@ int64_t Func_truncate::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm, boo } int64_t x = parm[0]->data()->getTimeIntVal(row, isNull); int32_t m_x = x & 0xffffff; - return (x ^ m_x) | (m_x / helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s] * helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s]); + return (x ^ m_x) | (m_x / helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s] * + helpers::powerOf10_c[MAX_MICROSECOND_PRECISION - s]); } - } // namespace funcexp diff --git a/utils/funcexp/func_ucase.cpp b/utils/funcexp/func_ucase.cpp index 5e9602643..a2258445a 100644 --- a/utils/funcexp/func_ucase.cpp +++ b/utils/funcexp/func_ucase.cpp @@ -46,7 +46,7 @@ class to_upper namespace funcexp { CalpontSystemCatalog::ColType Func_ucase::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type is not used by this functor return fp[0]->data()->resultType(); diff --git a/utils/funcexp/func_unhex.cpp b/utils/funcexp/func_unhex.cpp index c950bb005..224a128bd 100644 --- a/utils/funcexp/func_unhex.cpp +++ b/utils/funcexp/func_unhex.cpp @@ -59,14 +59,14 @@ inline string cleanup(char* to) namespace funcexp { -CalpontSystemCatalog::ColType Func_unhex::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_unhex::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } string Func_unhex::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) + CalpontSystemCatalog::ColType& /*op_ct*/) { const auto& nfrom = parm[0]->data()->getStrVal(row, isNull); diff --git a/utils/funcexp/func_unix_timestamp.cpp b/utils/funcexp/func_unix_timestamp.cpp index f9c81e6ba..e7c724664 100644 --- a/utils/funcexp/func_unix_timestamp.cpp +++ b/utils/funcexp/func_unix_timestamp.cpp @@ -35,14 +35,14 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_unix_timestamp::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_unix_timestamp::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; } int64_t Func_unix_timestamp::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& ct) + CalpontSystemCatalog::ColType& /*ct*/) { int64_t val = parm[0]->data()->getIntVal(row, isNull); diff --git a/utils/funcexp/func_week.cpp b/utils/funcexp/func_week.cpp index e6ab52f35..61bdd92bf 100644 --- a/utils/funcexp/func_week.cpp +++ b/utils/funcexp/func_week.cpp @@ -36,7 +36,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_week::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_week::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_weekday.cpp b/utils/funcexp/func_weekday.cpp index 7b7fb9377..b5b9b9d23 100644 --- a/utils/funcexp/func_weekday.cpp +++ b/utils/funcexp/func_weekday.cpp @@ -36,7 +36,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_weekday::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_weekday::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_year.cpp b/utils/funcexp/func_year.cpp index 9ea12fbdf..fe5e65888 100644 --- a/utils/funcexp/func_year.cpp +++ b/utils/funcexp/func_year.cpp @@ -35,7 +35,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_year::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_year::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/func_yearweek.cpp b/utils/funcexp/func_yearweek.cpp index 2ad941396..c0c852596 100644 --- a/utils/funcexp/func_yearweek.cpp +++ b/utils/funcexp/func_yearweek.cpp @@ -36,7 +36,7 @@ using namespace execplan; namespace funcexp { -CalpontSystemCatalog::ColType Func_yearweek::operationType(FunctionParm& fp, +CalpontSystemCatalog::ColType Func_yearweek::operationType(FunctionParm& /*fp*/, CalpontSystemCatalog::ColType& resultType) { return resultType; diff --git a/utils/funcexp/funcexp.h b/utils/funcexp/funcexp.h index 7fb10f6bd..7cd08006b 100644 --- a/utils/funcexp/funcexp.h +++ b/utils/funcexp/funcexp.h @@ -106,8 +106,8 @@ inline bool FuncExp::evaluate(rowgroup::Row& row, execplan::ParseTree* filters) return (filters->getBoolVal(row, isNull)); } -inline void FuncExp::evaluate(rowgroup::RowGroup& rowgroup, execplan::ParseTree* filters) -{ -} +// inline void FuncExp::evaluate(rowgroup::RowGroup& /*rowgroup*/, execplan::ParseTree* /*filters*/) +// { +// } } // namespace funcexp diff --git a/utils/funcexp/functor.h b/utils/funcexp/functor.h index b7da7dfcd..e7774532e 100644 --- a/utils/funcexp/functor.h +++ b/utils/funcexp/functor.h @@ -88,7 +88,7 @@ class Func throw logging::IDBExcept(oss.str(), logging::ERR_DATATYPE_NOT_SUPPORT); } - virtual bool fix(execplan::FunctionColumn& col) const + virtual bool fix(execplan::FunctionColumn& /*col*/) const { return false; } diff --git a/utils/funcexp/functor_bool.h b/utils/funcexp/functor_bool.h index b237449bc..b8ddabe22 100644 --- a/utils/funcexp/functor_bool.h +++ b/utils/funcexp/functor_bool.h @@ -78,29 +78,28 @@ class Func_Bool : public Func return execplan::IDB_Decimal(getIntVal(row, fp, isNull, op_ct), 0, 0); } - int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) override + int32_t getDateIntVal(rowgroup::Row& /*row*/, FunctionParm& /*fp*/, bool& /*isNull*/, + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) override + { + return 0; + } + + int64_t getDatetimeIntVal(rowgroup::Row& /*row*/, FunctionParm& /*fp*/, bool& isNull, + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) override { isNull = true; return 0; } - int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) override + int64_t getTimestampIntVal(rowgroup::Row& /*row*/, FunctionParm& /*fp*/, bool& isNull, + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) override { isNull = true; return 0; } - int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) override - { - isNull = true; - return 0; - } - - int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) override + int64_t getTimeIntVal(rowgroup::Row& /*row*/, FunctionParm& /*fp*/, bool& isNull, + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) override { isNull = true; return 0; @@ -237,14 +236,14 @@ class Func_Truth : public Func_Bool ~Func_Truth() override = default; execplan::CalpontSystemCatalog::ColType operationType( - FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override + FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& /*resultType*/) override { assert(fp.size() == 1); return fp[0]->data()->resultType(); } bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) override + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) override { bool val = fp[0]->data()->getBoolVal(row, isNull); diff --git a/utils/funcexp/functor_int.h b/utils/funcexp/functor_int.h index d2bc7cd19..54fff32bf 100644 --- a/utils/funcexp/functor_int.h +++ b/utils/funcexp/functor_int.h @@ -73,7 +73,7 @@ class Func_BitOp : public Func_Int { } execplan::CalpontSystemCatalog::ColType operationType( - FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override + FunctionParm& /*fp*/, execplan::CalpontSystemCatalog::ColType& resultType) override { return resultType; } @@ -89,8 +89,8 @@ class Func_BitOp : public Func_Int Func_Int& return_uint64_from_sint64_sint64, Func_Int& return_uint64_from_generic_generic) const; - int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, - execplan::CalpontSystemCatalog::ColType& op_ct) override + int64_t getIntVal(rowgroup::Row& /*row*/, FunctionParm& /*fp*/, bool& isNull, + execplan::CalpontSystemCatalog::ColType& /*op_ct*/) override { isNull = true; return 0; diff --git a/utils/funcexp/jsonhelpers.cpp b/utils/funcexp/jsonhelpers.cpp index a1a0ca4a6..1658e8f78 100644 --- a/utils/funcexp/jsonhelpers.cpp +++ b/utils/funcexp/jsonhelpers.cpp @@ -25,7 +25,8 @@ int setupJSPath(json_path_t* path, CHARSET_INFO* cs, const utils::NullString& st return 1; } -bool appendEscapedJS(string& ret, const CHARSET_INFO* retCS, const utils::NullString& js, const CHARSET_INFO* jsCS) +bool appendEscapedJS(string& ret, const CHARSET_INFO* retCS, const utils::NullString& js, + const CHARSET_INFO* jsCS) { const int jsLen = js.length(); const char* rawJS = js.str(); @@ -355,7 +356,7 @@ int parseJSPath(JSONPath& path, rowgroup::Row& row, execplan::SPTP& parm, bool w } bool matchJSPath(const vector& paths, const json_path_t* p, json_value_types valType, - const int* arrayCounter, bool exact) + const int* /*arrayCounter*/, bool exact) { for (size_t curr = 0; curr < paths.size(); curr++) { @@ -372,4 +373,3 @@ bool matchJSPath(const vector& paths, const json_path_t* p, j } } // namespace helpers } // namespace funcexp - diff --git a/utils/idbdatafile/IDBFileSystem.cpp b/utils/idbdatafile/IDBFileSystem.cpp index e2d8c9c80..f2c4bcd04 100644 --- a/utils/idbdatafile/IDBFileSystem.cpp +++ b/utils/idbdatafile/IDBFileSystem.cpp @@ -19,7 +19,7 @@ namespace idbdatafile { -IDBFileSystem::IDBFileSystem(Types type) : m_type(type) +IDBFileSystem::IDBFileSystem(Types /*type*/) { } diff --git a/utils/idbdatafile/IDBFileSystem.h b/utils/idbdatafile/IDBFileSystem.h index 78f405230..cf35cc8b1 100644 --- a/utils/idbdatafile/IDBFileSystem.h +++ b/utils/idbdatafile/IDBFileSystem.h @@ -136,16 +136,14 @@ class IDBFileSystem * chown() changes the owner of the object on the FS * Returns 0 on success. -1 on error. */ - virtual int chown(const char* objectName, const uid_t p_uid, const gid_t p_pid, int& funcErrno) const + virtual int chown(const char* /*objectName*/, const uid_t /*p_uid*/, const gid_t /*p_pid*/, + int& /*funcErrno*/) const { return 0; } protected: explicit IDBFileSystem(Types type); - - private: - Types m_type; }; /** diff --git a/utils/idbdatafile/IDBLogger.cpp b/utils/idbdatafile/IDBLogger.cpp index 17241ed9e..07aa58248 100644 --- a/utils/idbdatafile/IDBLogger.cpp +++ b/utils/idbdatafile/IDBLogger.cpp @@ -144,7 +144,7 @@ void IDBLogger::logFSop2(IDBFileSystem::Types type, const char* op, const char* writeLog(logmsg.str()); } -string IDBLogger::get_backtrace(int to_skip, int num_to_show) +string IDBLogger::get_backtrace([[maybe_unused]] int to_skip, [[maybe_unused]] int num_to_show) { string retval; #if !defined(_MSC_VER) && !defined(SKIP_UNWIND) diff --git a/utils/joiner/joinpartition.cpp b/utils/joiner/joinpartition.cpp index 362842b55..dbf4521eb 100644 --- a/utils/joiner/joinpartition.cpp +++ b/utils/joiner/joinpartition.cpp @@ -119,7 +119,7 @@ JoinPartition::JoinPartition(const RowGroup& lRG, const RowGroup& sRG, const vec } /* Ctor used by JoinPartition on expansion, creates JP's in filemode */ -JoinPartition::JoinPartition(const JoinPartition& jp, bool splitMode, uint32_t currentPartitionTreeDepth) +JoinPartition::JoinPartition(const JoinPartition& jp, bool /*splitMode*/, uint32_t currentPartitionTreeDepth) : smallRG(jp.smallRG) , largeRG(jp.largeRG) , smallKeyCols(jp.smallKeyCols) diff --git a/utils/joiner/tuplejoiner.cpp b/utils/joiner/tuplejoiner.cpp index 2736993aa..7d3b59114 100644 --- a/utils/joiner/tuplejoiner.cpp +++ b/utils/joiner/tuplejoiner.cpp @@ -253,17 +253,6 @@ TupleJoiner::TupleJoiner() { } -TupleJoiner::TupleJoiner(const TupleJoiner& j) -{ - throw runtime_error("TupleJoiner(TupleJoiner) shouldn't be called."); -} - -TupleJoiner& TupleJoiner::operator=(const TupleJoiner& j) -{ - throw runtime_error("TupleJoiner::operator=() shouldn't be called."); - return *this; -} - TupleJoiner::~TupleJoiner() { smallNullMemory = RGData(); diff --git a/utils/joiner/tuplejoiner.h b/utils/joiner/tuplejoiner.h index fb64cde86..821b57deb 100644 --- a/utils/joiner/tuplejoiner.h +++ b/utils/joiner/tuplejoiner.h @@ -487,8 +487,8 @@ class TupleJoiner typedef ldhash_t::iterator ldIterator; TupleJoiner(); - TupleJoiner(const TupleJoiner&); - TupleJoiner& operator=(const TupleJoiner&); + TupleJoiner(const TupleJoiner&) = delete; + TupleJoiner& operator=(const TupleJoiner&) = delete; void getBucketCount(); rowgroup::RGData smallNullMemory; diff --git a/utils/messageqcpp/messagequeue.cpp b/utils/messageqcpp/messagequeue.cpp index 564c90b54..a5cad8e49 100644 --- a/utils/messageqcpp/messagequeue.cpp +++ b/utils/messageqcpp/messagequeue.cpp @@ -81,7 +81,7 @@ struct sockaddr* hostnameResolver(const std::string& dnOrIp, const uint16_t port return sockAddrPtr; } -void MessageQueueServer::setup(size_t blocksize, int backlog, bool syncProto) +void MessageQueueServer::setup(size_t /*blocksize*/, int backlog, bool syncProto) { string thisEndPortStr; diff --git a/utils/messageqcpp/samenodepseudosocket.cpp b/utils/messageqcpp/samenodepseudosocket.cpp index 2e7ac9c27..9f0871e80 100644 --- a/utils/messageqcpp/samenodepseudosocket.cpp +++ b/utils/messageqcpp/samenodepseudosocket.cpp @@ -44,48 +44,48 @@ Socket* SameNodePseudoSocket::clone() const return nullptr; } -SameNodePseudoSocket::SameNodePseudoSocket(const SameNodePseudoSocket& rhs) +SameNodePseudoSocket::SameNodePseudoSocket(const SameNodePseudoSocket& /*rhs*/) { } -SameNodePseudoSocket& SameNodePseudoSocket::operator=(const SameNodePseudoSocket& rhs) +SameNodePseudoSocket& SameNodePseudoSocket::operator=(const SameNodePseudoSocket& /*rhs*/) { return *this; } -const SBS SameNodePseudoSocket::read(const struct ::timespec* timeout, bool* isTimeOut, Stats* stats) const +const SBS SameNodePseudoSocket::read(const struct ::timespec* /*timeout*/, bool* /*isTimeOut*/, Stats* /*stats*/) const { return nullptr; } // This is the only working method of this class. It puts SBS directly into DEC queue. -void SameNodePseudoSocket::write(SBS msg, Stats* stats) +void SameNodePseudoSocket::write(SBS msg, Stats* /*stats*/) { dec_->addDataToOutput(msg); } -void SameNodePseudoSocket::write(const ByteStream& msg, Stats* stats) +void SameNodePseudoSocket::write(const ByteStream& /*msg*/, Stats* /*stats*/) { } -void SameNodePseudoSocket::write_raw(const ByteStream& msg, Stats* stats) const +void SameNodePseudoSocket::write_raw(const ByteStream& /*msg*/, Stats* /*stats*/) const { } -void SameNodePseudoSocket::connect(const sockaddr* serv_addr) +void SameNodePseudoSocket::connect(const sockaddr* /*serv_addr*/) { } -void SameNodePseudoSocket::bind(const sockaddr* serv_addr) +void SameNodePseudoSocket::bind(const sockaddr* /*serv_addr*/) { } -const IOSocket SameNodePseudoSocket::accept(const struct timespec* timeout) +const IOSocket SameNodePseudoSocket::accept(const struct timespec* /*timeout*/) { return IOSocket(); } -void SameNodePseudoSocket::listen(int backlog) +void SameNodePseudoSocket::listen(int /*backlog*/) { } @@ -99,17 +99,17 @@ const std::string SameNodePseudoSocket::addr2String() const return ""; } -bool SameNodePseudoSocket::isSameAddr(const Socket* rhs) const +bool SameNodePseudoSocket::isSameAddr(const Socket* /*rhs*/) const { return false; } -bool SameNodePseudoSocket::isSameAddr(const struct in_addr& ipv4Addr) const +bool SameNodePseudoSocket::isSameAddr(const struct in_addr& /*ipv4Addr*/) const { return false; } -int SameNodePseudoSocket::ping(const std::string& ipaddr, const struct timespec* timeout) +int SameNodePseudoSocket::ping(const std::string& /*ipaddr*/, const struct timespec* /*timeout*/) { return 0; } diff --git a/utils/messageqcpp/samenodepseudosocket.h b/utils/messageqcpp/samenodepseudosocket.h index df8ff72e3..7b6050631 100644 --- a/utils/messageqcpp/samenodepseudosocket.h +++ b/utils/messageqcpp/samenodepseudosocket.h @@ -41,11 +41,11 @@ class SameNodePseudoSocket : public Socket SameNodePseudoSocket(const SameNodePseudoSocket& rhs); virtual SameNodePseudoSocket& operator=(const SameNodePseudoSocket& rhs); - void connectionTimeout(const struct ::timespec* timeout) override + void connectionTimeout(const struct ::timespec* /*timeout*/) override { } - void syncProto(bool use) override + void syncProto(bool /*use*/) override { } @@ -54,7 +54,7 @@ class SameNodePseudoSocket : public Socket return 1; } - inline void socketParms(const SocketParms& socket) override + inline void socketParms(const SocketParms& /*socket*/) override { } @@ -92,7 +92,7 @@ inline bool SameNodePseudoSocket::isOpen() const return true; } -inline void SameNodePseudoSocket::sa(const sockaddr* sa) +inline void SameNodePseudoSocket::sa(const sockaddr* /*sa*/) { } diff --git a/utils/regr/moda.cpp b/utils/regr/moda.cpp index 4dbb12674..d239371ec 100644 --- a/utils/regr/moda.cpp +++ b/utils/regr/moda.cpp @@ -105,7 +105,7 @@ mcsv1_UDAF* moda::getImpl(mcsv1Context* context) case execplan::CalpontSystemCatalog::VARCHAR: case execplan::CalpontSystemCatalog::CHAR: - data->modaImpl = &moda_impl_string; + data->modaImpl = &moda_impl_string; break; default: data->modaImpl = NULL; @@ -367,9 +367,9 @@ void ModaData::serialize(messageqcpp::ByteStream& bs) const case execplan::CalpontSystemCatalog::FLOAT: serializeMap(bs); break; case execplan::CalpontSystemCatalog::DOUBLE: serializeMap(bs); break; case execplan::CalpontSystemCatalog::LONGDOUBLE: serializeMap(bs); break; - case execplan::CalpontSystemCatalog::CHAR: + case execplan::CalpontSystemCatalog::CHAR: case execplan::CalpontSystemCatalog::VARCHAR: - serializeMap(bs); break; + serializeMap(bs); break; default: throw std::runtime_error("ModaData::serialize with bad data type"); break; } } @@ -505,7 +505,7 @@ void ModaData::cleanup() * String Specialization ************************************************************************************************/ -mcsv1_UDAF::ReturnCode Moda_impl_T::init(mcsv1Context* context, ColumnDatum* colTypes) +mcsv1_UDAF::ReturnCode Moda_impl_T::init(mcsv1Context* context, ColumnDatum* /*colTypes*/) { cs.setCharset(context->getCharsetNumber()); return mcsv1_UDAF::SUCCESS; diff --git a/utils/regr/moda.h b/utils/regr/moda.h index 7f3641de7..aaa7fc771 100644 --- a/utils/regr/moda.h +++ b/utils/regr/moda.h @@ -55,7 +55,7 @@ namespace mcsv1sdk template struct hasher { - explicit hasher(uint32_t cs_num) + explicit hasher(uint32_t /*cs_num*/) { } @@ -72,7 +72,7 @@ struct hasher template <> struct hasher { - explicit hasher(uint32_t cs_num) + explicit hasher(uint32_t /*cs_num*/) { } inline size_t operator()(long double val) const @@ -108,7 +108,7 @@ struct hasher template struct comparator { - explicit comparator(uint32_t cs_num) + explicit comparator(uint32_t /*cs_num*/) { } @@ -266,7 +266,7 @@ class Moda_impl_T : public mcsv1_UDAF mcsv1_UDAF::ReturnCode dropValue(mcsv1Context* context, ColumnDatum* valsDropped) override; // Dummy: not used - mcsv1_UDAF::ReturnCode createUserData(UserData*& userData, int32_t& length) override + mcsv1_UDAF::ReturnCode createUserData(UserData*& /*userData*/, int32_t& /*length*/) override { return mcsv1_UDAF::SUCCESS; } @@ -289,7 +289,7 @@ class Moda_impl_T : public mcsv1_UDAF mcsv1_UDAF::ReturnCode dropValue(mcsv1Context* context, ColumnDatum* valsDropped) override; // Dummy: not used - mcsv1_UDAF::ReturnCode createUserData(UserData*& userData, int32_t& length) override + mcsv1_UDAF::ReturnCode createUserData(UserData*& /*userData*/, int32_t& /*length*/) override { return mcsv1_UDAF::SUCCESS; } diff --git a/utils/regr/modamysql.cpp b/utils/regr/modamysql.cpp index c16a21008..3d8434be4 100644 --- a/utils/regr/modamysql.cpp +++ b/utils/regr/modamysql.cpp @@ -20,9 +20,9 @@ inline bool isNumeric(int type, const char* attr) return true; } if (strncasecmp("NULL", attr, 4) == 0) - { - return true; - } + { + return true; + } return false; } @@ -109,14 +109,13 @@ extern "C" delete data; } - void moda_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void moda_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct moda_data* data = (struct moda_data*)initid->ptr; data->clear(); } - void moda_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) + void moda_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL if (args->args[0] == 0) @@ -155,7 +154,7 @@ extern "C" } } - void moda_remove(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) + void moda_remove(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL if (args->args[0] == 0) @@ -193,22 +192,17 @@ extern "C" } } -//char* moda(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error __attribute__((unused))) - char* moda(UDF_INIT * initid, UDF_ARGS * args, char* result, ulong* res_length, char* is_null, char* error __attribute__((unused))) + // char* moda(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error __attribute__((unused))) + char* moda(UDF_INIT* initid, UDF_ARGS* args, char* /*result*/, ulong* res_length, char* /*is_null*/, + char* /*error*/) { struct moda_data* data = (struct moda_data*)initid->ptr; switch (args->arg_type[0]) { - case INT_RESULT: - moda(data->mapINT, data); - break; - case REAL_RESULT: - moda(data->mapREAL, data); - break; + case INT_RESULT: moda(data->mapINT, data); break; + case REAL_RESULT: moda(data->mapREAL, data); break; case DECIMAL_RESULT: - case STRING_RESULT: - moda(data->mapDECIMAL, data); - break; + case STRING_RESULT: moda(data->mapDECIMAL, data); break; default: return NULL; } *res_length = data->result.size(); diff --git a/utils/regr/regr_count.cpp b/utils/regr/regr_count.cpp index 689914175..b2f2db9ff 100644 --- a/utils/regr/regr_count.cpp +++ b/utils/regr/regr_count.cpp @@ -41,7 +41,7 @@ struct regr_count_data long long cnt; }; -mcsv1_UDAF::ReturnCode regr_count::init(mcsv1Context* context, ColumnDatum* colTypes) +mcsv1_UDAF::ReturnCode regr_count::init(mcsv1Context* context, ColumnDatum* /*colTypes*/) { if (context->getParameterCount() != 2) { diff --git a/utils/regr/regrmysql.cpp b/utils/regr/regrmysql.cpp index 8700e9952..39fed3146 100644 --- a/utils/regr/regrmysql.cpp +++ b/utils/regr/regrmysql.cpp @@ -16,9 +16,9 @@ inline bool isNumeric(int type, const char* attr) return true; } if (strncasecmp("NULL", attr, 4) == 0) - { - return true; - } + { + return true; + } return false; } @@ -77,7 +77,7 @@ extern "C" int64_t cnt; }; - my_bool regr_avgx_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool regr_avgx_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_avgx_data* data; if (args->arg_count != 2) @@ -107,21 +107,19 @@ extern "C" return 0; } - void regr_avgx_deinit(UDF_INIT* initid) + void regr_avgx_deinit(UDF_INIT* initid) { free(initid->ptr); } - void regr_avgx_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void regr_avgx_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct regr_avgx_data* data = (struct regr_avgx_data*)initid->ptr; data->sumx = 0; data->cnt = 0; } - void regr_avgx_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, - char* message __attribute__((unused))) + void regr_avgx_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL in x and y if (args->args[0] == 0 || args->args[1] == 0) @@ -134,8 +132,7 @@ extern "C" data->sumx += xval; } - double regr_avgx(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + double regr_avgx(UDF_INIT* initid, UDF_ARGS* /*args*/, char* is_null, char* /*error*/) { struct regr_avgx_data* data = (struct regr_avgx_data*)initid->ptr; double valOut = 0; @@ -162,7 +159,7 @@ extern "C" int64_t cnt; }; - my_bool regr_avgy_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool regr_avgy_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_avgy_data* data; if (args->arg_count != 2) @@ -193,21 +190,19 @@ extern "C" return 0; } - void regr_avgy_deinit(UDF_INIT* initid) + void regr_avgy_deinit(UDF_INIT* initid) { free(initid->ptr); } - void regr_avgy_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void regr_avgy_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct regr_avgy_data* data = (struct regr_avgy_data*)initid->ptr; data->sumy = 0; data->cnt = 0; } - void regr_avgy_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, - char* message __attribute__((unused))) + void regr_avgy_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL in x and y if (args->args[0] == 0 || args->args[1] == 0) @@ -220,8 +215,7 @@ extern "C" data->sumy += yval; } - double regr_avgy(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + double regr_avgy(UDF_INIT* initid, UDF_ARGS* /*args*/, char* is_null, char* /*error*/) { struct regr_avgy_data* data = (struct regr_avgy_data*)initid->ptr; double valOut = 0; @@ -246,7 +240,7 @@ extern "C" int64_t cnt; }; - my_bool regr_count_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool regr_count_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_count_data* data; if (args->arg_count != 2) @@ -266,20 +260,18 @@ extern "C" return 0; } - void regr_count_deinit(UDF_INIT* initid) + void regr_count_deinit(UDF_INIT* initid) { free(initid->ptr); } - void regr_count_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void regr_count_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct regr_count_data* data = (struct regr_count_data*)initid->ptr; data->cnt = 0; } - void regr_count_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, - char* message __attribute__((unused))) + void regr_count_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL in x and y if (args->args[0] == 0 || args->args[1] == 0) @@ -290,8 +282,7 @@ extern "C" ++data->cnt; } - long long regr_count(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + long long regr_count(UDF_INIT* initid, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/) { struct regr_count_data* data = (struct regr_count_data*)initid->ptr; return data->cnt; @@ -311,7 +302,7 @@ extern "C" long double sumxy; // sum of (x*y) }; - my_bool regr_slope_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool regr_slope_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_slope_data* data; if (args->arg_count != 2) @@ -343,13 +334,12 @@ extern "C" return 0; } - void regr_slope_deinit(UDF_INIT* initid) + void regr_slope_deinit(UDF_INIT* initid) { free(initid->ptr); } - void regr_slope_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void regr_slope_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct regr_slope_data* data = (struct regr_slope_data*)initid->ptr; data->cnt = 0; @@ -359,8 +349,7 @@ extern "C" data->sumxy = 0.0; } - void regr_slope_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, - char* message __attribute__((unused))) + void regr_slope_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL in x and y if (args->args[0] == 0 || args->args[1] == 0) @@ -377,8 +366,7 @@ extern "C" ++data->cnt; } - double regr_slope(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + double regr_slope(UDF_INIT* initid, UDF_ARGS* /*args*/, char* is_null, char* /*error*/) { struct regr_slope_data* data = (struct regr_slope_data*)initid->ptr; double N = data->cnt; @@ -415,7 +403,7 @@ extern "C" long double sumxy; // sum of (x*y) }; - my_bool regr_intercept_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool regr_intercept_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_intercept_data* data; if (args->arg_count != 2) @@ -446,13 +434,12 @@ extern "C" return 0; } - void regr_intercept_deinit(UDF_INIT* initid) + void regr_intercept_deinit(UDF_INIT* initid) { free(initid->ptr); } - void regr_intercept_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void regr_intercept_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct regr_intercept_data* data = (struct regr_intercept_data*)initid->ptr; data->cnt = 0; @@ -462,8 +449,7 @@ extern "C" data->sumxy = 0.0; } - void regr_intercept_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, - char* message __attribute__((unused))) + void regr_intercept_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL in x and y if (args->args[0] == 0 || args->args[1] == 0) @@ -480,8 +466,7 @@ extern "C" ++data->cnt; } - double regr_intercept(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + double regr_intercept(UDF_INIT* initid, UDF_ARGS* /*args*/, char* is_null, char* /*error*/) { struct regr_intercept_data* data = (struct regr_intercept_data*)initid->ptr; double N = data->cnt; @@ -519,7 +504,7 @@ extern "C" long double sumxy; // sum of (x*y) }; - my_bool regr_r2_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool regr_r2_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_r2_data* data; if (args->arg_count != 2) @@ -552,13 +537,12 @@ extern "C" return 0; } - void regr_r2_deinit(UDF_INIT* initid) + void regr_r2_deinit(UDF_INIT* initid) { free(initid->ptr); } - void regr_r2_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void regr_r2_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct regr_r2_data* data = (struct regr_r2_data*)initid->ptr; data->cnt = 0; @@ -569,7 +553,7 @@ extern "C" data->sumxy = 0.0; } - void regr_r2_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) + void regr_r2_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL in x and y if (args->args[0] == 0 || args->args[1] == 0) @@ -587,8 +571,7 @@ extern "C" ++data->cnt; } - double regr_r2(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + double regr_r2(UDF_INIT* initid, UDF_ARGS* /*args*/, char* is_null, char* /*error*/) { struct regr_r2_data* data = (struct regr_r2_data*)initid->ptr; double N = data->cnt; @@ -641,7 +624,7 @@ extern "C" long double sumxy; // sum of (x*y) }; - my_bool corr_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool corr_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct corr_data* data; if (args->arg_count != 2) @@ -674,13 +657,12 @@ extern "C" return 0; } - void corr_deinit(UDF_INIT* initid) + void corr_deinit(UDF_INIT* initid) { free(initid->ptr); } - void corr_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void corr_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct corr_data* data = (struct corr_data*)initid->ptr; data->cnt = 0; @@ -691,7 +673,7 @@ extern "C" data->sumxy = 0.0; } - void corr_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) + void corr_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL in x and y if (args->args[0] == 0 || args->args[1] == 0) @@ -709,8 +691,7 @@ extern "C" ++data->cnt; } - double corr(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + double corr(UDF_INIT* initid, UDF_ARGS* /*args*/, char* is_null, char* /*error*/) { struct corr_data* data = (struct corr_data*)initid->ptr; double N = data->cnt; @@ -760,7 +741,7 @@ extern "C" long double sumx2; // sum of (x squared) }; - my_bool regr_sxx_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool regr_sxx_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_sxx_data* data; if (args->arg_count != 2) @@ -789,13 +770,12 @@ extern "C" return 0; } - void regr_sxx_deinit(UDF_INIT* initid) + void regr_sxx_deinit(UDF_INIT* initid) { free(initid->ptr); } - void regr_sxx_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void regr_sxx_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct regr_sxx_data* data = (struct regr_sxx_data*)initid->ptr; data->cnt = 0; @@ -803,8 +783,7 @@ extern "C" data->sumx2 = 0.0; } - void regr_sxx_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, - char* message __attribute__((unused))) + void regr_sxx_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL in x and y if (args->args[0] == 0 || args->args[1] == 0) @@ -818,8 +797,7 @@ extern "C" ++data->cnt; } - double regr_sxx(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + double regr_sxx(UDF_INIT* initid, UDF_ARGS* /*args*/, char* is_null, char* /*error*/) { struct regr_sxx_data* data = (struct regr_sxx_data*)initid->ptr; double N = data->cnt; @@ -851,7 +829,7 @@ extern "C" long double sumy2; // sum of (y squared) }; - my_bool regr_syy_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool regr_syy_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_syy_data* data; if (args->arg_count != 2) @@ -880,13 +858,12 @@ extern "C" return 0; } - void regr_syy_deinit(UDF_INIT* initid) + void regr_syy_deinit(UDF_INIT* initid) { free(initid->ptr); } - void regr_syy_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void regr_syy_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct regr_syy_data* data = (struct regr_syy_data*)initid->ptr; data->cnt = 0; @@ -894,8 +871,7 @@ extern "C" data->sumy2 = 0.0; } - void regr_syy_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, - char* message __attribute__((unused))) + void regr_syy_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL in x and y if (args->args[0] == 0 || args->args[1] == 0) @@ -909,8 +885,7 @@ extern "C" ++data->cnt; } - double regr_syy(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + double regr_syy(UDF_INIT* initid, UDF_ARGS* /*args*/, char* is_null, char* /*error*/) { struct regr_syy_data* data = (struct regr_syy_data*)initid->ptr; double N = data->cnt; @@ -944,7 +919,7 @@ extern "C" long double sumxy; // sum of (x*y) }; - my_bool regr_sxy_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool regr_sxy_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_sxy_data* data; if (args->arg_count != 2) @@ -975,13 +950,12 @@ extern "C" return 0; } - void regr_sxy_deinit(UDF_INIT* initid) + void regr_sxy_deinit(UDF_INIT* initid) { free(initid->ptr); } - void regr_sxy_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void regr_sxy_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct regr_sxy_data* data = (struct regr_sxy_data*)initid->ptr; data->cnt = 0; @@ -990,8 +964,7 @@ extern "C" data->sumxy = 0.0; } - void regr_sxy_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, - char* message __attribute__((unused))) + void regr_sxy_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL in x and y if (args->args[0] == 0 || args->args[1] == 0) @@ -1007,8 +980,7 @@ extern "C" ++data->cnt; } - double regr_sxy(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + double regr_sxy(UDF_INIT* initid, UDF_ARGS* /*args*/, char* is_null, char* /*error*/) { struct regr_sxy_data* data = (struct regr_sxy_data*)initid->ptr; double N = data->cnt; @@ -1041,7 +1013,7 @@ extern "C" long double sumxy; // sum of (x*y) }; - my_bool covar_pop_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool covar_pop_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct covar_pop_data* data; if (args->arg_count != 2) @@ -1072,13 +1044,12 @@ extern "C" return 0; } - void covar_pop_deinit(UDF_INIT* initid) + void covar_pop_deinit(UDF_INIT* initid) { free(initid->ptr); } - void covar_pop_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void covar_pop_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct covar_pop_data* data = (struct covar_pop_data*)initid->ptr; data->cnt = 0; @@ -1087,8 +1058,7 @@ extern "C" data->sumxy = 0.0; } - void covar_pop_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, - char* message __attribute__((unused))) + void covar_pop_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL in x and y if (args->args[0] == 0 || args->args[1] == 0) @@ -1104,8 +1074,7 @@ extern "C" ++data->cnt; } - double covar_pop(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + double covar_pop(UDF_INIT* initid, UDF_ARGS* /*args*/, char* is_null, char* /*error*/) { struct covar_pop_data* data = (struct covar_pop_data*)initid->ptr; double N = data->cnt; @@ -1137,7 +1106,7 @@ extern "C" long double sumxy; // sum of (x*y) }; - my_bool covar_samp_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool covar_samp_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct covar_samp_data* data; if (args->arg_count != 2) @@ -1168,13 +1137,12 @@ extern "C" return 0; } - void covar_samp_deinit(UDF_INIT* initid) + void covar_samp_deinit(UDF_INIT* initid) { free(initid->ptr); } - void covar_samp_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void covar_samp_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct covar_samp_data* data = (struct covar_samp_data*)initid->ptr; data->cnt = 0; @@ -1183,8 +1151,7 @@ extern "C" data->sumxy = 0.0; } - void covar_samp_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, - char* message __attribute__((unused))) + void covar_samp_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // Test for NULL in x and y if (args->args[0] == 0 || args->args[1] == 0) @@ -1200,8 +1167,7 @@ extern "C" ++data->cnt; } - double covar_samp(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + double covar_samp(UDF_INIT* initid, UDF_ARGS* /*args*/, char* is_null, char* /*error*/) { struct covar_samp_data* data = (struct covar_samp_data*)initid->ptr; double N = data->cnt; diff --git a/utils/rowgroup/rowaggregation.cpp b/utils/rowgroup/rowaggregation.cpp index cb968c251..a4d266da0 100644 --- a/utils/rowgroup/rowaggregation.cpp +++ b/utils/rowgroup/rowaggregation.cpp @@ -1368,7 +1368,7 @@ void RowAggregation::doSelectSome(const Row& rowIn, int64_t colIn, int64_t colOu // Note: NULL value check must be done on UM & PM // UM may receive NULL values, too. //------------------------------------------------------------------------------ -void RowAggregation::doSum(const Row& rowIn, int64_t colIn, int64_t colOut, int funcType) +void RowAggregation::doSum(const Row& rowIn, int64_t colIn, int64_t colOut, int /*funcType*/) { datatypes::SystemCatalog::ColDataType colDataType = rowIn.getColType(colIn); long double valIn = 0; @@ -2569,7 +2569,7 @@ void RowAggregationUM::endOfInput() //------------------------------------------------------------------------------ // Initilalize the Group Concat data //------------------------------------------------------------------------------ -void RowAggregationUM::initialize(bool hasGroupConcat) +void RowAggregationUM::initialize(bool /*hasGroupConcat*/) { if (fGroupConcat.size() > 0) fFunctionColGc = fFunctionCols; @@ -4540,7 +4540,7 @@ void RowAggregationUMP2::doBitOp(const Row& rowIn, int64_t colIn, int64_t colOut // rowUDAF(in) - pointer to the RowUDAFFunctionCol for this UDAF instance // rgContextColl(in) - ptr to a vector that brings UDAF contextx in //------------------------------------------------------------------------------ -void RowAggregationUMP2::doUDAF(const Row& rowIn, int64_t colIn, int64_t colOut, int64_t colAux, +void RowAggregationUMP2::doUDAF(const Row& rowIn, int64_t colIn, int64_t /*colOut*/, int64_t colAux, uint64_t& funcColsIdx, std::vector* rgContextColl) { static_any::any valOut; diff --git a/utils/rowgroup/rowaggregation.h b/utils/rowgroup/rowaggregation.h index c66795363..9374a89ea 100644 --- a/utils/rowgroup/rowaggregation.h +++ b/utils/rowgroup/rowaggregation.h @@ -310,11 +310,11 @@ struct ConstantAggData { } - ConstantAggData(utils::NullString v, RowAggFunctionType f, bool n) : fConstValue(v), fOp(f) + ConstantAggData(utils::NullString v, RowAggFunctionType f, bool /*n*/) : fConstValue(v), fOp(f) { } - ConstantAggData(utils::NullString v, std::string u, RowAggFunctionType f, bool n) + ConstantAggData(utils::NullString v, std::string u, RowAggFunctionType f, bool /*n*/) : fConstValue(v), fUDAFName(u), fOp(f) { } @@ -848,7 +848,7 @@ class RowAggregationUMP2 : public RowAggregationUM void doBitOp(const Row&, int64_t, int64_t, int) override; void doUDAF(const Row&, int64_t, int64_t, int64_t, uint64_t& funcColsIdx, std::vector* rgContextColl = nullptr) override; - bool countSpecial(const RowGroup* pRG) override + bool countSpecial(const RowGroup* /*pRG*/) override { return false; } diff --git a/utils/rowgroup/rowgroup.h b/utils/rowgroup/rowgroup.h index 8ee18060e..4fb6ff001 100644 --- a/utils/rowgroup/rowgroup.h +++ b/utils/rowgroup/rowgroup.h @@ -41,7 +41,6 @@ #include #include - #include "countingallocator.h" #include "hasher.h" @@ -301,7 +300,6 @@ class AggregateDataStore class RowGroup; class Row; - /* TODO: OO the rowgroup data to the extent there's no measurable performance hit. */ class RGData { @@ -538,7 +536,7 @@ class Row inline void setDoubleField(double val, uint32_t colIndex); inline void setFloatField(float val, uint32_t colIndex); - inline void setDecimalField(double val, uint32_t colIndex) {}; // TODO: Do something here + inline void setDecimalField(double /*val*/, uint32_t /*colIndex*/) { } // TODO: Do something here inline void setLongDoubleField(const long double& val, uint32_t colIndex); inline void setInt128Field(const int128_t& val, uint32_t colIndex); @@ -947,7 +945,7 @@ inline void Row::setBinaryField(const int128_t* value, uint32_t colInd // This method !cannot! be applied to uint8_t* buffers. template -inline void Row::setBinaryField_offset(const T* value, uint32_t width, uint32_t offset) +inline void Row::setBinaryField_offset(const T* value, uint32_t /*width*/, uint32_t offset) { *reinterpret_cast(&data[offset]) = *value; } @@ -959,7 +957,7 @@ inline void Row::setBinaryField_offset(const uint8_t* value, uint32_t w } template <> -inline void Row::setBinaryField_offset(const int128_t* value, uint32_t width, uint32_t offset) +inline void Row::setBinaryField_offset(const int128_t* value, uint32_t /*width*/, uint32_t offset) { datatypes::TSInt128::assignPtrPtr(&data[offset], value); } @@ -993,6 +991,7 @@ inline void Row::colUpdateHasher(datatypes::MariaDBHasher& hM, const utils::Hash case execplan::CalpontSystemCatalog::VARCHAR: case execplan::CalpontSystemCatalog::BLOB: case execplan::CalpontSystemCatalog::TEXT: + case execplan::CalpontSystemCatalog::CLOB: { CHARSET_INFO* cs = getCharset(col); hM.add(cs, getConstString(col)); @@ -1019,6 +1018,7 @@ inline void Row::colUpdateHasherTypeless(datatypes::MariaDBHasher& h, uint32_t k case datatypes::SystemCatalog::VARCHAR: case datatypes::SystemCatalog::BLOB: case datatypes::SystemCatalog::TEXT: + case datatypes::SystemCatalog::CLOB: { CHARSET_INFO* cs = getCharset(rowKeyColIdx); h.add(cs, getConstString(rowKeyColIdx)); @@ -1447,7 +1447,8 @@ inline void Row::copyField(Row& out, uint32_t destIndex, uint32_t srcIndex) cons { if (UNLIKELY(types[srcIndex] == execplan::CalpontSystemCatalog::VARBINARY || types[srcIndex] == execplan::CalpontSystemCatalog::BLOB || - types[srcIndex] == execplan::CalpontSystemCatalog::TEXT)) + types[srcIndex] == execplan::CalpontSystemCatalog::TEXT || + types[srcIndex] == execplan::CalpontSystemCatalog::CLOB)) { out.setVarBinaryField(getVarBinaryField(srcIndex), getVarBinaryLength(srcIndex), destIndex); } @@ -1926,7 +1927,8 @@ inline bool RowGroup::isLongString(uint32_t colIndex) const (getColumnWidth(colIndex) > 8 && types[colIndex] == execplan::CalpontSystemCatalog::CHAR) || types[colIndex] == execplan::CalpontSystemCatalog::VARBINARY || types[colIndex] == execplan::CalpontSystemCatalog::BLOB || - types[colIndex] == execplan::CalpontSystemCatalog::TEXT); + types[colIndex] == execplan::CalpontSystemCatalog::TEXT || + types[colIndex] == execplan::CalpontSystemCatalog::CLOB); } inline bool RowGroup::usesStringTable() const diff --git a/utils/threadpool/prioritythreadpool.h b/utils/threadpool/prioritythreadpool.h index 9f7adc3df..1ec651b37 100644 --- a/utils/threadpool/prioritythreadpool.h +++ b/utils/threadpool/prioritythreadpool.h @@ -62,7 +62,7 @@ class PriorityThreadPool Job() : weight(1), priority(0), id(0) { } - Job(const uint32_t uniqueID, const uint32_t stepID, const TransactionIdxT txnIdx, + Job(const uint32_t uniqueID, const uint32_t stepID, const TransactionIdxT /*txnIdx*/, const boost::shared_ptr& functor, const primitiveprocessor::SP_UM_IOSOCK& sock, const uint32_t weight = 1, const uint32_t priority = 0, const uint32_t id = 0) : functor(functor) diff --git a/utils/threadpool/weightedthreadpool.cpp b/utils/threadpool/weightedthreadpool.cpp index 45cee2a5e..a7b5533d3 100644 --- a/utils/threadpool/weightedthreadpool.cpp +++ b/utils/threadpool/weightedthreadpool.cpp @@ -90,11 +90,6 @@ void WeightedThreadPool::setMaxThreadWeight(size_t maxWeight) fMaxThreadWeight = maxWeight; } -void WeightedThreadPool::setThreadCreatedListener(const Functor_T& f) -{ - // fThreadCreated = f; -} - void WeightedThreadPool::stop() { boost::mutex::scoped_lock lock1(fMutex); diff --git a/utils/threadpool/weightedthreadpool.h b/utils/threadpool/weightedthreadpool.h index ae8e0b026..a2188b813 100644 --- a/utils/threadpool/weightedthreadpool.h +++ b/utils/threadpool/weightedthreadpool.h @@ -116,12 +116,7 @@ class WeightedThreadPool return fMaxThreadWeight; } - /** @brief register a functor to be called when a new thread - * is created - */ - void setThreadCreatedListener(const Functor_T& f); - - /** @brief queue size accessor + /** @brief queue size accessor * */ inline uint32_t getWaiting() const diff --git a/utils/udfsdk/allnull.cpp b/utils/udfsdk/allnull.cpp index 1de4124d4..a7a620cd9 100644 --- a/utils/udfsdk/allnull.cpp +++ b/utils/udfsdk/allnull.cpp @@ -26,7 +26,7 @@ struct allnull_data }; #define OUT_TYPE int64_t -mcsv1_UDAF::ReturnCode allnull::init(mcsv1Context* context, ColumnDatum* colTypes) +mcsv1_UDAF::ReturnCode allnull::init(mcsv1Context* context, ColumnDatum* /*colTypes*/) { context->setUserDataSize(sizeof(allnull_data)); @@ -51,7 +51,7 @@ mcsv1_UDAF::ReturnCode allnull::reset(mcsv1Context* context) return mcsv1_UDAF::SUCCESS; } -mcsv1_UDAF::ReturnCode allnull::nextValue(mcsv1Context* context, ColumnDatum* valsIn) +mcsv1_UDAF::ReturnCode allnull::nextValue(mcsv1Context* context, ColumnDatum* /*valsIn*/) { struct allnull_data* data = (struct allnull_data*)context->getUserData()->data; diff --git a/utils/udfsdk/distinct_count.cpp b/utils/udfsdk/distinct_count.cpp index 0cf57c0cf..3241ed962 100644 --- a/utils/udfsdk/distinct_count.cpp +++ b/utils/udfsdk/distinct_count.cpp @@ -26,7 +26,7 @@ struct distinct_count_data }; #define OUT_TYPE int64_t -mcsv1_UDAF::ReturnCode distinct_count::init(mcsv1Context* context, ColumnDatum* colTypes) +mcsv1_UDAF::ReturnCode distinct_count::init(mcsv1Context* context, ColumnDatum* /*colTypes*/) { context->setUserDataSize(sizeof(distinct_count_data)); if (context->getParameterCount() != 1) diff --git a/utils/udfsdk/mcsv1_udaf.h b/utils/udfsdk/mcsv1_udaf.h index ea949b71e..53901267d 100644 --- a/utils/udfsdk/mcsv1_udaf.h +++ b/utils/udfsdk/mcsv1_udaf.h @@ -601,7 +601,10 @@ class mcsv1_UDAF * dropValue() will not be called for unbounded/current row type * frames, as those are already optimized. */ - virtual ReturnCode dropValue(mcsv1Context* context, ColumnDatum* valsDropped); + virtual ReturnCode dropValue(mcsv1Context* /*context*/, ColumnDatum* /*valsDropped*/) + { + return NOT_IMPLEMENTED; + } /** * createUserData() @@ -623,7 +626,7 @@ class mcsv1_UDAF * create. * */ - virtual ReturnCode createUserData(UserData*& userdata, int32_t& length); + virtual ReturnCode createUserData(UserData*& userData, int32_t& length); protected: double toDouble(ColumnDatum& datum) const @@ -998,11 +1001,6 @@ inline uint32_t mcsv1Context::getCharsetNumber() return fCharsetNumber; } -inline mcsv1_UDAF::ReturnCode mcsv1_UDAF::dropValue(mcsv1Context* context, ColumnDatum* valsDropped) -{ - return NOT_IMPLEMENTED; -} - inline mcsv1_UDAF::ReturnCode mcsv1_UDAF::createUserData(UserData*& userData, int32_t& length) { userData = new UserData(length); diff --git a/utils/udfsdk/udfmysql.cpp b/utils/udfsdk/udfmysql.cpp index 5b25170c9..add530688 100644 --- a/utils/udfsdk/udfmysql.cpp +++ b/utils/udfsdk/udfmysql.cpp @@ -55,7 +55,7 @@ extern "C" /** * MCS_ADD connector stub */ - my_bool mcs_add_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool mcs_add_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 2) { @@ -66,11 +66,11 @@ extern "C" return 0; } - void mcs_add_deinit(UDF_INIT* initid) + void mcs_add_deinit(UDF_INIT* /*initid*/) { } - double mcs_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + double mcs_add(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*is_null*/, char* /*error*/) { double op1, op2; @@ -84,7 +84,7 @@ extern "C" * MCS_ISNULL connector stub */ - my_bool mcs_isnull_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool mcs_isnull_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -95,11 +95,11 @@ extern "C" return 0; } - void mcs_isnull_deinit(UDF_INIT* initid) + void mcs_isnull_deinit(UDF_INIT* /*initid*/) { } - long long mcs_isnull(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) + long long mcs_isnull(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/) { return 0; } @@ -113,7 +113,7 @@ extern "C" ulonglong totalNulls; }; - my_bool allnull_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool allnull_init(UDF_INIT* initid, UDF_ARGS* /*args*/, char* message) { struct allnull_data* data; // if (args->arg_count != 1) @@ -136,27 +136,25 @@ extern "C" return 0; } - void allnull_deinit(UDF_INIT* initid) + void allnull_deinit(UDF_INIT* initid) { free(initid->ptr); } - long long allnull(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + long long allnull(UDF_INIT* initid, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/) { struct allnull_data* data = (struct allnull_data*)initid->ptr; return data->totalQuantity > 0 && data->totalNulls == data->totalQuantity; } - void allnull_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void allnull_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct allnull_data* data = (struct allnull_data*)initid->ptr; data->totalQuantity = 0; data->totalNulls = 0; } - void allnull_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) + void allnull_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { struct allnull_data* data = (struct allnull_data*)initid->ptr; const char* word = args->args[0]; @@ -176,7 +174,7 @@ extern "C" double sumsq; }; - my_bool ssq_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool ssq_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct ssq_data* data; @@ -198,27 +196,25 @@ extern "C" return 0; } - void ssq_deinit(UDF_INIT* initid) + void ssq_deinit(UDF_INIT* initid) { free(initid->ptr); } - void ssq_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void ssq_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct ssq_data* data = (struct ssq_data*)initid->ptr; data->sumsq = 0; } - void ssq_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) + void ssq_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { struct ssq_data* data = (struct ssq_data*)initid->ptr; double val = cvtArgToDouble(args->arg_type[0], args->args[0]); data->sumsq = val * val; } - long long ssq(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + long long ssq(UDF_INIT* initid, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/) { struct ssq_data* data = (struct ssq_data*)initid->ptr; return data->sumsq; @@ -229,7 +225,7 @@ extern "C" /** * MEDIAN connector stub */ - my_bool median_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool median_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -250,27 +246,25 @@ extern "C" return 0; } - void median_deinit(UDF_INIT* initid) + void median_deinit(UDF_INIT* /*initid*/) { // free(initid->ptr); } - void median_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void median_clear(UDF_INIT* /*initid*/, char* /*is_null*/, char* /*message*/) { // struct ssq_data* data = (struct ssq_data*)initid->ptr; // data->sumsq = 0; } - void median_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) + void median_add(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*message*/) { // struct ssq_data* data = (struct ssq_data*)initid->ptr; // double val = cvtArgToDouble(args->arg_type[0], args->args[0]); // data->sumsq = val*val; } - long long median(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + long long median(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/) { // struct ssq_data* data = (struct ssq_data*)initid->ptr; // return data->sumsq; @@ -280,7 +274,7 @@ extern "C" /** * avg_mode connector stub */ - my_bool avg_mode_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool avg_mode_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -301,28 +295,25 @@ extern "C" return 0; } - void avg_mode_deinit(UDF_INIT* initid) + void avg_mode_deinit(UDF_INIT* /*initid*/) { // free(initid->ptr); } - void avg_mode_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void avg_mode_clear(UDF_INIT* /*initid*/, char* /*is_null*/, char* /*message*/) { // struct ssq_data* data = (struct ssq_data*)initid->ptr; // data->sumsq = 0; } - void avg_mode_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, - char* message __attribute__((unused))) + void avg_mode_add(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*message*/) { // struct ssq_data* data = (struct ssq_data*)initid->ptr; // double val = cvtArgToDouble(args->arg_type[0], args->args[0]); // data->sumsq = val*val; } - long long avg_mode(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + long long avg_mode(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/) { // struct ssq_data* data = (struct ssq_data*)initid->ptr; // return data->sumsq; @@ -342,7 +333,7 @@ extern "C" int64_t cnt; }; - my_bool avgx_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool avgx_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct avgx_data* data; if (args->arg_count != 1) @@ -363,20 +354,19 @@ extern "C" return 0; } - void avgx_deinit(UDF_INIT* initid) + void avgx_deinit(UDF_INIT* initid) { free(initid->ptr); } - void avgx_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void avgx_clear(UDF_INIT* initid, char* /*is_null*/, char* /*message*/) { struct avgx_data* data = (struct avgx_data*)initid->ptr; data->sumx = 0; data->cnt = 0; } - void avgx_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) + void avgx_add(UDF_INIT* initid, UDF_ARGS* args, char* /*is_null*/, char* /*message*/) { // TODO test for NULL in x and y struct avgx_data* data = (struct avgx_data*)initid->ptr; @@ -385,17 +375,16 @@ extern "C" data->sumx += xval; } - long long avgx(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + long long avgx(UDF_INIT* initid, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/) { struct avgx_data* data = (struct avgx_data*)initid->ptr; return data->sumx / data->cnt; } -/** - * distinct_count connector stub - */ - my_bool distinct_count_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + /** + * distinct_count connector stub + */ + my_bool distinct_count_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message) { if (args->arg_count != 1) { @@ -406,23 +395,20 @@ extern "C" return 0; } - void distinct_count_deinit(UDF_INIT* initid) + void distinct_count_deinit(UDF_INIT* /*initid*/) { // free(initid->ptr); } - void distinct_count_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), - char* message __attribute__((unused))) + void distinct_count_clear(UDF_INIT* /*initid*/, char* /*is_null*/, char* /*message*/) { } - void distinct_count_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, - char* message __attribute__((unused))) + void distinct_count_add(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*message*/) { } - long long distinct_count(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, - char* error __attribute__((unused))) + long long distinct_count(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/) { return 0; } diff --git a/utils/udfsdk/udfsdk.cpp b/utils/udfsdk/udfsdk.cpp index dc5e4fa86..dc23837d3 100644 --- a/utils/udfsdk/udfsdk.cpp +++ b/utils/udfsdk/udfsdk.cpp @@ -78,7 +78,7 @@ FuncMap UDFSDK::UDFMap() const * OperationType() definition */ CalpontSystemCatalog::ColType MCS_add::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type of MCS_add is determined by the argument types assert(fp.size() == 2); @@ -242,8 +242,8 @@ IDB_Decimal MCS_add::getDecimalVal(Row& row, FunctionParm& parm, bool& isNull, * either not implement this API and an MCS5001 error will be thrown, * or throw a customized exception here. */ -int32_t MCS_add::getDateIntVal(Row& row, FunctionParm& parm, bool& isNull, - CalpontSystemCatalog::ColType& op_ct) +int32_t MCS_add::getDateIntVal(Row& /*row*/, FunctionParm& /*parm*/, bool& /*isNull*/, + CalpontSystemCatalog::ColType& /*op_ct*/) { throw logic_error("Invalid API called for MCS_ADD"); } @@ -260,7 +260,7 @@ int64_t MCS_add::getDatetimeIntVal(Row& row, FunctionParm& parm, bool& isNull, return (int64_t)getDoubleVal(row, parm, isNull, op_ct); } -bool MCS_add::getBoolVal(Row& row, FunctionParm& parm, bool& isNull, CalpontSystemCatalog::ColType& op_ct) +bool MCS_add::getBoolVal(Row& /*row*/, FunctionParm& /*parm*/, bool& /*isNull*/, CalpontSystemCatalog::ColType& /*op_ct*/) { return false; } @@ -271,7 +271,7 @@ bool MCS_add::getBoolVal(Row& row, FunctionParm& parm, bool& isNull, CalpontSyst * OperationType() definition */ CalpontSystemCatalog::ColType MCS_isnull::operationType(FunctionParm& fp, - CalpontSystemCatalog::ColType& resultType) + CalpontSystemCatalog::ColType& /*resultType*/) { // operation type of MCS_isnull should be the same as the argument type assert(fp.size() == 1); diff --git a/utils/windowfunction/framebound.cpp b/utils/windowfunction/framebound.cpp index d41c380f9..697bb7873 100644 --- a/utils/windowfunction/framebound.cpp +++ b/utils/windowfunction/framebound.cpp @@ -29,7 +29,7 @@ using namespace ordering; namespace windowfunction { -int64_t FrameBound::getBound(int64_t b, int64_t e, int64_t c) +int64_t FrameBound::getBound(int64_t b, int64_t e, int64_t /*c*/) { if (fBoundType == WF__UNBOUNDED_PRECEDING) return b; diff --git a/utils/windowfunction/frameboundrange.cpp b/utils/windowfunction/frameboundrange.cpp index 694ee6a10..25fd1542e 100644 --- a/utils/windowfunction/frameboundrange.cpp +++ b/utils/windowfunction/frameboundrange.cpp @@ -193,7 +193,7 @@ void FrameBoundConstantRange::getValue(ValueType& v, int64_t i) } template -T FrameBoundConstantRange::getValueByType(int64_t i) +T FrameBoundConstantRange::getValueByType(int64_t /*i*/) { T t; return t; diff --git a/utils/windowfunction/frameboundrow.cpp b/utils/windowfunction/frameboundrow.cpp index b157a6b5b..4cadb8471 100644 --- a/utils/windowfunction/frameboundrow.cpp +++ b/utils/windowfunction/frameboundrow.cpp @@ -34,7 +34,7 @@ using namespace ordering; namespace windowfunction { -int64_t FrameBoundRow::getBound(int64_t b, int64_t e, int64_t c) +int64_t FrameBoundRow::getBound(int64_t /*b*/, int64_t /*e*/, int64_t c) { return c; } diff --git a/utils/windowfunction/idborderby.h b/utils/windowfunction/idborderby.h index 03b314289..b67cf1fed 100644 --- a/utils/windowfunction/idborderby.h +++ b/utils/windowfunction/idborderby.h @@ -171,10 +171,8 @@ class BigIntCompare : public Compare class WideDecimalCompare : public Compare { - int keyColumnOffset; - public: - WideDecimalCompare(const IdbSortSpec& spec, int offset) : Compare(spec), keyColumnOffset(offset) + WideDecimalCompare(const IdbSortSpec& spec, int /*offset*/) : Compare(spec) { } diff --git a/utils/windowfunction/wf_lead_lag.cpp b/utils/windowfunction/wf_lead_lag.cpp index d0e886e54..ce61d20eb 100644 --- a/utils/windowfunction/wf_lead_lag.cpp +++ b/utils/windowfunction/wf_lead_lag.cpp @@ -184,7 +184,7 @@ void WF_lead_lag::parseParms(const std::vector& parms) } template -void WF_lead_lag::operator()(int64_t b, int64_t e, int64_t c) +void WF_lead_lag::operator()(int64_t b, int64_t e, int64_t /*c*/) { uint64_t colIn = fFieldIndex[1]; bool isNull = true; diff --git a/utils/windowfunction/wf_ranking.cpp b/utils/windowfunction/wf_ranking.cpp index 0dce1399a..afb45edc5 100644 --- a/utils/windowfunction/wf_ranking.cpp +++ b/utils/windowfunction/wf_ranking.cpp @@ -39,8 +39,8 @@ using namespace joblist; namespace windowfunction { -boost::shared_ptr WF_ranking::makeFunction(int id, const string& name, int ct, - WindowFunctionColumn* wc) +boost::shared_ptr WF_ranking::makeFunction(int id, const string& name, int /*ct*/, + WindowFunctionColumn* /*wc*/) { boost::shared_ptr func(new WF_ranking(id, name)); return func; diff --git a/utils/windowfunction/wf_sum_avg.cpp b/utils/windowfunction/wf_sum_avg.cpp index 573b6e097..8fa755020 100644 --- a/utils/windowfunction/wf_sum_avg.cpp +++ b/utils/windowfunction/wf_sum_avg.cpp @@ -51,7 +51,7 @@ using namespace joblist; namespace windowfunction { template -inline void WF_sum_avg::checkSumLimit(const T_IN& val, const T_OUT& sum) +inline void WF_sum_avg::checkSumLimit(const T_IN& /*val*/, const T_OUT& /*sum*/) { } @@ -63,8 +63,8 @@ inline void WF_sum_avg::checkSumLimit(const int128_t& val, c } template <> -inline void WF_sum_avg::checkSumLimit(const long double& val, - const long double& sum) +inline void WF_sum_avg::checkSumLimit(const long double& /*val*/, + const long double& /*sum*/) { } @@ -138,7 +138,7 @@ int128_t WF_sum_avg::calculateAvg(const int128_t& sum, const uint64 template inline long double WF_sum_avg::calculateAvg(const long double& sum, const uint64_t count, - const int scale) + const int /*scale*/) { return sum / count; } diff --git a/utils/windowfunction/wf_udaf.cpp b/utils/windowfunction/wf_udaf.cpp index 6d1fafcdb..c4b5002f0 100644 --- a/utils/windowfunction/wf_udaf.cpp +++ b/utils/windowfunction/wf_udaf.cpp @@ -53,9 +53,9 @@ using namespace joblist; namespace windowfunction { -boost::shared_ptr WF_udaf::makeFunction(int id, const string& name, int ct, +boost::shared_ptr WF_udaf::makeFunction(int id, const string& name, int /*ct*/, mcsv1sdk::mcsv1Context& context, - WindowFunctionColumn* wc) + WindowFunctionColumn* /*wc*/) { boost::shared_ptr func; diff --git a/utils/windowfunction/windowfunctiontype.cpp b/utils/windowfunction/windowfunctiontype.cpp index d14b7074e..be9319306 100644 --- a/utils/windowfunction/windowfunctiontype.cpp +++ b/utils/windowfunction/windowfunctiontype.cpp @@ -237,7 +237,7 @@ const string WindowFunctionType::toString() const } template -void WindowFunctionType::getValue(uint64_t i, T& t, CDT* cdt) +void WindowFunctionType::getValue(uint64_t /*i*/, T& /*t*/, CDT* /*cdt*/) { } @@ -297,7 +297,7 @@ void WindowFunctionType::getValue(uint64_t i, long double& t, CDT* } template <> -void WindowFunctionType::getValue(uint64_t i, utils::NullString& t, CDT* cdt) +void WindowFunctionType::getValue(uint64_t i, utils::NullString& t, CDT* /*cdt*/) { t = fRow.getStringField(i); // By not setting cdt, we let it default to the column's type @@ -315,7 +315,7 @@ void WindowFunctionType::getValue(uint64_t i, int128_t& t, CDT* cdt) } template -void WindowFunctionType::setValue(uint64_t i, T& t) +void WindowFunctionType::setValue(uint64_t /*i*/, T& /*t*/) { } @@ -579,7 +579,7 @@ void WindowFunctionType::implicit2T(uint64_t i, utils::NullSt } template -void WindowFunctionType::getConstValue(ConstantColumn* cc, T& t, bool& b) +void WindowFunctionType::getConstValue(ConstantColumn* /*cc*/, T& /*t*/, bool& /*b*/) { } diff --git a/versioning/BRM/blockresolutionmanager.cpp b/versioning/BRM/blockresolutionmanager.cpp index b1706cb35..d0e2443e3 100644 --- a/versioning/BRM/blockresolutionmanager.cpp +++ b/versioning/BRM/blockresolutionmanager.cpp @@ -61,20 +61,10 @@ BlockResolutionManager::BlockResolutionManager(bool ronly) throw() } } -BlockResolutionManager::BlockResolutionManager(const BlockResolutionManager& brm) -{ - throw logic_error("BRM: Don't use the copy constructor."); -} - BlockResolutionManager::~BlockResolutionManager() throw() { } -BlockResolutionManager& BlockResolutionManager::operator=(const BlockResolutionManager& brm) -{ - throw logic_error("BRM: Don't use the = operator."); -} - int BlockResolutionManager::loadExtentMap(const string& filename, bool fixFL) { em.load(filename, fixFL); diff --git a/versioning/BRM/blockresolutionmanager.h b/versioning/BRM/blockresolutionmanager.h index a098acdba..9b8c7b2a1 100644 --- a/versioning/BRM/blockresolutionmanager.h +++ b/versioning/BRM/blockresolutionmanager.h @@ -107,8 +107,9 @@ class BlockResolutionManager EXPORT int saveState(std::string filename) throw(); private: - explicit BlockResolutionManager(const BlockResolutionManager& brm); - BlockResolutionManager& operator=(const BlockResolutionManager& brm); + explicit BlockResolutionManager(const BlockResolutionManager&) = delete; + BlockResolutionManager& operator=(const BlockResolutionManager&) = delete; + MasterSegmentTable mst; ExtentMap em; VBBM vbbm; diff --git a/versioning/BRM/brmshmimpl.cpp b/versioning/BRM/brmshmimpl.cpp index f901be3fc..8935e0fa2 100644 --- a/versioning/BRM/brmshmimpl.cpp +++ b/versioning/BRM/brmshmimpl.cpp @@ -343,7 +343,7 @@ int BRMManagedShmImpl::grow(off_t newSize) } // Dummy method that has no references in the code. -int BRMManagedShmImpl::clear(unsigned newKey, off_t newSize) +int BRMManagedShmImpl::clear(unsigned /*newKey*/, off_t /*newSize*/) { return 0; } @@ -471,7 +471,7 @@ int32_t BRMManagedShmImplRBTree::grow(unsigned key, off_t incSize) } // Dummy method that has no references in the code. -int BRMManagedShmImplRBTree::clear(unsigned newKey, off_t newSize) +int BRMManagedShmImplRBTree::clear(unsigned /*newKey*/, off_t /*newSize*/) { return 0; } diff --git a/versioning/BRM/dbrm.cpp b/versioning/BRM/dbrm.cpp index 82d3eeba4..6ea254723 100644 --- a/versioning/BRM/dbrm.cpp +++ b/versioning/BRM/dbrm.cpp @@ -95,22 +95,12 @@ DBRM::DBRM(bool noBRMinit) : fDebug(false) #endif } -DBRM::DBRM(const DBRM& brm) -{ - throw logic_error("DBRM: Don't use the copy constructor."); -} - DBRM::~DBRM() { if (msgClient != NULL) MessageQueueClientPool::releaseInstance(msgClient); } -DBRM& DBRM::operator=(const DBRM& brm) -{ - throw logic_error("DBRM: Don't use the = operator."); -} - int DBRM::saveState() throw() { #ifdef BRM_INFO diff --git a/versioning/BRM/dbrm.h b/versioning/BRM/dbrm.h index ed2298ca6..dbabf8546 100644 --- a/versioning/BRM/dbrm.h +++ b/versioning/BRM/dbrm.h @@ -1000,8 +1000,8 @@ class DBRM size_t EMIndexShmemFree(); private: - DBRM(const DBRM& brm); - DBRM& operator=(const DBRM& brm); + DBRM(const DBRM& brm) = delete; + DBRM& operator=(const DBRM& brm) = delete; int8_t send_recv(const messageqcpp::ByteStream& in, messageqcpp::ByteStream& out) throw(); void deleteAISequence(uint32_t OID); // called as part of deleteOID & deleteOIDs @@ -1015,7 +1015,7 @@ class DBRM std::string masterName; boost::mutex mutex; config::Config* config; - bool fDebug; + [[maybe_unused]]bool fDebug; }; } // namespace BRM diff --git a/versioning/BRM/extentmap.cpp b/versioning/BRM/extentmap.cpp index 7e842f482..ac584b776 100644 --- a/versioning/BRM/extentmap.cpp +++ b/versioning/BRM/extentmap.cpp @@ -812,7 +812,7 @@ int ExtentMap::markInvalid(const vector& lbids, // TODO MCOL-641 Not adding support here since this function appears to be unused anywhere. int ExtentMap::setMaxMin(const LBID_t lbid, const int64_t max, const int64_t min, const int32_t seqNum, - bool firstNode) + bool /*firstNode*/) { #ifdef BRM_INFO @@ -884,7 +884,7 @@ int ExtentMap::setMaxMin(const LBID_t lbid, const int64_t max, const int64_t min // @bug 1970. Added updateExtentsMaxMin function. // @note - The key passed in the map must the the first LBID in the extent. -void ExtentMap::setExtentsMaxMin(const CPMaxMinMap_t& cpMap, bool firstNode, bool useLock) +void ExtentMap::setExtentsMaxMin(const CPMaxMinMap_t& cpMap, bool /*firstNode*/, bool useLock) { CPMaxMinMap_t::const_iterator it; @@ -1580,7 +1580,6 @@ void ExtentMap::loadVersion4or5(T* in, bool upgradeV4ToV5) cout << "Expected EM entries:" << emNumElements << endl; cout << "Expected free list entries:" << flNumElements << endl; - if (nbytes != (2 * sizeof(uint32_t))) { log_errno("ExtentMap::loadVersion4or5(): read "); @@ -1700,7 +1699,7 @@ void ExtentMap::loadVersion4or5(T* in, bool upgradeV4ToV5) fEMRBTreeShminfo->currentSize = (emNumElements * EM_RB_TREE_NODE_SIZE) + EM_RB_TREE_EMPTY_SIZE; } -void ExtentMap::load(const string& filename, bool fixFL) +void ExtentMap::load(const string& filename, bool /*fixFL*/) { #ifdef BRM_INFO @@ -4783,8 +4782,8 @@ HWM_t ExtentMap::getLocalHWM(int OID, uint32_t partitionNum, uint16_t segmentNum // (per segment file). // Used for dictionary or column OIDs to set the HWM for specific segment file. //------------------------------------------------------------------------------ -void ExtentMap::setLocalHWM(int OID, uint32_t partitionNum, uint16_t segmentNum, HWM_t newHWM, bool firstNode, - bool uselock) +void ExtentMap::setLocalHWM(int OID, uint32_t partitionNum, uint16_t segmentNum, HWM_t newHWM, + bool /*firstNode*/, bool uselock) { #ifdef BRM_INFO @@ -4945,7 +4944,7 @@ void ExtentMap::bulkUpdateDBRoot(const vector& args) } } -void ExtentMap::getExtents(int OID, vector& entries, bool sorted, bool notFoundErr, +void ExtentMap::getExtents(int OID, vector& entries, bool sorted, bool /*notFoundErr*/, bool incOutOfService) { #ifdef BRM_INFO diff --git a/versioning/BRM/lbidresourcegraph.cpp b/versioning/BRM/lbidresourcegraph.cpp index f5775d63a..20276d064 100644 --- a/versioning/BRM/lbidresourcegraph.cpp +++ b/versioning/BRM/lbidresourcegraph.cpp @@ -35,11 +35,6 @@ LBIDResourceGraph::LBIDResourceGraph() : color(0) { } -LBIDResourceGraph::LBIDResourceGraph(const LBIDResourceGraph& r) -{ - throw logic_error("Don't do that"); -} - LBIDResourceGraph::~LBIDResourceGraph() { std::map::iterator tnit; @@ -69,12 +64,6 @@ LBIDResourceGraph::~LBIDResourceGraph() resources.erase(rit++); } } - -LBIDResourceGraph& LBIDResourceGraph::operator=(const LBIDResourceGraph& r) -{ - throw logic_error("Don't do that"); -} - void LBIDResourceGraph::connectResources(LBID_t start, LBID_t end, TransactionNode* txnNode) { vector intersection, reserveList; diff --git a/versioning/BRM/lbidresourcegraph.h b/versioning/BRM/lbidresourcegraph.h index 1b54b36be..7d3d2d5cc 100644 --- a/versioning/BRM/lbidresourcegraph.h +++ b/versioning/BRM/lbidresourcegraph.h @@ -58,8 +58,8 @@ class LBIDResourceGraph private: uint64_t color; - LBIDResourceGraph(const LBIDResourceGraph&); - LBIDResourceGraph& operator=(const LBIDResourceGraph&); + LBIDResourceGraph(const LBIDResourceGraph&) = delete; + LBIDResourceGraph& operator=(const LBIDResourceGraph&) = delete; void connectResources(LBID_t start, LBID_t end, TransactionNode* txnNode); bool checkDeadlock(TransactionNode&); diff --git a/versioning/BRM/masterdbrmnode.cpp b/versioning/BRM/masterdbrmnode.cpp index 08b24a4ae..4f2a32bbd 100644 --- a/versioning/BRM/masterdbrmnode.cpp +++ b/versioning/BRM/masterdbrmnode.cpp @@ -115,16 +115,6 @@ MasterDBRMNode::~MasterDBRMNode() finalCleanup(); } -MasterDBRMNode::MasterDBRMNode(const MasterDBRMNode& m) -{ - throw logic_error("Don't use the MasterDBRMNode copy constructor"); -} - -MasterDBRMNode& MasterDBRMNode::operator=(const MasterDBRMNode& m) -{ - throw logic_error("Don't use the MasterDBRMNode = operator"); -} - void MasterDBRMNode::initMsgQueues(config::Config* config) { std::string methodName("MasterDBRMNode::initMsgQueues()"); @@ -1307,7 +1297,7 @@ void MasterDBRMNode::doReload(messageqcpp::IOSocket* sock) } } -void MasterDBRMNode::doVerID(ByteStream& msg, ThreadParams* p) +void MasterDBRMNode::doVerID(ByteStream& /*msg*/, ThreadParams* p) { ByteStream reply; QueryContext context; @@ -1329,7 +1319,7 @@ void MasterDBRMNode::doVerID(ByteStream& msg, ThreadParams* p) } } -void MasterDBRMNode::doGetSystemCatalog(ByteStream& msg, ThreadParams* p) +void MasterDBRMNode::doGetSystemCatalog(ByteStream& /*msg*/, ThreadParams* p) { ByteStream reply; @@ -1403,7 +1393,7 @@ void MasterDBRMNode::doGetSystemCatalog(ByteStream& msg, ThreadParams* p) } } -void MasterDBRMNode::doSysCatVerID(ByteStream& msg, ThreadParams* p) +void MasterDBRMNode::doSysCatVerID(ByteStream& /*msg*/, ThreadParams* p) { ByteStream reply; QueryContext context; @@ -1708,7 +1698,7 @@ void MasterDBRMNode::doGetTxnID(ByteStream& msg, ThreadParams* p) } } -void MasterDBRMNode::doSIDTIDMap(ByteStream& msg, ThreadParams* p) +void MasterDBRMNode::doSIDTIDMap(ByteStream& /*msg*/, ThreadParams* p) { ByteStream reply; int len, i; @@ -1885,7 +1875,7 @@ void MasterDBRMNode::doGetUncommittedLbids(ByteStream& msg, ThreadParams* p) } } -void MasterDBRMNode::doGetUniqueUint32(ByteStream& msg, ThreadParams* p) +void MasterDBRMNode::doGetUniqueUint32(ByteStream& /*msg*/, ThreadParams* p) { ByteStream reply; uint32_t ret; @@ -1924,7 +1914,7 @@ void MasterDBRMNode::doGetUniqueUint32(ByteStream& msg, ThreadParams* p) } } -void MasterDBRMNode::doGetUniqueUint64(ByteStream& msg, ThreadParams* p) +void MasterDBRMNode::doGetUniqueUint64(ByteStream& /*msg*/, ThreadParams* p) { ByteStream reply; uint64_t ret; @@ -1963,7 +1953,7 @@ void MasterDBRMNode::doGetUniqueUint64(ByteStream& msg, ThreadParams* p) } } -void MasterDBRMNode::doGetSystemState(ByteStream& msg, ThreadParams* p) +void MasterDBRMNode::doGetSystemState(ByteStream& /*msg*/, ThreadParams* p) { ByteStream reply; uint32_t ss = 0; @@ -2092,7 +2082,7 @@ void MasterDBRMNode::doClearSystemState(ByteStream& msg, ThreadParams* p) } } -void MasterDBRMNode::doSessionManagerReset(ByteStream& msg, ThreadParams* p) +void MasterDBRMNode::doSessionManagerReset(ByteStream& /*msg*/, ThreadParams* p) { ByteStream reply; @@ -2191,7 +2181,7 @@ void MasterDBRMNode::doReturnOIDs(ByteStream& msg, ThreadParams* p) } } -void MasterDBRMNode::doOidmSize(ByteStream& msg, ThreadParams* p) +void MasterDBRMNode::doOidmSize(ByteStream& /*msg*/, ThreadParams* p) { ByteStream reply; int ret; diff --git a/versioning/BRM/masterdbrmnode.h b/versioning/BRM/masterdbrmnode.h index 50dd13131..a29e60c56 100644 --- a/versioning/BRM/masterdbrmnode.h +++ b/versioning/BRM/masterdbrmnode.h @@ -165,8 +165,8 @@ class MasterDBRMNode boost::thread* t; }; - MasterDBRMNode(const MasterDBRMNode& m); - MasterDBRMNode& operator=(const MasterDBRMNode& m); + MasterDBRMNode(const MasterDBRMNode& m) = delete; + MasterDBRMNode& operator=(const MasterDBRMNode& m) = delete; void initMsgQueues(config::Config* config); void msgProcessor(); diff --git a/versioning/BRM/masternode.cpp b/versioning/BRM/masternode.cpp index af5929757..8d46bb376 100644 --- a/versioning/BRM/masternode.cpp +++ b/versioning/BRM/masternode.cpp @@ -83,7 +83,7 @@ class ServiceControllerNode : public Service, public Opt } }; -void stop(int num) +void stop(int /*num*/) { #ifdef BRM_VERBOSE std::cerr << "stopping..." << std::endl; @@ -94,7 +94,7 @@ void stop(int num) m->stop(); } -void restart(int num) +void restart(int /*num*/) { #ifdef BRM_VERBOSE std::cerr << "stopping this instance..." << std::endl; diff --git a/versioning/BRM/oidserver.cpp b/versioning/BRM/oidserver.cpp index 408e2a356..567116c0b 100644 --- a/versioning/BRM/oidserver.cpp +++ b/versioning/BRM/oidserver.cpp @@ -722,7 +722,9 @@ int OIDServer::allocOIDs(int num) return bestMatchBegin; } -void OIDServer::returnOIDs(int start, int end) const + +// FIXME: Not implemented +void OIDServer::returnOIDs(int /*start*/, int /*end*/) const { //@Bug 1412. Do not reuse oids for now. /* struct FEntry freelist[FreeListEntries]; diff --git a/versioning/BRM/slavedbrmnode.cpp b/versioning/BRM/slavedbrmnode.cpp index 4316df8c0..5edcfb57f 100644 --- a/versioning/BRM/slavedbrmnode.cpp +++ b/versioning/BRM/slavedbrmnode.cpp @@ -57,20 +57,10 @@ SlaveDBRMNode::SlaveDBRMNode() throw() locked[2] = false; } -SlaveDBRMNode::SlaveDBRMNode(const SlaveDBRMNode& brm) -{ - throw logic_error("WorkerDBRMNode: Don't use the copy constructor."); -} - SlaveDBRMNode::~SlaveDBRMNode() throw() { } -SlaveDBRMNode& SlaveDBRMNode::operator=(const SlaveDBRMNode& brm) -{ - throw logic_error("WorkerDBRMNode: Don't use the = operator."); -} - int SlaveDBRMNode::lookup(OID_t oid, LBIDRange_v& lbidList) throw() { try @@ -713,7 +703,7 @@ int SlaveDBRMNode::beginVBCopy(VER_t transID, uint16_t vbOID, const LBIDRange_v& } } -int SlaveDBRMNode::endVBCopy(VER_t transID, const LBIDRange_v& ranges) throw() +int SlaveDBRMNode::endVBCopy(VER_t /*transID*/, const LBIDRange_v& ranges) throw() { LBIDRange_v::const_iterator it; diff --git a/versioning/BRM/slavedbrmnode.h b/versioning/BRM/slavedbrmnode.h index d1dee6cf5..59881e43a 100644 --- a/versioning/BRM/slavedbrmnode.h +++ b/versioning/BRM/slavedbrmnode.h @@ -462,8 +462,8 @@ class SlaveDBRMNode EXPORT const std::atomic* getVSSLockStatus(); private: - explicit SlaveDBRMNode(const SlaveDBRMNode& brm); - SlaveDBRMNode& operator=(const SlaveDBRMNode& brm); + explicit SlaveDBRMNode(const SlaveDBRMNode& brm) = delete; + SlaveDBRMNode& operator=(const SlaveDBRMNode& brm) = delete; int lookup(OID_t oid, LBIDRange_v& lbidList) throw(); MasterSegmentTable mst; diff --git a/versioning/BRM/slavenode.cpp b/versioning/BRM/slavenode.cpp index 2e116c959..670636586 100644 --- a/versioning/BRM/slavenode.cpp +++ b/versioning/BRM/slavenode.cpp @@ -84,7 +84,7 @@ class ServiceWorkerNode : public Service, public Opt } }; -void stop(int sig) +void stop(int /*sig*/) { if (!die) { @@ -94,7 +94,7 @@ void stop(int sig) } } -void reset(int sig) +void reset(int /*sig*/) { comm->reset(); } @@ -140,10 +140,14 @@ int ServiceWorkerNode::Child() } /* Start 4 threads to monitor write lock state */ - monitorThreads.create_thread(RWLockMonitor(&die, comm->getSlaveNode().getEMFLLockStatus(), keys.KEYRANGE_EMFREELIST_BASE)); - monitorThreads.create_thread(RWLockMonitor(&die, comm->getSlaveNode().getEMLockStatus(), keys.KEYRANGE_EXTENTMAP_BASE)); - monitorThreads.create_thread(RWLockMonitor(&die, comm->getSlaveNode().getVBBMLockStatus(), keys.KEYRANGE_VBBM_BASE)); - monitorThreads.create_thread(RWLockMonitor(&die, comm->getSlaveNode().getVSSLockStatus(), keys.KEYRANGE_VSS_BASE)); + monitorThreads.create_thread( + RWLockMonitor(&die, comm->getSlaveNode().getEMFLLockStatus(), keys.KEYRANGE_EMFREELIST_BASE)); + monitorThreads.create_thread( + RWLockMonitor(&die, comm->getSlaveNode().getEMLockStatus(), keys.KEYRANGE_EXTENTMAP_BASE)); + monitorThreads.create_thread( + RWLockMonitor(&die, comm->getSlaveNode().getVBBMLockStatus(), keys.KEYRANGE_VBBM_BASE)); + monitorThreads.create_thread( + RWLockMonitor(&die, comm->getSlaveNode().getVSSLockStatus(), keys.KEYRANGE_VSS_BASE)); monitorThreads.create_thread( RWLockMonitor(&die, comm->getSlaveNode().getEMIndexLockStatus(), keys.KEYRANGE_EXTENTMAP_INDEX_BASE)); diff --git a/versioning/BRM/vss.cpp b/versioning/BRM/vss.cpp index 0a515e30e..522fc378e 100644 --- a/versioning/BRM/vss.cpp +++ b/versioning/BRM/vss.cpp @@ -1127,7 +1127,7 @@ void VSS::clear() } // read lock -int VSS::checkConsistency(const VBBM& vbbm, ExtentMap& em) const +int VSS::checkConsistency(const VBBM& vbbm, ExtentMap& /*em*/) const { /* 1. Every valid entry in the VSS has an entry either in the VBBM or in the diff --git a/writeengine/bulk/cpimport.cpp b/writeengine/bulk/cpimport.cpp index a4b7a5f54..ddf07a83d 100644 --- a/writeengine/bulk/cpimport.cpp +++ b/writeengine/bulk/cpimport.cpp @@ -125,10 +125,8 @@ void printUsage() cout << " Positional parameters:" << endl << " dbName Name of database to load" << endl << " tblName Name of table to load" << endl - << " loadFile Optional input file name in current directory, " - << "unless a fully" << endl - << " qualified name is given. If not given, " - << "input read from stdin." << endl + << " loadFile Optional input file name in current directory, " << "unless a fully" << endl + << " qualified name is given. If not given, " << "input read from stdin." << endl << endl; cout << " Options:" << endl @@ -158,8 +156,7 @@ void printUsage() << " -w Number of parsers" << endl << " -B I/O library read buffer size (in bytes)" << endl << " -E Enclosed by character if field values are enclosed" << endl - << " -C Escape character used in conjunction with 'enclosed by' " - << "character," << endl + << " -C Escape character used in conjunction with 'enclosed by' " << "character," << endl << " or as part of NULL escape sequence ('\\N'); default is '\\'" << endl << " -I Binary import; binaryOpt 1-import NULL values" << endl << " 2-saturate NULL values" << endl @@ -191,7 +188,7 @@ void printUsage() //------------------------------------------------------------------------------ // Signal handler to catch SIGTERM signal to terminate the process //------------------------------------------------------------------------------ -void handleSigTerm(int i) +void handleSigTerm(int /*i*/) { BRMWrapper::getInstance()->finishCpimportJob(cpimportJobId); std::cout << "Received SIGTERM to terminate the process..." << std::endl; @@ -201,7 +198,7 @@ void handleSigTerm(int i) //------------------------------------------------------------------------------ // Signal handler to catch Control-C signal to terminate the process //------------------------------------------------------------------------------ -void handleControlC(int i) +void handleControlC(int /*i*/) { BRMWrapper::getInstance()->finishCpimportJob(cpimportJobId); if (!BulkLoad::disableConsoleOutput()) @@ -213,7 +210,7 @@ void handleControlC(int i) //------------------------------------------------------------------------------ // Signal handler to catch SIGTERM signal to terminate the process //------------------------------------------------------------------------------ -void handleSigSegv(int i) +void handleSigSegv(int /*i*/) { BRMWrapper::getInstance()->finishCpimportJob(cpimportJobId); std::cout << "Received SIGSEGV to terminate the process..." << std::endl; @@ -223,7 +220,7 @@ void handleSigSegv(int i) //------------------------------------------------------------------------------ // Signal handler to catch SIGTERM signal to terminate the process //------------------------------------------------------------------------------ -void handleSigAbrt(int i) +void handleSigAbrt(int /*i*/) { BRMWrapper::getInstance()->finishCpimportJob(cpimportJobId); std::cout << "Received SIGABRT to terminate the process..." << std::endl; @@ -308,7 +305,6 @@ void setupSignalHandlers() memset(&act, 0, sizeof(act)); act.sa_handler = handleSigAbrt; sigaction(SIGABRT, &act, 0); - } //------------------------------------------------------------------------------ @@ -523,8 +519,7 @@ void parseCmdLineArgs(int argc, char** argv, BulkLoad& curJob, std::string& sJob delim = '\t'; if (!BulkLoad::disableConsoleOutput()) - cout << "Column delimiter : " - << "\\t" << endl; + cout << "Column delimiter : " << "\\t" << endl; } else { @@ -903,15 +898,15 @@ void getTableOID(const std::string& xmlGenSchema, const std::string& xmlGenTable catch (std::exception& ex) { std::ostringstream oss; - oss << "Unable to set default JobID; " - << "Error getting OID for table " << tbl.schema << '.' << tbl.table << ": " << ex.what(); + oss << "Unable to set default JobID; " << "Error getting OID for table " << tbl.schema << '.' << tbl.table + << ": " << ex.what(); startupError(oss.str(), false); } catch (...) { std::ostringstream oss; - oss << "Unable to set default JobID; " - << "Unknown error getting OID for table " << tbl.schema << '.' << tbl.table; + oss << "Unable to set default JobID; " << "Unknown error getting OID for table " << tbl.schema << '.' + << tbl.table; startupError(oss.str(), false); } diff --git a/writeengine/bulk/we_bulkload.cpp b/writeengine/bulk/we_bulkload.cpp index 56aacfafe..98bad9028 100644 --- a/writeengine/bulk/we_bulkload.cpp +++ b/writeengine/bulk/we_bulkload.cpp @@ -902,7 +902,7 @@ int BulkLoad::preProcessAutoInc(const std::string& fullTableName, ColumnInfo* co // NO_ERROR if success // other if fail //------------------------------------------------------------------------------ -int BulkLoad::preProcessHwmLbid(const ColumnInfo* info, int minWidth, uint32_t partition, uint16_t segment, +int BulkLoad::preProcessHwmLbid(const ColumnInfo* info, int /*minWidth*/, uint32_t partition, uint16_t segment, HWM& hwm, // input/output BRM::LBID_t& lbid, // output bool& bSkippedToNewExtent) // output diff --git a/writeengine/bulk/we_colbuf.cpp b/writeengine/bulk/we_colbuf.cpp index bebde6b06..12375b1ec 100644 --- a/writeengine/bulk/we_colbuf.cpp +++ b/writeengine/bulk/we_colbuf.cpp @@ -51,7 +51,7 @@ int ColumnBuffer::finishFile(bool /*bTruncFile*/) return NO_ERROR; } -int ColumnBuffer::resetToBeCompressedColBuf(long long& startFileOffset) +int ColumnBuffer::resetToBeCompressedColBuf(long long& /*startFileOffset*/) { return NO_ERROR; } diff --git a/writeengine/bulk/we_colextinf.h b/writeengine/bulk/we_colextinf.h index cf2de5700..eed8a4844 100644 --- a/writeengine/bulk/we_colextinf.h +++ b/writeengine/bulk/we_colextinf.h @@ -139,27 +139,27 @@ class ColExtInfBase ColExtInfBase() = default; virtual ~ColExtInfBase() = default; - virtual void addFirstEntry(RID lastInputRow, BRM::LBID_t lbid, bool bIsNewExtent) + virtual void addFirstEntry(RID /*lastInputRow*/, BRM::LBID_t /*lbid*/, bool /*bIsNewExtent*/) { } - virtual void addOrUpdateEntry(RID lastInputRow, int64_t minVal, int64_t maxVal, ColDataType colDataType, - int width) + virtual void addOrUpdateEntry(RID /*lastInputRow*/, int64_t /*minVal*/, int64_t /*maxVal*/, ColDataType /*colDataType*/, + int /*width*/) { } - virtual void addOrUpdateEntry(RID lastInputRow, int128_t minVal, int128_t maxVal, ColDataType colDataType, - int width) + virtual void addOrUpdateEntry(RID /*lastInputRow*/, int128_t /*minVal*/, int128_t /*maxVal*/, ColDataType /*colDataType*/, + int /*width*/) { } - virtual void getCPInfoForBRM(JobColumn column, BRMReporter& brmReporter) + virtual void getCPInfoForBRM(JobColumn /*column*/, BRMReporter& /*brmReporter*/) { } - virtual void print(const JobColumn& column) + virtual void print(const JobColumn& /*column*/) { } - virtual int updateEntryLbid(BRM::LBID_t startLbid) + virtual int updateEntryLbid(BRM::LBID_t /*startLbid*/) { return NO_ERROR; } diff --git a/writeengine/bulk/we_colopbulk.cpp b/writeengine/bulk/we_colopbulk.cpp index eb9bc6637..65ad8ad2a 100644 --- a/writeengine/bulk/we_colopbulk.cpp +++ b/writeengine/bulk/we_colopbulk.cpp @@ -63,7 +63,7 @@ ColumnOpBulk::~ColumnOpBulk() // @bug 5572 - HDFS usage: add *.tmp file backup flag IDBDataFile* ColumnOpBulk::openFile(const WriteEngine::Column& column, uint16_t dbRoot, uint32_t partition, uint16_t segment, std::string& segFile, bool useTmpSuffix, - const char* mode, int ioBuffSize, bool isReadOnly) const + const char* mode, int /*ioBuffSize*/, bool /*isReadOnly*/) const { return FileOp::openFile(column.dataFile.fid, dbRoot, partition, segment, segFile, mode, column.colWidth, useTmpSuffix); diff --git a/writeengine/dictionary/we_dctnry.cpp b/writeengine/dictionary/we_dctnry.cpp index a128d21f7..e7d9501eb 100644 --- a/writeengine/dictionary/we_dctnry.cpp +++ b/writeengine/dictionary/we_dctnry.cpp @@ -49,7 +49,7 @@ using namespace BRM; #include "cacheutils.h" using namespace idbdatafile; #include "checks.h" -#include "utils_utf8.h" // for utf8_truncate_point() +#include "utils_utf8.h" // for utf8_truncate_point() namespace { @@ -764,8 +764,7 @@ int Dctnry::insertDctnry2(Signature& sig) * failure - it did not write the header to block ******************************************************************************/ int Dctnry::insertDctnry(const char* buf, ColPosPair** pos, const int totalRow, const int col, char* tokenBuf, - long long& truncCount, const CHARSET_INFO* cs, - const WriteEngine::ColType& weType) + long long& truncCount, const CHARSET_INFO* cs, const WriteEngine::ColType& weType) { #ifdef PROFILE Stats::startParseEvent(WE_STATS_PARSE_DCT); @@ -854,7 +853,7 @@ int Dctnry::insertDctnry(const char* buf, ColPosPair** pos, const int totalRow, } else { - const char* start = (const char*) curSig.signature; + const char* start = (const char*)curSig.signature; const char* end = (const char*)(curSig.signature + curSig.size); size_t numChars = cs->numchars(start, end); size_t maxCharLength = m_colWidth / cs->mbmaxlen; @@ -868,7 +867,7 @@ int Dctnry::insertDctnry(const char* buf, ColPosPair** pos, const int totalRow, } } } - else // cs->mbmaxlen == 1 + else // cs->mbmaxlen == 1 { if (curSig.size > m_colWidth) { @@ -1033,7 +1032,7 @@ int Dctnry::insertDctnry(const char* buf, ColPosPair** pos, const int totalRow, } } } // if next - } // end while + } // end while #ifdef PROFILE Stats::stopParseEvent(WE_STATS_PARSE_DCT); @@ -1467,7 +1466,7 @@ IDBDataFile* Dctnry::openDctnryFile(bool useTmpSuffix) /******************************************************************************* * close dictionary file ******************************************************************************/ -void Dctnry::closeDctnryFile(bool doFlush, std::map& oids) +void Dctnry::closeDctnryFile(bool /*doFlush*/, std::map& /*oids*/) { closeFile(m_dFile); m_dFile = NULL; diff --git a/writeengine/redistribute/we_redistributecontrol.cpp b/writeengine/redistribute/we_redistributecontrol.cpp index 76a4892e5..e90878e19 100644 --- a/writeengine/redistribute/we_redistributecontrol.cpp +++ b/writeengine/redistribute/we_redistributecontrol.cpp @@ -170,7 +170,7 @@ int RedistributeControl::handleUIMsg(messageqcpp::ByteStream& bs, messageqcpp::I return status; } -int RedistributeControl::handleStartMsg(messageqcpp::ByteStream& bs, messageqcpp::IOSocket& so) +int RedistributeControl::handleStartMsg(messageqcpp::ByteStream& bs, messageqcpp::IOSocket& /*so*/) { ostringstream oss; uint32_t status = getCurrentState(); @@ -236,7 +236,7 @@ int RedistributeControl::handleStartMsg(messageqcpp::ByteStream& bs, messageqcpp return status; } -int RedistributeControl::handleStatusMsg(messageqcpp::ByteStream&, messageqcpp::IOSocket& so) +int RedistributeControl::handleStatusMsg(messageqcpp::ByteStream&, messageqcpp::IOSocket& /*so*/) { ostringstream oss; uint32_t status = getCurrentState(); @@ -329,7 +329,7 @@ int RedistributeControl::handleStatusMsg(messageqcpp::ByteStream&, messageqcpp:: return status; } -int RedistributeControl::handleStopMsg(messageqcpp::ByteStream&, messageqcpp::IOSocket& so) +int RedistributeControl::handleStopMsg(messageqcpp::ByteStream&, messageqcpp::IOSocket& /*so*/) { ostringstream oss; uint32_t status = getCurrentState(); @@ -353,7 +353,7 @@ int RedistributeControl::handleStopMsg(messageqcpp::ByteStream&, messageqcpp::IO return status; } -int RedistributeControl::handleClearMsg(messageqcpp::ByteStream&, messageqcpp::IOSocket& so) +int RedistributeControl::handleClearMsg(messageqcpp::ByteStream&, messageqcpp::IOSocket& /*so*/) { ostringstream oss; uint32_t status = getCurrentState(); diff --git a/writeengine/redistribute/we_redistributeworkerthread.cpp b/writeengine/redistribute/we_redistributeworkerthread.cpp index 545223e86..524e2c198 100644 --- a/writeengine/redistribute/we_redistributeworkerthread.cpp +++ b/writeengine/redistribute/we_redistributeworkerthread.cpp @@ -1434,7 +1434,7 @@ void RedistributeWorkerThread::handleDataFinish(SBS& sbs, size_t& size) fIOSocket.write(fBs); } -void RedistributeWorkerThread::handleDataCommit(SBS& sbs, size_t& size) +void RedistributeWorkerThread::handleDataCommit(SBS& sbs, size_t& /*size*/) { size_t ack = 0; sbs.reset(); @@ -1446,7 +1446,7 @@ void RedistributeWorkerThread::handleDataCommit(SBS& sbs, size_t& size) fIOSocket.write(fBs); } -void RedistributeWorkerThread::handleDataAbort(SBS& sbs, size_t& size) +void RedistributeWorkerThread::handleDataAbort(SBS& sbs, size_t& /*size*/) { // close open file if (fNewFilePtr != NULL) diff --git a/writeengine/server/we_dataloader.cpp b/writeengine/server/we_dataloader.cpp index ce96f28ee..022963db5 100644 --- a/writeengine/server/we_dataloader.cpp +++ b/writeengine/server/we_dataloader.cpp @@ -33,7 +33,7 @@ #include #include //pipe() && fork() -#include //wait() +#include //wait() #include #include #include @@ -166,7 +166,7 @@ void WEDataLoader::setupSignalHandlers() //------------------------------------------------------------------------------ // handles on signal Terminate //------------------------------------------------------------------------------ -void WEDataLoader::onSigChild(int aInt) +void WEDataLoader::onSigChild(int /*aInt*/) { std::string aStr = "Received SIGCHLD of terminated process.."; cout << aStr << endl; @@ -187,7 +187,7 @@ void WEDataLoader::onSigChild(int aInt) * **/ -bool WEDataLoader::update(Subject* pSub) +bool WEDataLoader::update(Subject* /*pSub*/) { return true; } @@ -232,8 +232,7 @@ bool WEDataLoader::setupCpimport() // fork the cpimport close(fFIFO[1]); // close the WRITER of CHILD cout << "Child Process Info: PID = " << getpid() << " (fFIFO[0], fFIFO[1]) = (" << fFIFO[0] << "," - << fFIFO[1] << ")" - << " (StartFD, EndFD) = (" << aStartFD << "," << aEndFD << ")" << endl; + << fFIFO[1] << ")" << " (StartFD, EndFD) = (" << aStartFD << "," << aEndFD << ")" << endl; std::vector Cmds; // str2Argv(fCmdLineStr, Cmds); // to avoid out-of-scope problem @@ -282,8 +281,8 @@ bool WEDataLoader::setupCpimport() // fork the cpimport cout.flush(); close(fFIFO[0]); // will trigger an EOF on stdin ostringstream oss; - oss << getObjId() << " : execv error: cpimport.bin invocation failed; " - << "(errno-" << errno << "); " << strerror(execvErrno) << "; Check file and try invoking locally."; + oss << getObjId() << " : execv error: cpimport.bin invocation failed; " << "(errno-" << errno << "); " + << strerror(execvErrno) << "; Check file and try invoking locally."; logging::Message::Args errMsgArgs; errMsgArgs.add(oss.str()); fpSysLog->logMsg(errMsgArgs, logging::LOG_TYPE_ERROR, logging::M0000); @@ -913,7 +912,7 @@ void WEDataLoader::onReceiveData(ByteStream& Ibs) * @brief trigger when a EOD arrives. * @param Incoming ByteStream; not relevent for now */ -void WEDataLoader::onReceiveEod(ByteStream& Ibs) +void WEDataLoader::onReceiveEod(ByteStream& /*Ibs*/) { if (fpSysLog) { @@ -1063,7 +1062,7 @@ void WEDataLoader::onReceiveMode(ByteStream& Ibs) * @param Incoming ByteStream, not relevant for now */ -void WEDataLoader::onReceiveAck(ByteStream& Ibs) +void WEDataLoader::onReceiveAck(ByteStream& /*Ibs*/) { // All is good // update the status @@ -1074,7 +1073,7 @@ void WEDataLoader::onReceiveAck(ByteStream& Ibs) * @brief Can make use to update the BRM * @param Incoming ByteStream, not relevant for now */ -void WEDataLoader::onReceiveNak(ByteStream& Ibs) +void WEDataLoader::onReceiveNak(ByteStream& /*Ibs*/) { // TODO - handle the problem } @@ -1084,7 +1083,7 @@ void WEDataLoader::onReceiveNak(ByteStream& Ibs) * @brief Can make use to update the BRM * @param Incoming ByteStream, not relevant for now */ -void WEDataLoader::onReceiveError(ByteStream& Ibs) +void WEDataLoader::onReceiveError(ByteStream& /*Ibs*/) { // TODO - handle the failure situation. } @@ -1597,7 +1596,7 @@ void WEDataLoader::sendDataRequest() } //------------------------------------------------------------------------------ -void WEDataLoader::serialize(messageqcpp::ByteStream& b) const +void WEDataLoader::serialize(messageqcpp::ByteStream& /*b*/) const { // TODO to be changed. left it here to understand how to implement /* @@ -1612,7 +1611,7 @@ void WEDataLoader::serialize(messageqcpp::ByteStream& b) const //----------------------------------------------------------------------------- -void WEDataLoader::unserialize(messageqcpp::ByteStream& b) +void WEDataLoader::unserialize(messageqcpp::ByteStream& /*b*/) { // TODO to be changed. left it here to understand how to implement /* diff --git a/writeengine/server/we_dataloader.h b/writeengine/server/we_dataloader.h index ad43609c7..3db48b918 100644 --- a/writeengine/server/we_dataloader.h +++ b/writeengine/server/we_dataloader.h @@ -37,7 +37,7 @@ #include "we_simplesyslog.h" #include "we_observer.h" -//#include "we_readthread.h" +// #include "we_readthread.h" #include "we_cpifeederthread.h" @@ -57,8 +57,8 @@ class WEDataLoader : public Observer virtual bool update(Subject* pSub); public: - bool setupCpimport(); // fork the cpimport - void teardownCpimport(bool useStoredWaitPidStatus); // @bug 4267 + bool setupCpimport(); // fork the cpimport + void teardownCpimport(bool useStoredWaitPidStatus); // @bug 4267 void pushData2Cpimport(messageqcpp::ByteStream& Ibs); // push data to cpimport from the queue void closeWritePipe(); void str2Argv(std::string CmdLine, std::vector& V); @@ -183,7 +183,6 @@ class WEDataLoader : public Observer pid_t fCh_pid; pid_t fThis_pid; pid_t fP_pid; - bool fCpIStarted; std::string fCmdLineStr; std::string fBrmRptFileName; diff --git a/writeengine/server/we_ddlcommandproc.cpp b/writeengine/server/we_ddlcommandproc.cpp index c264ac819..c6ca0152b 100644 --- a/writeengine/server/we_ddlcommandproc.cpp +++ b/writeengine/server/we_ddlcommandproc.cpp @@ -67,9 +67,7 @@ WE_DDLCommandProc::WE_DDLCommandProc() if (dbct.length() != 0) dbrootCnt = cf->uFromText(dbct); } -WE_DDLCommandProc::WE_DDLCommandProc(const WE_DDLCommandProc& rhs) -{ -} + WE_DDLCommandProc::~WE_DDLCommandProc() { } @@ -2366,9 +2364,9 @@ uint8_t WE_DDLCommandProc::updateSyscolumnNextvalCol(ByteStream& bs, std::string return rc; } -uint8_t WE_DDLCommandProc::updateSystableEntryForSysColumn(int32_t sessionID, uint32_t txnID, +uint8_t WE_DDLCommandProc::updateSystableEntryForSysColumn(int32_t /*sessionID*/, uint32_t txnID, const DDLColumn& column, const std::string& value, - const std::string& oldValue, + const std::string& /*oldValue*/, execplan::CalpontSystemCatalog::RIDList& roList, std::string& err) { @@ -2791,7 +2789,7 @@ uint8_t WE_DDLCommandProc::updateSystableAuto(ByteStream& bs, std::string& err) return rc; } -uint8_t WE_DDLCommandProc::updateSystableEntryForSysTable(int32_t sessionID, uint32_t txnID, +uint8_t WE_DDLCommandProc::updateSystableEntryForSysTable(int32_t /*sessionID*/, uint32_t txnID, const DDLColumn& column, const std::string& value, const std::string& oldValue, CalpontSystemCatalog::ROPair ropair, diff --git a/writeengine/server/we_ddlcommandproc.h b/writeengine/server/we_ddlcommandproc.h index dbd93859d..4653d160c 100644 --- a/writeengine/server/we_ddlcommandproc.h +++ b/writeengine/server/we_ddlcommandproc.h @@ -32,7 +32,6 @@ #define EXPORT - namespace WriteEngine { struct DDLColumn; @@ -47,7 +46,7 @@ class WE_DDLCommandProc TRUNCATE_LOG }; WE_DDLCommandProc(); - WE_DDLCommandProc(const WE_DDLCommandProc& rhs); + WE_DDLCommandProc(const WE_DDLCommandProc& rhs) = delete; ~WE_DDLCommandProc(); /** @brief Update SYSCOLUMN nextval column for the columnoid with nextVal. * @@ -115,23 +114,14 @@ class WE_DDLCommandProc rid = relRidInThisExtent + numExtentsInThisSegPart * extentRows; } -private: -uint8_t updateSystableEntryForSysTable(int32_t sessionID, - uint32_t txnID, - const DDLColumn& column, - const std::string& value, - const std::string& oldValue, - execplan::CalpontSystemCatalog::ROPair ropair, - std::string& err); - -uint8_t updateSystableEntryForSysColumn(int32_t sessionID, - uint32_t txnID, - const DDLColumn& column, - const std::string& value, - const std::string& oldValue, - execplan::CalpontSystemCatalog::RIDList& roList, - std::string& err); + private: + uint8_t updateSystableEntryForSysTable(int32_t sessionID, uint32_t txnID, const DDLColumn& column, + const std::string& value, const std::string& oldValue, + execplan::CalpontSystemCatalog::ROPair ropair, std::string& err); + uint8_t updateSystableEntryForSysColumn(int32_t sessionID, uint32_t txnID, const DDLColumn& column, + const std::string& value, const std::string& oldValue, + execplan::CalpontSystemCatalog::RIDList& roList, std::string& err); private: WriteEngineWrapper fWEWrapper; diff --git a/writeengine/server/we_dmlcommandproc.cpp b/writeengine/server/we_dmlcommandproc.cpp index 79f62ad34..fff5ece08 100644 --- a/writeengine/server/we_dmlcommandproc.cpp +++ b/writeengine/server/we_dmlcommandproc.cpp @@ -415,8 +415,8 @@ uint8_t WE_DMLCommandProc::processSingleInsert(messageqcpp::ByteStream& bs, std: try { - datavalue = colType.convertColumnData(indata, pushWarning, insertPkg.get_TimeZone(), - false, false); + datavalue = + colType.convertColumnData(indata, pushWarning, insertPkg.get_TimeZone(), false, false); } catch (exception&) { @@ -993,7 +993,7 @@ uint8_t WE_DMLCommandProc::processBatchInsert(messageqcpp::ByteStream& bs, std:: Column aColumn; - if ((i == ridList.size() - 1) && (tableAUXColOid > 3000)) // AUX column + if ((i == ridList.size() - 1) && (tableAUXColOid > 3000)) // AUX column { aColumn.colWidth = execplan::AUX_COL_WIDTH; aColumn.colDataType = execplan::AUX_COL_DATATYPE; @@ -1034,8 +1034,8 @@ uint8_t WE_DMLCommandProc::processBatchInsert(messageqcpp::ByteStream& bs, std:: } //@Bug 5996 validate hwm before starts - rc = validateColumnHWMs(ridList, systemCatalogPtr, colDBRootExtentInfo, "Starting", - tableAUXColOid > 3000); + rc = + validateColumnHWMs(ridList, systemCatalogPtr, colDBRootExtentInfo, "Starting", tableAUXColOid > 3000); if (rc != 0) { @@ -1346,8 +1346,8 @@ uint8_t WE_DMLCommandProc::processBatchInsert(messageqcpp::ByteStream& bs, std:: try { - datavalue = colType.convertColumnData(indata, pushWarning, insertPkg.get_TimeZone(), - false, false); + datavalue = + colType.convertColumnData(indata, pushWarning, insertPkg.get_TimeZone(), false, false); } catch (exception&) { @@ -2046,7 +2046,7 @@ uint8_t WE_DMLCommandProc::processBatchInsertBinary(messageqcpp::ByteStream& bs, case execplan::CalpontSystemCatalog::BLOB: bs >> valStr; - if (!valStr.isNull()) // null values do not require any padding or truncation. + if (!valStr.isNull()) // null values do not require any padding or truncation. { if (valStr.length() > (unsigned int)colType.colWidth) { @@ -2215,7 +2215,7 @@ uint8_t WE_DMLCommandProc::processBatchInsertBinary(messageqcpp::ByteStream& bs, return rc; } -uint8_t WE_DMLCommandProc::commitBatchAutoOn(messageqcpp::ByteStream& bs, std::string& err) +uint8_t WE_DMLCommandProc::commitBatchAutoOn(messageqcpp::ByteStream& bs, std::string& /*err*/) { uint8_t rc = 0; // need to commit the versioned blocks, set hwm, update casual partition, send back to DMLProc to set them @@ -2452,8 +2452,7 @@ uint8_t WE_DMLCommandProc::processBatchInsertHwm(messageqcpp::ByteStream& bs, st auxColDBRootExtentInfo.end()); } - rc = validateColumnHWMs(ridList, systemCatalogPtr, colDBRootExtentInfo, "Ending", - hasAUXCol); + rc = validateColumnHWMs(ridList, systemCatalogPtr, colDBRootExtentInfo, "Ending", hasAUXCol); if (rc != 0) { @@ -2675,7 +2674,7 @@ uint8_t WE_DMLCommandProc::processBatchInsertHwmFlushChunks(uint32_t tblOid, int return rc; } -uint8_t WE_DMLCommandProc::commitBatchAutoOff(messageqcpp::ByteStream& bs, std::string& err) +uint8_t WE_DMLCommandProc::commitBatchAutoOff(messageqcpp::ByteStream& /*bs*/, std::string& /*err*/) { uint8_t rc = 0; // commit all versioned blocks, set hwm, update casual partition @@ -2715,7 +2714,7 @@ uint8_t WE_DMLCommandProc::rollbackBatchAutoOn(messageqcpp::ByteStream& bs, std: return rc; } -uint8_t WE_DMLCommandProc::rollbackBatchAutoOff(messageqcpp::ByteStream& bs, std::string& err) +uint8_t WE_DMLCommandProc::rollbackBatchAutoOff(messageqcpp::ByteStream& /*bs*/, std::string& /*err*/) { uint8_t rc = 0; // Rollbacked all versioned blocks @@ -3447,7 +3446,7 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, std::strin if (!value.isNull()) { unsigned i = strlen(value.str()); - value.assign(value.safeString().substr(0, i)); // XXX: why??? + value.assign(value.safeString().substr(0, i)); // XXX: why??? } break; } @@ -3619,8 +3618,8 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, std::strin try { - datavalue = - colType.convertColumnData(colType.defaultValue.safeString(""), pushWarn, timeZone, isNull, false, false); + datavalue = colType.convertColumnData(colType.defaultValue.safeString(""), pushWarn, timeZone, + isNull, false, false); } catch (exception&) { @@ -3652,7 +3651,8 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, std::strin { try { - datavalue = colType.convertColumnData(value.safeString(""), pushWarn, timeZone, isNull, false, false); + datavalue = + colType.convertColumnData(value.safeString(""), pushWarn, timeZone, isNull, false, false); } catch (exception&) { @@ -3792,8 +3792,8 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, std::strin { try { - datavalue = - colType.convertColumnData(colType.defaultValue.safeString(), pushWarn, timeZone, isNull, false, false); + datavalue = colType.convertColumnData(colType.defaultValue.safeString(), pushWarn, timeZone, + isNull, false, false); } catch (exception&) { @@ -3908,7 +3908,7 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, std::strin } uint8_t WE_DMLCommandProc::getWrittenLbids(messageqcpp::ByteStream& bs, std::string& err, - ByteStream::quadbyte& PMId) + ByteStream::quadbyte& /*PMId*/) { uint8_t rc = 0; uint32_t txnId; @@ -4459,7 +4459,7 @@ uint8_t WE_DMLCommandProc::updateSyscolumnNextval(ByteStream& bs, std::string& e return rc; } -uint8_t WE_DMLCommandProc::processPurgeFDCache(ByteStream& bs, std::string& err) +uint8_t WE_DMLCommandProc::processPurgeFDCache(ByteStream& bs, std::string& /*err*/) { int rc = 0; uint32_t tableOid; diff --git a/writeengine/server/we_getfilesizes.cpp b/writeengine/server/we_getfilesizes.cpp index 20080cffc..7d795a1f1 100644 --- a/writeengine/server/we_getfilesizes.cpp +++ b/writeengine/server/we_getfilesizes.cpp @@ -263,7 +263,7 @@ struct ColumnThread //------------------------------------------------------------------------------ // Get file size from file name in bytestream object //------------------------------------------------------------------------------ -int WE_GetFileSizes::processFileName(messageqcpp::ByteStream& bs, std::string& errMsg, int key) +int WE_GetFileSizes::processFileName(messageqcpp::ByteStream& bs, std::string& errMsg, int /*key*/) { uint8_t rc = 0; off_t fileSize = 0; diff --git a/writeengine/shared/we_brm.cpp b/writeengine/shared/we_brm.cpp index ee4df234e..ec4d9f2a1 100644 --- a/writeengine/shared/we_brm.cpp +++ b/writeengine/shared/we_brm.cpp @@ -24,7 +24,7 @@ #include #include #include -//#define NDEBUG +// #define NDEBUG #include #include #include @@ -92,7 +92,7 @@ struct fileInfoCompare // lt operator return false; } // operator -}; // struct +}; // struct typedef std::map FileOpenMap; @@ -563,7 +563,7 @@ int BRMWrapper::getBrmRc(bool reset) #define MAX_VERSION_BUFFER_SIZE 1024 -int BRMWrapper::copyVBBlock(IDBDataFile* pSourceFile, const OID sourceOid, IDBDataFile* pTargetFile, +int BRMWrapper::copyVBBlock(IDBDataFile* pSourceFile, const OID /*sourceOid*/, IDBDataFile* pTargetFile, const OID targetOid, const std::vector& fboList, const BRM::VBRange& freeList, size_t& nBlocksProcessed, DbFileOp* pFileOp, const size_t fboCurrentOffset) @@ -713,7 +713,7 @@ int BRMWrapper::copyVBBlock(IDBDataFile* pSourceFile, const OID sourceOid, IDBDa } int BRMWrapper::copyVBBlock(IDBDataFile* pSourceFile, IDBDataFile* pTargetFile, const uint64_t sourceFbo, - const uint64_t targetFbo, DbFileOp* fileOp, const Column& column) + const uint64_t targetFbo, DbFileOp* fileOp, const Column& /*column*/) { size_t rwSize; unsigned char buf[BYTE_PER_BLOCK]; @@ -731,14 +731,14 @@ int BRMWrapper::copyVBBlock(IDBDataFile* pSourceFile, IDBDataFile* pTargetFile, return NO_ERROR; } -uint8_t BRMWrapper::newCpimportJob(uint32_t &jobId) +uint8_t BRMWrapper::newCpimportJob(uint32_t& jobId) { return blockRsltnMgrPtr->newCpimportJob(jobId); } void BRMWrapper::finishCpimportJob(uint32_t jobId) { - if (finishReported.exchange(true)) // get old and set to true; if old is true, do nothing. + if (finishReported.exchange(true)) // get old and set to true; if old is true, do nothing. { return; } @@ -1423,7 +1423,7 @@ cleanup: return rc; } -int BRMWrapper::rollBackVersion(const VER_t transID, int sessionId) +int BRMWrapper::rollBackVersion(const VER_t transID, int /*sessionId*/) { std::vector lbidList; std::vector lbidRangeList; diff --git a/writeengine/shared/we_bulkrollbackfile.cpp b/writeengine/shared/we_bulkrollbackfile.cpp index 6e9fb6764..5e1bd03e9 100644 --- a/writeengine/shared/we_bulkrollbackfile.cpp +++ b/writeengine/shared/we_bulkrollbackfile.cpp @@ -169,9 +169,8 @@ void BulkRollbackFile::truncateSegmentFile(OID columnOID, uint32_t dbRoot, uint3 { WErrorCodes ec; std::ostringstream oss; - oss << "Error truncating column extents from DB for" - << ": OID-" << columnOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; " << ec.errorString(rc); + oss << "Error truncating column extents from DB for" << ": OID-" << columnOID << "; DbRoot-" << dbRoot + << "; partition-" << partNum << "; segment-" << segNum << "; " << ec.errorString(rc); fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -264,9 +263,8 @@ void BulkRollbackFile::reInitTruncColumnExtent(OID columnOID, uint32_t dbRoot, u { WErrorCodes ec; std::ostringstream oss; - oss << "Error rolling back HWM column extent from DB for" - << ": OID-" << columnOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; " << ec.errorString(rc); + oss << "Error rolling back HWM column extent from DB for" << ": OID-" << columnOID << "; DbRoot-" + << dbRoot << "; partition-" << partNum << "; segment-" << segNum << "; " << ec.errorString(rc); fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -364,9 +362,9 @@ void BulkRollbackFile::reInitTruncDctnryExtent(OID dStoreOID, uint32_t dbRoot, u { WErrorCodes ec; std::ostringstream oss; - oss << "Error rolling back HWM dictionary store extent from DB for" - << ": OID-" << dStoreOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; " << ec.errorString(rc); + oss << "Error rolling back HWM dictionary store extent from DB for" << ": OID-" << dStoreOID + << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" << segNum << "; " + << ec.errorString(rc); fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -399,8 +397,8 @@ void BulkRollbackFile::reInitTruncDctnryExtent(OID dStoreOID, uint32_t dbRoot, u // class can override this functionality, and return true or false depending // on whether the HWM chunk was modified and backed up to disk. //------------------------------------------------------------------------------ -bool BulkRollbackFile::doWeReInitExtent(OID columnOID, uint32_t dbRoot, uint32_t partNum, - uint32_t segNum) const +bool BulkRollbackFile::doWeReInitExtent(OID /*columnOID*/, uint32_t /*dbRoot*/, uint32_t /*partNum*/, + uint32_t /*segNum*/) const { return true; } diff --git a/writeengine/shared/we_bulkrollbackfilecompressed.cpp b/writeengine/shared/we_bulkrollbackfilecompressed.cpp index 7e2b8c509..bdeecf5e9 100644 --- a/writeengine/shared/we_bulkrollbackfilecompressed.cpp +++ b/writeengine/shared/we_bulkrollbackfilecompressed.cpp @@ -103,9 +103,8 @@ void BulkRollbackFileCompressed::truncateSegmentFile(OID columnOID, uint32_t dbR if (rc != NO_ERROR) { std::ostringstream oss; - oss << "Error reading compressed column ptr headers from DB for" - << ": OID-" << columnOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; " << errMsg; + oss << "Error reading compressed column ptr headers from DB for" << ": OID-" << columnOID << "; DbRoot-" + << dbRoot << "; partition-" << partNum << "; segment-" << segNum << "; " << errMsg; fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -121,9 +120,8 @@ void BulkRollbackFileCompressed::truncateSegmentFile(OID columnOID, uint32_t dbR if (!fCompressor) { std::ostringstream oss; - oss << "Error, wrong compression type for segment file" - << ": OID-" << columnOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << ";"; + oss << "Error, wrong compression type for segment file" << ": OID-" << columnOID << "; DbRoot-" << dbRoot + << "; partition-" << partNum << "; segment-" << segNum << ";"; throw WeException(oss.str(), ERR_COMP_WRONG_COMP_TYPE); } @@ -159,9 +157,8 @@ void BulkRollbackFileCompressed::truncateSegmentFile(OID columnOID, uint32_t dbR { WErrorCodes ec; std::ostringstream oss; - oss << "Error writing compressed column headers to DB for" - << ": OID-" << columnOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; " << ec.errorString(rc); + oss << "Error writing compressed column headers to DB for" << ": OID-" << columnOID << "; DbRoot-" + << dbRoot << "; partition-" << partNum << "; segment-" << segNum << "; " << ec.errorString(rc); fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -174,9 +171,8 @@ void BulkRollbackFileCompressed::truncateSegmentFile(OID columnOID, uint32_t dbR { WErrorCodes ec; std::ostringstream oss; - oss << "Error truncating compressed column extents from DB for" - << ": OID-" << columnOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; " << ec.errorString(rc); + oss << "Error truncating compressed column extents from DB for" << ": OID-" << columnOID << "; DbRoot-" + << dbRoot << "; partition-" << partNum << "; segment-" << segNum << "; " << ec.errorString(rc); fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -211,9 +207,9 @@ void BulkRollbackFileCompressed::reInitTruncColumnExtent(OID columnOID, uint32_t long long startOffset = startOffsetBlk * BYTE_PER_BLOCK; std::ostringstream msgText1; - msgText1 << "Reinit HWM compressed column extent in db file" - << ": dbRoot-" << dbRoot << "; part#-" << partNum << "; seg#-" << segNum << "; rawOffset(bytes)-" - << startOffset << "; rawFreeBlks-" << nBlocks; + msgText1 << "Reinit HWM compressed column extent in db file" << ": dbRoot-" << dbRoot << "; part#-" + << partNum << "; seg#-" << segNum << "; rawOffset(bytes)-" << startOffset << "; rawFreeBlks-" + << nBlocks; fMgr->logAMessage(logging::LOG_TYPE_INFO, logging::M0075, columnOID, msgText1.str()); std::string segFile; @@ -239,9 +235,8 @@ void BulkRollbackFileCompressed::reInitTruncColumnExtent(OID columnOID, uint32_t if (rc != NO_ERROR) { std::ostringstream oss; - oss << "Error reading compressed column ptr headers from DB for" - << ": OID-" << columnOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; " << errMsg; + oss << "Error reading compressed column ptr headers from DB for" << ": OID-" << columnOID << "; DbRoot-" + << dbRoot << "; partition-" << partNum << "; segment-" << segNum << "; " << errMsg; fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -257,9 +252,8 @@ void BulkRollbackFileCompressed::reInitTruncColumnExtent(OID columnOID, uint32_t if (!fCompressor) { std::ostringstream oss; - oss << "Error, wrong compression type for segment file" - << ": OID-" << columnOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << ";"; + oss << "Error, wrong compression type for segment file" << ": OID-" << columnOID << "; DbRoot-" << dbRoot + << "; partition-" << partNum << "; segment-" << segNum << ";"; throw WeException(oss.str(), ERR_COMP_WRONG_COMP_TYPE); } @@ -279,9 +273,9 @@ void BulkRollbackFileCompressed::reInitTruncColumnExtent(OID columnOID, uint32_t if (rc != NO_ERROR) { std::ostringstream oss; - oss << "Error restoring HWM chunk for" - << ": OID-" << columnOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; blkoff-" << blockOffset << "; " << errMsg; + oss << "Error restoring HWM chunk for" << ": OID-" << columnOID << "; DbRoot-" << dbRoot + << "; partition-" << partNum << "; segment-" << segNum << "; blkoff-" << blockOffset << "; " + << errMsg; fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -392,9 +386,8 @@ void BulkRollbackFileCompressed::reInitTruncColumnExtent(OID columnOID, uint32_t { WErrorCodes ec; std::ostringstream oss; - oss << "Error writing compressed column headers to DB for" - << ": OID-" << columnOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; " << ec.errorString(rc); + oss << "Error writing compressed column headers to DB for" << ": OID-" << columnOID << "; DbRoot-" + << dbRoot << "; partition-" << partNum << "; segment-" << segNum << "; " << ec.errorString(rc); fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -407,9 +400,8 @@ void BulkRollbackFileCompressed::reInitTruncColumnExtent(OID columnOID, uint32_t { WErrorCodes ec; std::ostringstream oss; - oss << "Error truncating compressed column extents from DB for" - << ": OID-" << columnOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; " << ec.errorString(rc); + oss << "Error truncating compressed column extents from DB for" << ": OID-" << columnOID << "; DbRoot-" + << dbRoot << "; partition-" << partNum << "; segment-" << segNum << "; " << ec.errorString(rc); fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -510,9 +502,8 @@ void BulkRollbackFileCompressed::reInitTruncDctnryExtent(OID dStoreOID, uint32_t if (rc != NO_ERROR) { std::ostringstream oss; - oss << "Error reading compressed dctnry ptr headers from DB for" - << ": OID-" << dStoreOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; " << errMsg; + oss << "Error reading compressed dctnry ptr headers from DB for" << ": OID-" << dStoreOID << "; DbRoot-" + << dbRoot << "; partition-" << partNum << "; segment-" << segNum << "; " << errMsg; fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -528,9 +519,8 @@ void BulkRollbackFileCompressed::reInitTruncDctnryExtent(OID dStoreOID, uint32_t if (!fCompressor) { std::ostringstream oss; - oss << "Error, wrong compression type for segment file" - << ": OID-" << dStoreOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << ";"; + oss << "Error, wrong compression type for segment file" << ": OID-" << dStoreOID << "; DbRoot-" << dbRoot + << "; partition-" << partNum << "; segment-" << segNum << ";"; throw WeException(oss.str(), ERR_COMP_WRONG_COMP_TYPE); } @@ -547,8 +537,8 @@ void BulkRollbackFileCompressed::reInitTruncDctnryExtent(OID dStoreOID, uint32_t if (rc == ERR_FILE_NOT_EXIST) { std::ostringstream msgText3; - msgText3 << "No restore needed to Compressed dictionary file" - << ": dbRoot-" << dbRoot << "; part#-" << partNum << "; seg#-" << segNum; + msgText3 << "No restore needed to Compressed dictionary file" << ": dbRoot-" << dbRoot << "; part#-" + << partNum << "; seg#-" << segNum; fMgr->logAMessage(logging::LOG_TYPE_INFO, logging::M0075, dStoreOID, msgText3.str()); fDbFile.closeFile(pFile); @@ -558,9 +548,9 @@ void BulkRollbackFileCompressed::reInitTruncDctnryExtent(OID dStoreOID, uint32_t if (rc != NO_ERROR) { std::ostringstream oss; - oss << "Error restoring HWM chunk for" - << ": OID-" << dStoreOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; blkoff-" << blockOffset << "; " << errMsg; + oss << "Error restoring HWM chunk for" << ": OID-" << dStoreOID << "; DbRoot-" << dbRoot + << "; partition-" << partNum << "; segment-" << segNum << "; blkoff-" << blockOffset << "; " + << errMsg; fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -590,8 +580,8 @@ void BulkRollbackFileCompressed::reInitTruncDctnryExtent(OID dStoreOID, uint32_t if (bAbbreviatedExtent) // log adjusted nBlock count for abbrev extent msgText2 << "; rawFreeBlks-" << nBlocks << " (abbrev)"; - msgText2 << "; restoredChunk-" << restoredChunkLen << " bytes" - << "; truncated to " << fileSizeBytes << " bytes"; + msgText2 << "; restoredChunk-" << restoredChunkLen << " bytes" << "; truncated to " << fileSizeBytes + << " bytes"; fMgr->logAMessage(logging::LOG_TYPE_INFO, logging::M0075, dStoreOID, msgText2.str()); // Initialize the remainder of the extent after the HWM chunk @@ -653,9 +643,8 @@ void BulkRollbackFileCompressed::reInitTruncDctnryExtent(OID dStoreOID, uint32_t { WErrorCodes ec; std::ostringstream oss; - oss << "Error writing compressed dictionary headers to DB for" - << ": OID-" << dStoreOID << "; DbRoot-" << dbRoot << "; partition-" << partNum << "; segment-" - << segNum << "; " << ec.errorString(rc); + oss << "Error writing compressed dictionary headers to DB for" << ": OID-" << dStoreOID << "; DbRoot-" + << dbRoot << "; partition-" << partNum << "; segment-" << segNum << "; " << ec.errorString(rc); fDbFile.closeFile(pFile); throw WeException(oss.str(), rc); @@ -838,8 +827,8 @@ int BulkRollbackFileCompressed::restoreHWMChunk(IDBDataFile* pFile, OID columnOI { WErrorCodes ec; std::ostringstream oss; - oss << "Error setting column file offset" - << "; offset-" << fileOffsetByteForRestoredChunk << "; " << ec.errorString(rc); + oss << "Error setting column file offset" << "; offset-" << fileOffsetByteForRestoredChunk << "; " + << ec.errorString(rc); errMsg = oss.str(); delete backupFile; @@ -877,9 +866,8 @@ int BulkRollbackFileCompressed::restoreHWMChunk(IDBDataFile* pFile, OID columnOI { WErrorCodes ec; std::ostringstream oss; - oss << "Error writing to column file" - << "; offset-" << fileOffsetByteForRestoredChunk << "; bytes-" << restoredChunkLen << "; " - << ec.errorString(rc); + oss << "Error writing to column file" << "; offset-" << fileOffsetByteForRestoredChunk << "; bytes-" + << restoredChunkLen << "; " << ec.errorString(rc); errMsg = oss.str(); delete backupFile; @@ -898,7 +886,7 @@ int BulkRollbackFileCompressed::restoreHWMChunk(IDBDataFile* pFile, OID columnOI // the backup file is not found, we assume that it's because one was not created // and thus not needed. //------------------------------------------------------------------------------ -bool BulkRollbackFileCompressed::doWeReInitExtent(OID columnOID, uint32_t dbRoot, uint32_t partNum, +bool BulkRollbackFileCompressed::doWeReInitExtent(OID columnOID, uint32_t /*dbRoot*/, uint32_t partNum, uint32_t segNum) const { std::ostringstream oss; diff --git a/writeengine/shared/we_bulkrollbackfilecompressedhdfs.cpp b/writeengine/shared/we_bulkrollbackfilecompressedhdfs.cpp index 61f8b61f7..9cd9ff353 100644 --- a/writeengine/shared/we_bulkrollbackfilecompressedhdfs.cpp +++ b/writeengine/shared/we_bulkrollbackfilecompressedhdfs.cpp @@ -98,15 +98,15 @@ void BulkRollbackFileCompressedHdfs::truncateSegmentFile(OID columnOID, uint32_t void BulkRollbackFileCompressedHdfs::reInitTruncColumnExtent(OID columnOID, uint32_t dbRoot, uint32_t partNum, uint32_t segNum, long long startOffsetBlk, int nBlocks, - CalpontSystemCatalog::ColDataType colType, - uint32_t colWidth, bool restoreHwmChk) + CalpontSystemCatalog::ColDataType /*colType*/, + uint32_t /*colWidth*/, bool /*restoreHwmChk*/) { long long startOffset = startOffsetBlk * BYTE_PER_BLOCK; std::ostringstream msgText; - msgText << "Reinit HWM compressed column extent in HDFS db file" - << ": dbRoot-" << dbRoot << "; part#-" << partNum << "; seg#-" << segNum << "; rawOffset(bytes)-" - << startOffset << "; rawFreeBlks-" << nBlocks; + msgText << "Reinit HWM compressed column extent in HDFS db file" << ": dbRoot-" << dbRoot << "; part#-" + << partNum << "; seg#-" << segNum << "; rawOffset(bytes)-" << startOffset << "; rawFreeBlks-" + << nBlocks; fMgr->logAMessage(logging::LOG_TYPE_INFO, logging::M0075, columnOID, msgText.str()); restoreFromBackup("column", columnOID, dbRoot, partNum, segNum); @@ -146,8 +146,8 @@ void BulkRollbackFileCompressedHdfs::reInitTruncDctnryExtent(OID dStoreOID, uint // Let ConfirmHdfsDbFile later determine when/if/how to restore from any // existing backup file. //------------------------------------------------------------------------------ -bool BulkRollbackFileCompressedHdfs::doWeReInitExtent(OID columnOID, uint32_t dbRoot, uint32_t partNum, - uint32_t segNum) const +bool BulkRollbackFileCompressedHdfs::doWeReInitExtent(OID /*columnOID*/, uint32_t /*dbRoot*/, + uint32_t /*partNum*/, uint32_t /*segNum*/) const { return true; } diff --git a/writeengine/shared/we_cache.h b/writeengine/shared/we_cache.h index 41bd711e2..0377ecb23 100644 --- a/writeengine/shared/we_cache.h +++ b/writeengine/shared/we_cache.h @@ -116,7 +116,7 @@ class Cache /** * @brief Get the cache key */ - static CacheKey getCacheKey(const OID oid, const uint64_t lbid) + static CacheKey getCacheKey(const OID /*oid*/, const uint64_t lbid) { CacheKey key = lbid; /*Convertor::int2Str( oid ) + "|" + Convertor::int2Str(lbid)*/ ; diff --git a/writeengine/shared/we_chunkmanager.cpp b/writeengine/shared/we_chunkmanager.cpp index 839b598fb..fab145f1e 100644 --- a/writeengine/shared/we_chunkmanager.cpp +++ b/writeengine/shared/we_chunkmanager.cpp @@ -360,7 +360,7 @@ CompFileData* ChunkManager::getFileDataByName(const std::string& filename, const CompFileData* ChunkManager::getFileData_(const FileID& fileID, const string& filename, const char* mode, - int size, const CalpontSystemCatalog::ColDataType colDataType, + const int /*size*/, const CalpontSystemCatalog::ColDataType colDataType, int colWidth, bool useTmpSuffix, bool dctnry, bool isReadOnly) const { CompFileData* fileData = new CompFileData(fileID, fileID.fFid, colDataType, colWidth, isReadOnly); @@ -433,7 +433,7 @@ CompFileData* ChunkManager::getFileData_(const FileID& fileID, const string& fil //------------------------------------------------------------------------------ IDBDataFile* ChunkManager::createDctnryFile(const FID& fid, int64_t width, uint16_t root, uint32_t partition, uint16_t segment, const char* filename, const char* mode, - int size, BRM::LBID_t lbid) + const int /*size*/, BRM::LBID_t lbid) { FileID fileID(fid, root, partition, segment); CompFileData* fileData = new CompFileData(fileID, fid, CalpontSystemCatalog::VARCHAR, width); diff --git a/writeengine/shared/we_convertor.cpp b/writeengine/shared/we_convertor.cpp index 0d29e3d9f..3da8803ee 100644 --- a/writeengine/shared/we_convertor.cpp +++ b/writeengine/shared/we_convertor.cpp @@ -248,7 +248,7 @@ const std::string Convertor::int2Str(int val) ******************************************************************************/ /* static */ -long long Convertor::convertDecimalString(const char* field, int fieldLength, int scale) +long long Convertor::convertDecimalString(const char* field, int /*fieldLength*/, int scale) { long double dval = strtold(field, nullptr); long long ret = 0; diff --git a/writeengine/shared/we_dbfileop.cpp b/writeengine/shared/we_dbfileop.cpp index 0d179821d..e5ca6bd2c 100644 --- a/writeengine/shared/we_dbfileop.cpp +++ b/writeengine/shared/we_dbfileop.cpp @@ -304,7 +304,7 @@ int DbFileOp::writeDBFileNoVBCache(CommBlock& cb, const unsigned char* writeBuf, * Core function for writing data w/o using VB cache * (bulk load dictionary store inserts) ***********************************************************/ -int DbFileOp::writeDBFileNoVBCache(IDBDataFile* pFile, const unsigned char* writeBuf, const int fbo, +int DbFileOp::writeDBFileNoVBCache(IDBDataFile* pFile, const unsigned char* writeBuf, const int /*fbo*/, const int numOfBlock) { #ifdef PROFILE diff --git a/writeengine/shared/we_dbrootextenttracker.cpp b/writeengine/shared/we_dbrootextenttracker.cpp index c07e64bd1..07bb924e6 100644 --- a/writeengine/shared/we_dbrootextenttracker.cpp +++ b/writeengine/shared/we_dbrootextenttracker.cpp @@ -321,7 +321,7 @@ int DBRootExtentTracker::selectFirstSegFile(DBRootExtentInfo& dbRootExtent, bool // Mutex lock not needed in this function as it is only called from main thread // before processing threads are spawned. //------------------------------------------------------------------------------ -int DBRootExtentTracker::selectFirstSegFileForEmptyPM(std::string& errMsg) +int DBRootExtentTracker::selectFirstSegFileForEmptyPM(std::string& /*errMsg*/) { fEmptyOrDisabledPM = true; diff --git a/writeengine/shared/we_fileop.cpp b/writeengine/shared/we_fileop.cpp index dbf7f861c..4b5dcfd05 100644 --- a/writeengine/shared/we_fileop.cpp +++ b/writeengine/shared/we_fileop.cpp @@ -114,7 +114,7 @@ void FileOp::closeFile(IDBDataFile* pFile) const * RETURN: * NO_ERROR if success, otherwise if fail ***********************************************************/ -int FileOp::createDir(const char* dirName, mode_t mode) const +int FileOp::createDir(const char* dirName, mode_t /*mode*/) const { boost::mutex::scoped_lock lk(m_mkdirMutex); int rc = IDBPolicy::mkdir(dirName); @@ -378,7 +378,7 @@ int FileOp::deleteFiles(const std::vector& fids) const * NO_ERROR if success * ERR_DM_CONVERT_OID if error occurs converting OID to file name ***********************************************************/ -int FileOp::deletePartitions(const std::vector& fids, +int FileOp::deletePartitions(const std::vector& /*fids*/, const std::vector& partitions) const { char tempFileName[FILE_NAME_SIZE]; @@ -578,9 +578,9 @@ int FileOp::extendFile(OID oid, const uint8_t* emptyVal, int width, if (isDebug(DEBUG_1) && getLogger()) { std::ostringstream oss; - oss << "Opening existing column file (extendFile)" - << ": OID-" << oid << "; DBRoot-" << dbRoot << "; part-" << partition << "; seg-" << segment - << "; LBID-" << startLbid << "; hwm-" << hwm << "; file-" << segFile; + oss << "Opening existing column file (extendFile)" << ": OID-" << oid << "; DBRoot-" << dbRoot + << "; part-" << partition << "; seg-" << segment << "; LBID-" << startLbid << "; hwm-" << hwm + << "; file-" << segFile; getLogger()->logMsg(oss.str(), MSGLVL_INFO2); } @@ -637,9 +637,9 @@ int FileOp::extendFile(OID oid, const uint8_t* emptyVal, int width, if (getLogger()) { std::ostringstream oss; - oss << "FileOp::extendFile: error padding partial compressed extent for " - << "column OID-" << oid << "; DBRoot-" << dbRoot << "; part-" << partition << "; seg-" - << segment << "; hwm-" << hwm << " " << failedTask.c_str(); + oss << "FileOp::extendFile: error padding partial compressed extent for " << "column OID-" << oid + << "; DBRoot-" << dbRoot << "; part-" << partition << "; seg-" << segment << "; hwm-" << hwm + << " " << failedTask.c_str(); getLogger()->logMsg(oss.str(), rc, MSGLVL_CRITICAL); } @@ -690,9 +690,9 @@ int FileOp::extendFile(OID oid, const uint8_t* emptyVal, int width, if (getLogger()) { std::ostringstream oss; - oss << "FileOp::extendFile: error padding partial uncompressed extent for " - << "column OID-" << oid << "; DBRoot-" << dbRoot << "; part-" << partition << "; seg-" - << segment << "; hwm-" << hwm; + oss << "FileOp::extendFile: error padding partial uncompressed extent for " << "column OID-" + << oid << "; DBRoot-" << dbRoot << "; part-" << partition << "; seg-" << segment << "; hwm-" + << hwm; getLogger()->logMsg(oss.str(), rc, MSGLVL_CRITICAL); } @@ -723,9 +723,8 @@ int FileOp::extendFile(OID oid, const uint8_t* emptyVal, int width, if (isDebug(DEBUG_1) && getLogger()) { std::ostringstream oss; - oss << "Opening new column file" - << ": OID-" << oid << "; DBRoot-" << dbRoot << "; part-" << partition << "; seg-" << segment - << "; LBID-" << startLbid << "; hwm-" << hwm << "; file-" << segFile; + oss << "Opening new column file" << ": OID-" << oid << "; DBRoot-" << dbRoot << "; part-" << partition + << "; seg-" << segment << "; LBID-" << startLbid << "; hwm-" << hwm << "; file-" << segFile; getLogger()->logMsg(oss.str(), MSGLVL_INFO2); } @@ -818,9 +817,9 @@ int FileOp::addExtentExactFile(OID oid, const uint8_t* emptyVal, int width, int& if (isDebug(DEBUG_1) && getLogger()) { std::ostringstream oss; - oss << "Opening existing column file" - << ": OID-" << oid << "; DBRoot-" << dbRoot << "; part-" << partition << "; seg-" << segment - << "; LBID-" << startLbid << "; hwm-" << hwm << "; file-" << segFile; + oss << "Opening existing column file" << ": OID-" << oid << "; DBRoot-" << dbRoot << "; part-" + << partition << "; seg-" << segment << "; LBID-" << startLbid << "; hwm-" << hwm << "; file-" + << segFile; getLogger()->logMsg(oss.str(), MSGLVL_INFO2); } @@ -848,9 +847,8 @@ int FileOp::addExtentExactFile(OID oid, const uint8_t* emptyVal, int width, int& if (isDebug(DEBUG_1) && getLogger()) { std::ostringstream oss; - oss << "Opening new column file" - << ": OID-" << oid << "; DBRoot-" << dbRoot << "; part-" << partition << "; seg-" << segment - << "; LBID-" << startLbid << "; hwm-" << hwm << "; file-" << segFile; + oss << "Opening new column file" << ": OID-" << oid << "; DBRoot-" << dbRoot << "; part-" << partition + << "; seg-" << segment << "; LBID-" << startLbid << "; hwm-" << hwm << "; file-" << segFile; getLogger()->logMsg(oss.str(), MSGLVL_INFO2); } @@ -1290,9 +1288,9 @@ int FileOp::fillCompColumnExtentEmptyChunks(OID oid, int colWidth, const uint8_t if (getLogger()) { std::ostringstream oss; - oss << "Converting abbreviated partial extent to full extent for" - << ": OID-" << oid << "; DBRoot-" << dbRoot << "; part-" << partition << "; seg-" << segment - << "; file-" << segFile << "; wid-" << colWidth << "; oldBlkCnt-" << blkCount << "; newBlkCnt-" + oss << "Converting abbreviated partial extent to full extent for" << ": OID-" << oid << "; DBRoot-" + << dbRoot << "; part-" << partition << "; seg-" << segment << "; file-" << segFile << "; wid-" + << colWidth << "; oldBlkCnt-" << blkCount << "; newBlkCnt-" << ((ROWS_PER_EXTENT * colWidth) / BYTE_PER_BLOCK); getLogger()->logMsg(oss.str(), MSGLVL_INFO2); } @@ -1652,7 +1650,7 @@ int FileOp::writeHeaders(IDBDataFile* pFile, const char* controlHdr, const char* * else returns NO_ERROR. ***********************************************************/ int FileOp::initDctnryExtent(IDBDataFile* pFile, uint16_t dbRoot, int nBlocks, unsigned char* blockHdrInit, - int blockHdrInitSize, bool bExpandExtent, bool bOptExtension, int64_t lbid) + int blockHdrInitSize, bool /*bExpandExtent*/, bool bOptExtension, int64_t lbid) { // @bug5769 Don't initialize extents or truncate db files on HDFS if (idbdatafile::IDBPolicy::useHdfs()) @@ -2628,17 +2626,17 @@ void FileOp::setBulkFlag(bool isBulkLoad) m_isBulk = isBulkLoad; } -int FileOp::flushFile(int rc, std::map& oids) +int FileOp::flushFile(int /*rc*/, std::map& /*oids*/) { return NO_ERROR; } -int FileOp::updateColumnExtent(IDBDataFile* pFile, int nBlocks, int64_t lbid) +int FileOp::updateColumnExtent(IDBDataFile* /*pFile*/, int /*nBlocks*/, int64_t /*lbid*/) { return NO_ERROR; } -int FileOp::updateDctnryExtent(IDBDataFile* pFile, int nBlocks, int64_t lbid) +int FileOp::updateDctnryExtent(IDBDataFile* /*pFile*/, int /*nBlocks*/, int64_t /*lbid*/) { return NO_ERROR; } diff --git a/writeengine/splitter/we_cmdargs.h b/writeengine/splitter/we_cmdargs.h index b5bc48af9..64eb3dedb 100644 --- a/writeengine/splitter/we_cmdargs.h +++ b/writeengine/splitter/we_cmdargs.h @@ -129,10 +129,6 @@ class WECmdArgs { this->fJobId = fJobId; } - void setOrigJobId(std::string fOrigJobId) - { - this->fOrigJobId = fJobId; - } void setLocFile(std::string fLocFile) { this->fLocFile = fLocFile; diff --git a/writeengine/splitter/we_splclient.cpp b/writeengine/splitter/we_splclient.cpp index b4eee7e16..95ab71656 100644 --- a/writeengine/splitter/we_splclient.cpp +++ b/writeengine/splitter/we_splclient.cpp @@ -295,7 +295,7 @@ void WESplClient::write(const messageqcpp::ByteStream& Msg) } } //------------------------------------------------------------------------------ -void WESplClient::read(messageqcpp::SBS& Sbs) +void WESplClient::read(messageqcpp::SBS& /*Sbs*/) { // read from the WEServerMsgQueue // if Key is needed give that constant here diff --git a/writeengine/wrapper/we_colop.cpp b/writeengine/wrapper/we_colop.cpp index d680fdd08..68624d346 100644 --- a/writeengine/wrapper/we_colop.cpp +++ b/writeengine/wrapper/we_colop.cpp @@ -675,7 +675,7 @@ int ColumnOp::createColumn(Column& column, int colNo, int colWidth, * * @return */ -int ColumnOp::fillColumn(const TxnID& txnid, Column& column, Column& refCol, void* defaultVal, Dctnry* dctnry, +int ColumnOp::fillColumn(const TxnID& /*txnid*/, Column& column, Column& refCol, void* defaultVal, Dctnry* dctnry, ColumnOp* refColOp, const OID dictOid, const int dictColWidth, const string defaultValStr, bool autoincrement) { diff --git a/writeengine/wrapper/we_colopcompress.cpp b/writeengine/wrapper/we_colopcompress.cpp index c426d547e..37feb3629 100644 --- a/writeengine/wrapper/we_colopcompress.cpp +++ b/writeengine/wrapper/we_colopcompress.cpp @@ -63,7 +63,7 @@ ColumnOpCompress0::~ColumnOpCompress0() IDBDataFile* ColumnOpCompress0::openFile(const Column& column, const uint16_t dbRoot, const uint32_t partition, const uint16_t segment, std::string& segFile, bool useTmpSuffix, const char* mode, - const int ioBuffSize, bool isReadOnly) const + const int /*ioBuffSize*/, bool /*isReadOnly*/) const { return FileOp::openFile(column.dataFile.fid, dbRoot, partition, segment, segFile, mode, column.colWidth, useTmpSuffix); diff --git a/writeengine/wrapper/writeengine.cpp b/writeengine/wrapper/writeengine.cpp index b556f8100..41524aa0b 100644 --- a/writeengine/wrapper/writeengine.cpp +++ b/writeengine/wrapper/writeengine.cpp @@ -181,7 +181,7 @@ WriteEngineWrapper::~WriteEngineWrapper() * NO_ERROR if success * others if something wrong in the checking process ***********************************************************/ -int WriteEngineWrapper::checkValid(const TxnID& txnid, const ColStructList& colStructList, +int WriteEngineWrapper::checkValid(const TxnID& /*txnid*/, const ColStructList& colStructList, const ColValueList& colValueList, const RIDList& ridList) const { ColTupleList curTupleList; @@ -343,7 +343,7 @@ bool updateRangeCheckForInvalidity(ExtCPInfo* maxMin, InternalType value, Intern * both arrays are present (update). */ void WriteEngineWrapper::updateMaxMinRange(const size_t totalNewRow, const size_t totalOldRow, - const execplan::CalpontSystemCatalog::ColType& cscColType, + const execplan::CalpontSystemCatalog::ColType& /*cscColType*/, const ColType colType, const void* valArrayVoid, const void* oldValArrayVoid, ExtCPInfo* maxMin, bool canStartWithInvalidRange) @@ -1105,7 +1105,7 @@ inline void allocateValArray(void*& valArray, ColTupleList::size_type totalRow, } } -int WriteEngineWrapper::deleteBadRows(const TxnID& txnid, ColStructList& colStructs, RIDList& ridList, +int WriteEngineWrapper::deleteBadRows(const TxnID& /*txnid*/, ColStructList& colStructs, RIDList& ridList, DctnryStructList& dctnryStructList) { /* Need to scan all files including dictionary store files to check whether there is any bad chunks @@ -1218,7 +1218,7 @@ static void log_this(const char *message, /** @brief Determine whether we may update a column's ranges (by type) and return nullptr if we can't */ static ExtCPInfo* getCPInfoToUpdateForUpdatableType(const ColStruct& colStruct, ExtCPInfo* currentCPInfo, - OpType optype) + OpType /*optype*/) { if (colStruct.tokenFlag) { @@ -6108,7 +6108,7 @@ int WriteEngineWrapper::tokenize(const TxnID& txnid, DctnryStruct& dctnryStruct, * ERR_FILE_EXIST if file exists * ERR_FILE_CREATE if something wrong in creating the file ***********************************************************/ -int WriteEngineWrapper::createDctnry(const TxnID& txnid, const OID& dctnryOid, int colWidth, uint16_t dbRoot, +int WriteEngineWrapper::createDctnry(const TxnID& /*txnid*/, const OID& dctnryOid, int colWidth, uint16_t dbRoot, uint32_t partiotion, uint16_t segment, int compressionType) { BRM::LBID_t startLbid; @@ -6198,7 +6198,7 @@ int WriteEngineWrapper::bulkRollback(OID tableOid, uint64_t lockID, const std::s return rc; } -int WriteEngineWrapper::rollbackCommon(const TxnID& txnid, int sessionId) +int WriteEngineWrapper::rollbackCommon(const TxnID& txnid, int /*sessionId*/) { // Remove the unwanted tmp files and recover compressed chunks. string prefix; @@ -6588,7 +6588,7 @@ void WriteEngineWrapper::AddDictToList(const TxnID txnid, std::vectorcloseDctnry(realClose); } @@ -220,7 +220,7 @@ class WriteEngineWrapper : public WEObj * @param treeOid index tree file object id * @param listOid index list file object id */ - int createIndex(const TxnID& txnid, const OID& treeOid, const OID& listOid) + int createIndex(const TxnID& /*txnid*/, const OID& /*treeOid*/, const OID& /*listOid*/) { int rc = -1; return rc; @@ -268,7 +268,7 @@ class WriteEngineWrapper : public WEObj * @brief Drop a column, include object ids for column data file * @param dataOid column datafile object id */ - int dropColumn(const TxnID& txnid, const OID dataOid) + int dropColumn(const TxnID& /*txnid*/, const OID dataOid) { return m_colOp[0]->dropColumn((FID)dataOid); } @@ -277,7 +277,7 @@ class WriteEngineWrapper : public WEObj * @brief Drop files * @param dataOids column and dictionary datafile object id */ - int dropFiles(const TxnID& txnid, const std::vector& dataOids) + int dropFiles(const TxnID& /*txnid*/, const std::vector& dataOids) { return m_colOp[0]->dropFiles(dataOids); } @@ -291,7 +291,7 @@ class WriteEngineWrapper : public WEObj return m_colOp[0]->dropPartitions(dataOids, partitions); } - int deleteOIDsFromExtentMap(const TxnID& txnid, const std::vector& dataOids) + int deleteOIDsFromExtentMap(const TxnID& /*txnid*/, const std::vector& dataOids) { return m_colOp[0]->deleteOIDsFromExtentMap(dataOids); } @@ -301,7 +301,7 @@ class WriteEngineWrapper : public WEObj * @param treeOid index tree file object id * @param listOid index list file object id */ - int dropIndex(const TxnID& txnid, const OID& treeOid, const OID& listOid) + int dropIndex(const TxnID& /*txnid*/, const OID& /*treeOid*/, const OID& /*listOid*/) { return -1; } @@ -312,7 +312,7 @@ class WriteEngineWrapper : public WEObj * @param treeOid dictionary tree file object id * @param listOid index list file object id */ - int dropDctnry(const TxnID& txnid, const OID& dctnryOid, const OID& treeOid, const OID& listOid) + int dropDctnry(const TxnID& /*txnid*/, const OID& dctnryOid, const OID& /*treeOid*/, const OID& /*listOid*/) { return m_dctnry[0]->dropDctnry(dctnryOid); } diff --git a/writeengine/xml/we_xmljob.cpp b/writeengine/xml/we_xmljob.cpp index 96cd61d01..2a919bd5e 100644 --- a/writeengine/xml/we_xmljob.cpp +++ b/writeengine/xml/we_xmljob.cpp @@ -51,8 +51,7 @@ namespace WriteEngine // Constructor //------------------------------------------------------------------------------ XMLJob::XMLJob() - : fDebugLevel(DEBUG_0) - , fDeleteTempFile(false) + : fDeleteTempFile(false) , fValidateColList(true) , fTimeZone(dataconvert::systemTimeZoneOffset()) { @@ -1182,7 +1181,7 @@ void XMLJob::validateAllColumnsHaveTags(const execplan::CalpontSystemCatalog::RI //------------------------------------------------------------------------------ /* static */ int XMLJob::genJobXMLFileName(const string& sXMLJobDir, const string& jobDir, const string& jobId, - bool bTempFile, const string& schemaName, const string& tableName, + bool bTempFile, const string& /*schemaName*/, const string& /*tableName*/, boost::filesystem::path& xmlFilePath, string& errMsg, const std::string& tableOIDStr) { diff --git a/writeengine/xml/we_xmljob.h b/writeengine/xml/we_xmljob.h index 088a2c65b..c8b2cea41 100644 --- a/writeengine/xml/we_xmljob.h +++ b/writeengine/xml/we_xmljob.h @@ -142,7 +142,6 @@ class XMLJob : public XMLOp Job fJob; // current job xml - DebugLevel fDebugLevel; // internal use debug level bool fDeleteTempFile; // delete tmp jobfile in destructor std::string fJobFileName; // job file name JobColList fDefaultColumns; // temporary list of default cols