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
@ -48,14 +48,16 @@ std::string Func_substring_index::getStrVal(rowgroup::Row& row, FunctionParm& fp
|
||||
{
|
||||
CHARSET_INFO* cs = ct.getCharset();
|
||||
|
||||
const string& str = fp[0]->data()->getStrVal(row, isNull);
|
||||
if (isNull)
|
||||
const auto& nstr = fp[0]->data()->getStrVal(row, isNull);
|
||||
if (nstr.isNull())
|
||||
return "";
|
||||
const auto& str = nstr.unsafeStringRef();
|
||||
int64_t strLen = str.length();
|
||||
|
||||
const string& delimstr = fp[1]->data()->getStrVal(row, isNull);
|
||||
if (isNull)
|
||||
const auto& ndelimstr = fp[1]->data()->getStrVal(row, isNull);
|
||||
if (ndelimstr.isNull())
|
||||
return "";
|
||||
const auto& delimstr = ndelimstr.unsafeStringRef();
|
||||
int64_t delimLen = delimstr.length();
|
||||
|
||||
int64_t count = fp[2]->data()->getIntVal(row, isNull);
|
||||
|
Reference in New Issue
Block a user