1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

MCOL-4171

This commit is contained in:
David Hall
2020-07-30 17:28:11 -05:00
committed by Roman Nozdrin
parent 5287e6860b
commit 638202417f
40 changed files with 807 additions and 250 deletions

View File

@@ -196,7 +196,7 @@ public:
return TreeNode::getBoolVal();
}
void adjustResultType(const CalpontSystemCatalog::ColType& m);
constexpr inline bool getOverflowCheck() const
const inline bool getOverflowCheck() const
{
return fDecimalOverflowCheck;
}

View File

@@ -503,7 +503,7 @@ bool SimpleColumn::singleTable(CalpontSystemCatalog::TableAliasName& tan)
void SimpleColumn::evaluate(Row& row, bool& isNull)
{
// WIP Move this block into an appropriate place
if (UNLIKELY(fInputOffset == -1))
if (UNLIKELY((int)(fInputOffset == (uint32_t)-1)))
{
fInputOffset = row.getOffset(fInputIndex);
}

View File

@@ -52,6 +52,8 @@ using namespace rowgroup;
#include "joblisttypes.h"
using namespace joblist;
#include "widedecimalutils.h"
#ifdef _MSC_VER
#define strcasecmp stricmp
#endif
@@ -387,9 +389,16 @@ void WindowFunctionColumn::adjustResultType()
boost::iequals(fFunctionName, "AVG") ||
boost::iequals(fFunctionName, "AVG_DISTINCT"))
{
fResultType.colDataType = CalpontSystemCatalog::LONGDOUBLE;
fResultType.colWidth = sizeof(long double);
fResultType.precision = -1;
if (fFunctionParms[0]->resultType().colDataType == CalpontSystemCatalog::DECIMAL)
{
fResultType.colWidth = sizeof(int128_t);
}
else
{
fResultType.colDataType = CalpontSystemCatalog::LONGDOUBLE;
fResultType.colWidth = sizeof(long double);
fResultType.precision = -1;
}
}
}
@@ -661,18 +670,35 @@ void WindowFunctionColumn::evaluate(Row& row, bool& isNull)
break;
}
default:
case 8:
{
if (row.equals<8>(BIGINTNULL, fInputIndex))
isNull = true;
else
{
fResult.decimalVal.value = (int64_t)row.getUintField<8>(fInputIndex);
fResult.decimalVal.value = row.getIntField<8>(fInputIndex);
fResult.decimalVal.scale = (unsigned)fResultType.scale;
}
break;
}
case 16:
{
int128_t dec = row.getInt128Field(fInputIndex);
if (utils::isWideDecimalNullValue(dec))
isNull = true;
else
{
fResult.decimalVal.s128Value = dec;
fResult.decimalVal.scale = (unsigned)fResultType.scale;
}
break;
}
default:
// Should log error
break;
}
break;

View File

@@ -938,7 +938,7 @@ void GroupConcatOrderBy::getResult(uint8_t* buff, const string& sep)
rowStack.pop();
}
size_t resultSize = oss.str().size();
int64_t resultSize = oss.str().size();
resultSize = (resultSize > fGroupConcatLen) ? fGroupConcatLen : resultSize;
fOutputString.reset(new uint8_t[resultSize + 2]);
fOutputString[resultSize] = '\0';
@@ -1102,7 +1102,7 @@ void GroupConcatNoOrder::getResult(uint8_t* buff, const string& sep)
fDataQueue.pop();
}
size_t resultSize = oss.str().size();
int64_t resultSize = oss.str().size();
resultSize = (resultSize > fGroupConcatLen) ? fGroupConcatLen : resultSize;
fOutputString.reset(new uint8_t[resultSize + 2]);
fOutputString[resultSize] = '\0';

View File

@@ -2342,9 +2342,9 @@ int ha_mcs_impl_discover_existence(const char* schema, const char* name)
int ha_mcs_impl_direct_update_delete_rows(bool execute, ha_rows *affected_rows, const std::vector<COND*>& condStack)
{
THD* thd = current_thd;
int rc = 0;
cal_impl_if::gp_walk_info gwi;
gwi.thd = thd;
int rc = 0;
if (thd->slave_thread && !get_replication_slave(thd) && (
thd->lex->sql_command == SQLCOM_INSERT ||