From de85e21c38e80ce9c6902ed21799a09f90b6b1ff Mon Sep 17 00:00:00 2001 From: Roman Nozdrin Date: Thu, 20 Feb 2020 22:28:38 +0000 Subject: [PATCH] MCOL-641 This commit cleans up Row methods and adds couple UT for Row. --- dbcon/execplan/simplecolumn.cpp | 4 +- dbcon/mysql/ha_mcs_impl.cpp | 8 +- primitives/primproc/columncommand.cpp | 2 +- primitives/primproc/passthrucommand.cpp | 2 +- utils/funcexp/funcexp.cpp | 4 +- utils/rowgroup/rowaggregation.cpp | 14 +- utils/rowgroup/rowgroup-tests.cpp | 162 +++++++++++++++++++----- utils/rowgroup/rowgroup.cpp | 39 +++--- utils/rowgroup/rowgroup.h | 58 ++++----- 9 files changed, 196 insertions(+), 97 deletions(-) diff --git a/dbcon/execplan/simplecolumn.cpp b/dbcon/execplan/simplecolumn.cpp index 96466403a..eeb287e53 100644 --- a/dbcon/execplan/simplecolumn.cpp +++ b/dbcon/execplan/simplecolumn.cpp @@ -716,7 +716,9 @@ void SimpleColumn::evaluate(Row& row, bool& isNull) case CalpontSystemCatalog::BINARY: { - fResult.strVal = row.getBinaryField(fInputIndex); + // WIP MCOL-641 Binary representation could contain \0. + std::string value(row.getBinaryField(fInputIndex)); + fResult.strVal.swap(value); break; } diff --git a/dbcon/mysql/ha_mcs_impl.cpp b/dbcon/mysql/ha_mcs_impl.cpp index e3662ddad..ea23b3f44 100644 --- a/dbcon/mysql/ha_mcs_impl.cpp +++ b/dbcon/mysql/ha_mcs_impl.cpp @@ -824,14 +824,14 @@ int fetchNextRow(uchar* buf, cal_table_info& ti, cal_connection_info* ci, bool h if (colType.colDataType == CalpontSystemCatalog::DECIMAL) { dec = row.getBinaryField(s); - dataconvert::DataConvert::decimalToString(dec, + dataconvert::DataConvert::decimalToString(dec, (unsigned)colType.scale, buf, sizeof(buf), colType.colDataType); } else { udec = row.getBinaryField(s); - dataconvert::DataConvert::decimalToString(udec, + dataconvert::DataConvert::decimalToString(udec, (unsigned)colType.scale, buf, sizeof(buf), colType.colDataType); } @@ -861,7 +861,9 @@ int fetchNextRow(uchar* buf, cal_table_info& ti, cal_connection_info* ci, bool h case CalpontSystemCatalog::BINARY: { Field_varstring* f2 = (Field_varstring*)*f; - f2->store(row.getBinaryField(s).c_str(), 16, f2->charset()); + // WIP MCOL-641 Binary representation could contain \0. + char* binaryString = row.getBinaryField(s); + f2->store(binaryString, colType.colWidth, f2->charset()); if ((*f)->null_ptr) *(*f)->null_ptr &= ~(*f)->null_bit; diff --git a/primitives/primproc/columncommand.cpp b/primitives/primproc/columncommand.cpp index 4d4d7bf79..0270c8f9a 100644 --- a/primitives/primproc/columncommand.cpp +++ b/primitives/primproc/columncommand.cpp @@ -814,7 +814,7 @@ void ColumnCommand::projectResultRG(RowGroup& rg, uint32_t pos) cout << __FILE__<< ":" <<__LINE__ << " ColumnCommand::projectResultRG " << endl; for (i = 0; i < outMsg->NVALS; ++i, msg8 += gapSize) { - r.setBinaryField(msg8, colType.colWidth, offset); + r.setBinaryField_offset(msg8, colType.colWidth, offset); r.nextRow(rowSize); } break; diff --git a/primitives/primproc/passthrucommand.cpp b/primitives/primproc/passthrucommand.cpp index d33d7a6f0..7e362b1a6 100644 --- a/primitives/primproc/passthrucommand.cpp +++ b/primitives/primproc/passthrucommand.cpp @@ -167,7 +167,7 @@ void PassThruCommand::projectIntoRowGroup(RowGroup& rg, uint32_t col) << *(((int64_t*) bpp->values[i]) +1) << endl; // values[i] is 8 bytes so it contains the pointer to bpp->outputMsg set by ColumnCommand::process_OT_BOTH() - r.setBinaryField((uint8_t*)bpp->values[i], 16, offset); + r.setBinaryField_offset((uint8_t*)bpp->values[i], 16, offset); r.nextRow(rowSize); } diff --git a/utils/funcexp/funcexp.cpp b/utils/funcexp/funcexp.cpp index cce824b47..854fbd8ed 100644 --- a/utils/funcexp/funcexp.cpp +++ b/utils/funcexp/funcexp.cpp @@ -477,11 +477,11 @@ void FuncExp::evaluate(rowgroup::Row& row, std::vector& expressi { // WIP make this a separate function w and w/o overflow check if (expression[i]->resultType().colDataType == execplan::CalpontSystemCatalog::DECIMAL) - row.setBinaryField(reinterpret_cast(&val.__v.__s128), + row.setBinaryField_offset(reinterpret_cast(&val.__v.__s128), expression[i]->resultType().colWidth, row.getOffset(expression[i]->outputIndex())); else - row.setBinaryField(reinterpret_cast(&val.__v.__u128), + row.setBinaryField_offset(reinterpret_cast(&val.__v.__u128), expression[i]->resultType().colWidth, row.getOffset(expression[i]->outputIndex())); } diff --git a/utils/rowgroup/rowaggregation.cpp b/utils/rowgroup/rowaggregation.cpp index e6baec5fc..da216c177 100755 --- a/utils/rowgroup/rowaggregation.cpp +++ b/utils/rowgroup/rowaggregation.cpp @@ -1483,19 +1483,19 @@ void RowAggregation::doSum(const Row& rowIn, int64_t colIn, int64_t colOut, int } else { + uint32_t offset = fRow.getOffset(colOut); if (colDataType == execplan::CalpontSystemCatalog::DECIMAL) { int128_t *dec = reinterpret_cast(wideValInPtr); - // WIP MCOL-641 Replace Row::setBinaryField1 if (isNull(fRowGroupOut, fRow, colOut)) { - fRow.setBinaryField1(dec, width, colOut); + fRow.setBinaryField_offset(dec, sizeof(*dec), offset); } else { - int128_t *valOutPtr = fRow.getBinaryField(colOut); + int128_t *valOutPtr = fRow.getBinaryField(valOutPtr, colOut); int128_t sum = *valOutPtr + *dec; - fRow.setBinaryField1(&sum, width, colOut); + fRow.setBinaryField_offset(&sum, sizeof(sum), offset); } } else @@ -1503,13 +1503,13 @@ void RowAggregation::doSum(const Row& rowIn, int64_t colIn, int64_t colOut, int uint128_t *dec = reinterpret_cast(wideValInPtr); if (isNull(fRowGroupOut, fRow, colOut)) { - fRow.setBinaryField1(dec, width, colOut); + fRow.setBinaryField_offset(dec, sizeof(*dec), offset); } else { - uint128_t *valOutPtr = fRow.getBinaryField(colOut); + uint128_t *valOutPtr = fRow.getBinaryField(valOutPtr, colOut); uint128_t sum = *valOutPtr + *dec; - fRow.setBinaryField1(&sum, width, colOut); + fRow.setBinaryField_offset(&sum, sizeof(sum), offset); } } } // end-of isWideDataType block diff --git a/utils/rowgroup/rowgroup-tests.cpp b/utils/rowgroup/rowgroup-tests.cpp index 7ef43a122..f68e5365e 100644 --- a/utils/rowgroup/rowgroup-tests.cpp +++ b/utils/rowgroup/rowgroup-tests.cpp @@ -2,41 +2,65 @@ #include "rowgroup.h" #include "columnwidth.h" #include "joblisttypes.h" +#include "iostream" -#define WIDE_DEC_PRECISION 38 +#define WIDE_DEC_PRECISION 38U #define INITIAL_ROW_OFFSET 2 using int128_t = __int128; using uint128_t = unsigned __int128; +using CSCDataType = execplan::CalpontSystemCatalog::ColDataType; -class RowTest : public ::testing::Test { +class RowDecimalTest : public ::testing::Test { protected: void SetUp() override { - uint8_t width = utils::widthByPrecision(WIDE_DEC_PRECISION); + uint32_t precision = WIDE_DEC_PRECISION; uint32_t oid =3001; - std::vector offsets, roids, tkeys, cscale, cprecision; - std::vector types; - offsets.push_back(INITIAL_ROW_OFFSET); - offsets.push_back(width+INITIAL_ROW_OFFSET); - offsets.push_back(width*2+INITIAL_ROW_OFFSET); - roids.push_back(oid); roids.push_back(oid+1); - tkeys.push_back(1); tkeys.push_back(1); + std::vectortypes; + std::vectorprecisionVec; + std::vector roids, tkeys, cscale; types.push_back(execplan::CalpontSystemCatalog::DECIMAL); types.push_back(execplan::CalpontSystemCatalog::UDECIMAL); - cscale.push_back(0); cscale.push_back(0); - cprecision.push_back(WIDE_DEC_PRECISION); - cprecision.push_back(WIDE_DEC_PRECISION); + for (size_t i=0; i <= 3; i++) { + types.push_back(execplan::CalpontSystemCatalog::DECIMAL); + } + precisionVec.push_back(precision); + precisionVec.push_back(precision); + precisionVec.push_back(18); + precisionVec.push_back(9); + precisionVec.push_back(4); + precisionVec.push_back(2); + std::vectorwidthVec; + uint32_t offset = INITIAL_ROW_OFFSET; + offsets.push_back(offset); + for (size_t i=0; i < types.size(); i++) { + uint8_t width = utils::widthByPrecision(precisionVec[i]); + widthVec.push_back(width); + offset += width; + offsets.push_back(offset); + roids.push_back(oid+i); + tkeys.push_back(i+1); cscale.push_back(0); + } + /*offsets.push_back(INITIAL_ROW_OFFSET); + offsets.push_back(16+INITIAL_ROW_OFFSET); + offsets.push_back(16*2+INITIAL_ROW_OFFSET); + roids.push_back(oid); roids.push_back(oid+1); + tkeys.push_back(1); tkeys.push_back(1); + cscale.push_back(0); cscale.push_back(0);*/ + rowgroup::RowGroup inRG(roids.size(), //column count offsets, //oldOffset roids, // column oids tkeys, //keys types, // types cscale, //scale - cprecision, // precision + precisionVec, // precision 20, // sTableThreshold false //useStringTable ); + + //std::cout << inRG.toString() << std::endl; rg = inRG; rgD.reinit(rg); rg.setData(&rgD); @@ -45,32 +69,61 @@ class RowTest : public ::testing::Test { rowSize = r.getSize(); rg.getRow(0, &r); - std::vector sValueVector; - std::vector uValueVector; int128_t nullValue = 0; + int128_t bigValue = 0; uint64_t* uint128_pod = reinterpret_cast(&nullValue); uint128_pod[0] = joblist::BINARYEMPTYROW; uint128_pod[1] = joblist::BINARYNULL; + bigValue = 42*0xFFFFFFFFFFFFFFFFLL; sValueVector.push_back(nullValue); sValueVector.push_back(-42); - sValueVector.push_back(-42*0xFFFFFFFFFFFFFFFFLL); + sValueVector.push_back(bigValue); sValueVector.push_back(0); sValueVector.push_back(nullValue-1); uValueVector.push_back(nullValue); uValueVector.push_back(42); - uValueVector.push_back(42*0xFFFFFFFFFFFFFFFFLL); + uValueVector.push_back(bigValue); uValueVector.push_back(0); - uValueVector.push_back(nullValue); uValueVector.push_back(nullValue-1); - for(size_t i = 0; i < sValueVector.size(); i++) - { - r.setBinaryField_offset(&sValueVector[i], - sizeof(sValueVector[0]), INITIAL_ROW_OFFSET); - r.setBinaryField_offset(&uValueVector[i], - sizeof(uValueVector[0]), INITIAL_ROW_OFFSET+width); + s8ValueVector.push_back(joblist::TINYINTNULL); + s8ValueVector.push_back(-0x79); + s8ValueVector.push_back(0); + s8ValueVector.push_back(0x81); + s8ValueVector.push_back(joblist::TINYINTNULL-1); + + s16ValueVector.push_back(joblist::SMALLINTNULL); + s16ValueVector.push_back(-0x79); + s16ValueVector.push_back(0); + s16ValueVector.push_back(0x81); + s16ValueVector.push_back(joblist::SMALLINTNULL-1); + + s32ValueVector.push_back(joblist::INTNULL); + s32ValueVector.push_back(-0x79); + s32ValueVector.push_back(0); + s32ValueVector.push_back(0x81); + s32ValueVector.push_back(joblist::INTNULL-1); + + s64ValueVector.push_back(joblist::INTNULL); + s64ValueVector.push_back(-0x79); + s64ValueVector.push_back(0); + s64ValueVector.push_back(0x81); + s64ValueVector.push_back(joblist::INTNULL-1); + + r.initToNull(); + r.nextRow(rowSize); + for(size_t i = 1; i < sValueVector.size(); i++) { + r.setBinaryField_offset(&sValueVector[i], + sizeof(sValueVector[0]), offsets[0]); + r.setBinaryField_offset(&uValueVector[i], + sizeof(uValueVector[0]), offsets[1]); + r.setIntField(s64ValueVector[i], 2); + r.setIntField(s32ValueVector[i], 3); + r.setIntField(s16ValueVector[i], 4); + r.setIntField(s8ValueVector[i], 5); + //std::cout << r.toString() << std::endl; r.nextRow(rowSize); } rowCount = sValueVector.size(); @@ -82,29 +135,70 @@ class RowTest : public ::testing::Test { rowgroup::RGData rgD; uint32_t rowSize; size_t rowCount; + std::vector sValueVector; + std::vector uValueVector; + std::vector s8ValueVector; + std::vector s16ValueVector; + std::vector s32ValueVector; + std::vector s64ValueVector; + std::vector offsets; }; -TEST_F(RowTest, NonNULLValuesCheck) { +TEST_F(RowDecimalTest, NonNULLValuesCheck) { rg.getRow(1, &r); - for (size_t i = 0; i <= rg.getRowCount(); i++) - { + for (size_t i = 1; i <= sValueVector.size(); i++) { EXPECT_FALSE(r.isNullValue(0)); EXPECT_FALSE(r.isNullValue(1)); + EXPECT_FALSE(r.isNullValue(2)); + EXPECT_FALSE(r.isNullValue(3)); + EXPECT_FALSE(r.isNullValue(4)); + EXPECT_FALSE(r.isNullValue(5)); r.nextRow(rowSize); } } -TEST_F(RowTest, NULLValuesCheck) { +TEST_F(RowDecimalTest, initToNullANDisNullValueValueCheck) { rg.getRow(0, &r); EXPECT_TRUE(r.isNullValue(0)); EXPECT_TRUE(r.isNullValue(1)); + EXPECT_TRUE(r.isNullValue(2)); + EXPECT_TRUE(r.isNullValue(3)); + EXPECT_TRUE(r.isNullValue(4)); + EXPECT_TRUE(r.isNullValue(5)); +} + +TEST_F(RowDecimalTest, getBinaryFieldCheck) { + rg.getRow(0, &r); + uint128_t* u128Value; + int128_t* s128Value; +// std::remove_reference::type uType; +// std::remove_reference::type sType; + + for (size_t i = 0; i < sValueVector.size(); i++) { + s128Value = r.getBinaryField(0); + EXPECT_EQ(*s128Value, sValueVector[i]); + u128Value = r.getBinaryField(1); + EXPECT_EQ(*u128Value, uValueVector[i]); + //EXPECT_EQ(r.getIntField(2),s64ValueVector[i]); + //EXPECT_EQ(r.getIntField(3),s32ValueVector[i]); + //EXPECT_EQ(r.getIntField(4),s16ValueVector[i]); + //EXPECT_EQ(r.getIntField(5),s8ValueVector[i]); + r.nextRow(rowSize); + } +} +TEST_F(RowDecimalTest, toStringCheck) { + std::string exemplar1("0: NULL NULL NULL NULL NULL NULL "); + rg.getRow(0, &r); + EXPECT_EQ(r.toString(), exemplar1); + r.nextRow(rowSize); + std::cout << r.toString() << std::endl; + r.nextRow(rowSize); + std::cout << r.toString() << std::endl; + r.nextRow(rowSize); + std::cout << r.toString() << std::endl; } -//Row::isNullValue_offset //toString -//initToNull //toCSV //applyMapping -//setBinaryField remove Field1 and combine setBinaryField -//getBinaryField -//Remove from set/getIntFields Varbinary +//equals diff --git a/utils/rowgroup/rowgroup.cpp b/utils/rowgroup/rowgroup.cpp index b3fb50084..46971ae81 100644 --- a/utils/rowgroup/rowgroup.cpp +++ b/utils/rowgroup/rowgroup.cpp @@ -43,6 +43,7 @@ using namespace execplan; #include "nullvaluemanip.h" #include "rowgroup.h" #include "dataconvert.h" +#include "columnwidth.h" #include "collation.h" @@ -636,16 +637,17 @@ string Row::toString() const break; // WIP case CalpontSystemCatalog::DECIMAL: - if (precision[i] > 18) + case CalpontSystemCatalog::UDECIMAL: + if (colWidths[i] > MAXLEGACYWIDTH) { char *buf = (char*)alloca(precision[i] + 3); // empty the buffer - dataconvert::DataConvert::toString(getBinaryField(i), + dataconvert::DataConvert::toString(getBinaryField(i), buf, precision[i]+3); os << buf << " "; break; } - // fallback if the precision < 18 + // fallback if the the legacy DECIMAL default: os << getIntField(i) << " "; break; @@ -708,7 +710,8 @@ string Row::toCSV() const break; } case CalpontSystemCatalog::BINARY: - std::cout << __FILE__<< __LINE__ << ":" << "toCSV"<< std::endl; + std::cout << __FILE__<< __LINE__ << ":" << "toCSV"<< std::endl; + default: os << getIntField(i); break; @@ -877,7 +880,13 @@ void Row::initToNull() *((uint64_t*) &data[offsets[i]]) = joblist::UBIGINTNULL; break; case CalpontSystemCatalog::BINARY: - std::cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << std::endl; + { + uint64_t *dec = reinterpret_cast(&data[offsets[i]]); + dec[0] = joblist::BINARYEMPTYROW; + dec[1] = joblist::BINARYNULL; + } + break; + default: ostringstream os; os << "Row::initToNull(): got bad column type (" << types[i] << @@ -888,7 +897,7 @@ void Row::initToNull() } } -template +template inline bool Row::isNullValue_offset(uint32_t offset) const { ostringstream os; @@ -1052,21 +1061,13 @@ bool Row::isNullValue(uint32_t colIndex) const case CalpontSystemCatalog::UDECIMAL: { // WIP MCOL-641 Allmighty hack. - const uint32_t len = 16; - uint32_t* lenPtr = const_cast(&len); - *lenPtr = getColumnWidth(colIndex); - return isNullValue_offset - (offsets[colIndex]); - -// WIP -/* - const int64_t *dec; - switch (len) + int32_t width = getColumnWidth(colIndex); + switch (width) { // MCOL-641 case 16: return isNullValue_offset - (offsets[colIndex]); + (offsets[colIndex]); case 1 : return (data[offsets[colIndex]] == joblist::TINYINTNULL); @@ -1080,7 +1081,7 @@ bool Row::isNullValue(uint32_t colIndex) const default: return (*((int64_t*) &data[offsets[colIndex]]) == static_cast(joblist::BIGINTNULL)); } -*/ + break; } @@ -1647,7 +1648,7 @@ void applyMapping(const int* mapping, const Row& in, Row* out) // code precision 2 width convertor else if (UNLIKELY(in.getColTypes()[i] == execplan::CalpontSystemCatalog::DECIMAL && in.getColumnWidth(i) == 16)) - out->setBinaryField(in.getBinaryField(i), 16, + out->setBinaryField_offset(in.getBinaryField(i), 16, out->getOffset(mapping[i])); else if (in.isUnsigned(i)) out->setUintField(in.getUintField(i), mapping[i]); diff --git a/utils/rowgroup/rowgroup.h b/utils/rowgroup/rowgroup.h index 67668501c..6a2bc7961 100644 --- a/utils/rowgroup/rowgroup.h +++ b/utils/rowgroup/rowgroup.h @@ -424,9 +424,8 @@ public: inline uint32_t getStringLength(uint32_t colIndex) const; void setStringField(const std::string& val, uint32_t colIndex); inline void setStringField(const uint8_t*, uint32_t len, uint32_t colIndex); - inline void setBinaryField(const uint8_t* strdata, uint32_t length, uint32_t offset); template - inline void setBinaryField1(T* strdata, uint32_t width, uint32_t colIndex); + inline void setBinaryField(T* strdata, uint32_t width, uint32_t colIndex); template inline void setBinaryField_offset(T* strdata, uint32_t width, uint32_t colIndex); // support VARBINARY @@ -440,9 +439,12 @@ public: inline const uint8_t* getVarBinaryField(uint32_t& len, uint32_t colIndex) const; inline void setVarBinaryField(const uint8_t* val, uint32_t len, uint32_t colIndex); - inline std::string getBinaryField(uint32_t colIndex) const; + //inline std::string getBinaryField(uint32_t colIndex) const; template inline T* getBinaryField(uint32_t colIndex) const; + // To simplify parameter type deduction. + template + inline T* getBinaryField(T* argtype, uint32_t colIndex) const; template inline T* getBinaryField_offset(uint32_t offset) const; @@ -453,7 +455,7 @@ public: uint64_t getNullValue(uint32_t colIndex) const; bool isNullValue(uint32_t colIndex) const; - template + template inline bool isNullValue_offset(uint32_t offset) const; // when NULLs are pulled out via getIntField(), they come out with these values. @@ -803,18 +805,21 @@ inline uint32_t Row::getStringLength(uint32_t colIndex) const return strnlen((char*) &data[offsets[colIndex]], getColumnWidth(colIndex)); } +// WIP Remove this // Check whether memcpy affects perf here -inline void Row::setBinaryField(const uint8_t* strdata, uint32_t length, uint32_t offset) +/*inline void Row::setBinaryField(const uint8_t* strdata, uint32_t length, uint32_t offset) { memcpy(&data[offset], strdata, length); -} +}*/ +// WIP MCOL-641. This method can be applied to uint8_t* buffers. template -inline void Row::setBinaryField1(T* value, uint32_t width, uint32_t colIndex) +inline void Row::setBinaryField(T* value, uint32_t width, uint32_t colIndex) { - memcpy(&data[offsets[colIndex]], value, width); + memcpy(&data[offsets[colIndex]], value, width); } +// WIP MCOL-641. This method !cannot! be applied to uint8_t* buffers. template inline void Row::setBinaryField_offset(T* value, uint32_t width, uint32_t offset) { @@ -856,16 +861,24 @@ inline std::string Row::getStringField(uint32_t colIndex) const strnlen((char*) &data[offsets[colIndex]], getColumnWidth(colIndex))); } -inline std::string Row::getBinaryField(uint32_t colIndex) const +/*inline std::string Row::getBinaryField(uint32_t colIndex) const { return std::string((char*) &data[offsets[colIndex]], getColumnWidth(colIndex)); -} +}*/ // WIP MCOL-641 template inline T* Row::getBinaryField(uint32_t colIndex) const { - return reinterpret_cast(&data[offsets[colIndex]]); + //return reinterpret_cast(&data[offsets[colIndex]]); + return getBinaryField_offset(offsets[colIndex]); +} + +template +inline T* Row::getBinaryField(T* argtype, uint32_t colIndex) const +{ + //return reinterpret_cast(&data[offsets[colIndex]]); + return getBinaryField_offset(offsets[colIndex]); } template @@ -874,7 +887,6 @@ inline T* Row::getBinaryField_offset(uint32_t offset) const return reinterpret_cast(&data[offset]); } - inline std::string Row::getVarBinaryStringField(uint32_t colIndex) const { if (inStringTable(colIndex)) @@ -994,12 +1006,7 @@ inline void Row::setUintField_offset(uint64_t val, uint32_t offset) case 8: *((uint64_t*) &data[offset]) = val; break; - /* This doesn't look like appropriate place - case 16: - std::cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << std::endl; - *((uint64_t*) &data[offset]) = val; - break; - */ + default: idbassert(0); throw std::logic_error("Row::setUintField called on a non-uint32_t field"); @@ -1037,10 +1044,7 @@ inline void Row::setUintField(uint64_t val, uint32_t colIndex) case 8: *((uint64_t*) &data[offsets[colIndex]]) = val; break; - case 16: - std::cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << std::endl; - *((uint64_t*) &data[offsets[colIndex]]) = val; - break; + default: idbassert(0); throw std::logic_error("Row::setUintField called on a non-uint32_t field"); @@ -1066,9 +1070,7 @@ inline void Row::setUintField(uint64_t val, uint32_t colIndex) case 8: *((uint64_t*) &data[offsets[colIndex]]) = val; break; - case 16: - std::cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << std::endl; - *((uint64_t*) &data[offsets[colIndex]]) = val; + default: idbassert(0); throw std::logic_error("Row::setUintField: bad length"); @@ -1095,8 +1097,7 @@ inline void Row::setIntField(int64_t val, uint32_t colIndex) case 8: *((int64_t*) &data[offsets[colIndex]]) = val; break; - case 16: - std::cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << std::endl; + default: idbassert(0); throw std::logic_error("Row::setIntField: bad length"); @@ -1122,8 +1123,7 @@ inline void Row::setIntField(int64_t val, uint32_t colIndex) case 8: *((int64_t*) &data[offsets[colIndex]]) = val; break; - case 16: - std::cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << std::endl; + default: idbassert(0); throw std::logic_error("Row::setIntField: bad length");