1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-4726 Wrong result of WHERE char1_col='A'

This commit is contained in:
Alexander Barkov
2021-05-21 14:34:55 +04:00
parent 6448742225
commit 284fc51bb7
53 changed files with 2695 additions and 27 deletions

View File

@ -604,8 +604,8 @@ inline bool colCompare(int64_t val1, int64_t val2, uint8_t COP, uint8_t rf,
if ((typeHolder.getCharset().state & (MY_CS_BINSORT|MY_CS_NOPAD)) ==
(MY_CS_BINSORT|MY_CS_NOPAD))
return colCompare_(order_swap(val1), order_swap(val2), COP);
utils::ConstString s1 = {reinterpret_cast<const char*>(&val1), 8};
utils::ConstString s2 = {reinterpret_cast<const char*>(&val2), 8};
utils::ConstString s1 = {reinterpret_cast<const char*>(&val1), width};
utils::ConstString s2 = {reinterpret_cast<const char*>(&val2), width};
return colCompareStr(typeHolder, COP, s1.rtrimZero(), s2.rtrimZero());
}
else
@ -1303,10 +1303,10 @@ inline void p_Col_ridArray(NewColRequestHeader* in,
if (out->ValidMinMax && !isNull && !isEmpty)
{
if ((in->colType.DataType == CalpontSystemCatalog::CHAR ||
in->colType.DataType == CalpontSystemCatalog::VARCHAR ||
in->colType.DataType == CalpontSystemCatalog::BLOB ||
in->colType.DataType == CalpontSystemCatalog::TEXT ) && 1 < W)
if (in->colType.DataType == CalpontSystemCatalog::CHAR ||
in->colType.DataType == CalpontSystemCatalog::VARCHAR ||
in->colType.DataType == CalpontSystemCatalog::BLOB ||
in->colType.DataType == CalpontSystemCatalog::TEXT )
{
if (colCompare(out->Min, val, COMPARE_GT, false, in->colType, W))
out->Min = val;

View File

@ -620,8 +620,8 @@ bool StrFilterCmd::compare_cc(uint64_t i, uint64_t j)
datatypes::Charset cs(leftColType.getCharset());
datatypes::TCharShort s0(bpp->fFiltCmdValues[0][i]);
datatypes::TCharShort s1(bpp->fFiltCmdValues[1][j]);
return compareString(cs, static_cast<utils::ConstString>(s0),
static_cast<utils::ConstString>(s1), fBOP);
return compareString(cs, s0.toConstString(leftColType.colWidth),
s1.toConstString(rightColType.colWidth), fBOP);
}
@ -647,7 +647,7 @@ bool StrFilterCmd::compare_cs(uint64_t i, uint64_t j)
datatypes::Charset cs(leftColType.getCharset());
datatypes::TCharShort s0(bpp->fFiltCmdValues[0][i]);
utils::ConstString s1(bpp->fFiltStrValues[1][j]);
return compareString(cs, static_cast<utils::ConstString>(s0), s1, fBOP);
return compareString(cs, s0.toConstString(leftColType.colWidth), s1, fBOP);
}
@ -660,7 +660,7 @@ bool StrFilterCmd::compare_sc(uint64_t i, uint64_t j)
datatypes::Charset cs(leftColType.getCharset());
utils::ConstString s0(bpp->fFiltStrValues[0][i]);
datatypes::TCharShort s1(bpp->fFiltCmdValues[1][j]);
return compareString(cs, s0, static_cast<utils::ConstString>(s1), fBOP);
return compareString(cs, s0, s1.toConstString(rightColType.colWidth), fBOP);
}