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
@ -28,10 +28,12 @@ CalpontSystemCatalog::ColType Func_json_contains_path::operationType(
|
||||
bool Func_json_contains_path::getBoolVal(Row& row, FunctionParm& fp, bool& isNull,
|
||||
CalpontSystemCatalog::ColType& type)
|
||||
{
|
||||
const string_view js = fp[0]->data()->getStrVal(row, isNull);
|
||||
const auto& js_ns = fp[0]->data()->getStrVal(row, isNull);
|
||||
if (isNull)
|
||||
return false;
|
||||
|
||||
const string_view js = js_ns.unsafeStringRef();
|
||||
|
||||
#ifdef MYSQL_GE_1009
|
||||
int arrayCounters[JSON_DEPTH_LIMIT];
|
||||
bool hasNegPath = false;
|
||||
@ -43,9 +45,10 @@ bool Func_json_contains_path::getBoolVal(Row& row, FunctionParm& fp, bool& isNul
|
||||
if (!isModeConst)
|
||||
isModeConst = (dynamic_cast<ConstantColumn*>(fp[1]->data()) != nullptr);
|
||||
|
||||
string mode = fp[1]->data()->getStrVal(row, isNull);
|
||||
auto mode_ns = fp[1]->data()->getStrVal(row, isNull);
|
||||
if (isNull)
|
||||
return false;
|
||||
string mode = mode_ns.unsafeStringRef();
|
||||
|
||||
transform(mode.begin(), mode.end(), mode.begin(), ::tolower);
|
||||
if (mode != "one" && mode != "all")
|
||||
|
Reference in New Issue
Block a user