提交 b9c4820b 编写于 作者: A Alexey Milovidov

Addition to prev. revision [#CLICKHOUSE-2]

上级 ff13752d
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册