You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-271 empty strings should not be NULLs (#2794)
This patch improves handling of NULLs in textual fields in ColumnStore. Previously empty strings were considered NULLs and it could be a problem if data scheme allows for empty strings. It was also one of major reasons of behavior difference between ColumnStore and other engines in MariaDB family. Also, this patch fixes some other bugs and incorrect behavior, for example, incorrect comparison for "column <= ''" which evaluates to constant True for all purposes before this patch.
This commit is contained in:
committed by
Roman Nozdrin
parent
0ea592da80
commit
b53c231ca6
@ -348,16 +348,16 @@ 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)
|
||||
{
|
||||
string exp1 = parm[0]->data()->getStrVal(row, isNull);
|
||||
string exp1 = parm[0]->data()->getStrVal(row, isNull).safeString("");
|
||||
CHARSET_INFO* cs = parm[0]->data()->resultType().getCharset();
|
||||
|
||||
if (isNull)
|
||||
{
|
||||
isNull = false;
|
||||
// NULLIF(NULL, ...) is NULL, according to server's results.
|
||||
return "";
|
||||
}
|
||||
|
||||
string exp2 = parm[1]->data()->getStrVal(row, isNull);
|
||||
string exp2 = parm[1]->data()->getStrVal(row, isNull).safeString("");
|
||||
|
||||
if (isNull)
|
||||
{
|
||||
@ -388,7 +388,7 @@ string Func_nullif::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNu
|
||||
return "";
|
||||
}
|
||||
|
||||
return parm[0]->data()->getStrVal(row, isNull);
|
||||
return parm[0]->data()->getStrVal(row, isNull).safeString("");
|
||||
}
|
||||
|
||||
int32_t Func_nullif::getDateIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull,
|
||||
|
Reference in New Issue
Block a user