mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Addition to prev. revision [#CLICKHOUSE-2]
This commit is contained in:
parent
ff13752d01
commit
b9c4820bdd
@ -191,7 +191,8 @@ struct PositionImpl
|
||||
++i;
|
||||
}
|
||||
|
||||
memset(&res[i], 0, (res.size() - i) * sizeof(res[0]));
|
||||
if (i < res.size())
|
||||
memset(&res[i], 0, (res.size() - i) * sizeof(res[0]));
|
||||
}
|
||||
|
||||
/// Search for substring in string.
|
||||
@ -389,7 +390,8 @@ struct MatchImpl
|
||||
}
|
||||
|
||||
/// Tail, in which there can be no substring.
|
||||
memset(&res[i], revert, (res.size() - i) * sizeof(res[0]));
|
||||
if (i < res.size())
|
||||
memset(&res[i], revert, (res.size() - i) * sizeof(res[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -407,7 +409,8 @@ struct MatchImpl
|
||||
{
|
||||
if (!regexp->getRE2()) /// An empty regexp. Always matches.
|
||||
{
|
||||
memset(res.data(), 1, size * sizeof(res[0]));
|
||||
if (size)
|
||||
memset(res.data(), 1, size * sizeof(res[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -488,7 +491,8 @@ struct MatchImpl
|
||||
++i;
|
||||
}
|
||||
|
||||
memset(&res[i], revert, (res.size() - i) * sizeof(res[0]));
|
||||
if (i < res.size())
|
||||
memset(&res[i], revert, (res.size() - i) * sizeof(res[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -194,7 +194,8 @@ struct ExtractParamImpl
|
||||
++i;
|
||||
}
|
||||
|
||||
memset(&res[i], 0, (res.size() - i) * sizeof(res[0]));
|
||||
if (res.size() > i)
|
||||
memset(&res[i], 0, (res.size() - i) * sizeof(res[0]));
|
||||
}
|
||||
|
||||
static void constant_constant(const std::string & data, std::string needle, ResultType & res)
|
||||
|
@ -105,7 +105,7 @@ inline ALWAYS_INLINE void writeSlice(const Slice & slice, NullableArraySink<Arra
|
||||
|
||||
if (slice.size == 1) /// Always true for ValueSlice.
|
||||
sink.null_map[sink.current_offset] = 0;
|
||||
else
|
||||
else if (slice.size)
|
||||
memset(&sink.null_map[sink.current_offset], 0, slice.size * sizeof(UInt8));
|
||||
|
||||
writeSlice(slice, static_cast<ArraySink &>(sink));
|
||||
|
Loading…
Reference in New Issue
Block a user