未验证 提交 9a9581f9 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #22006 from ClickHouse/fix-ubsan-add-month

Fix UBSan report in addMonths
......@@ -1069,11 +1069,11 @@ public:
}
template <typename DateOrTime>
inline LUTIndex addMonthsIndex(DateOrTime v, Int64 delta) const
inline LUTIndex NO_SANITIZE_UNDEFINED addMonthsIndex(DateOrTime v, Int64 delta) const
{
const Values & values = lut[toLUTIndex(v)];
Int64 month = static_cast<Int64>(values.month) + delta;
Int64 month = values.month + delta;
if (month > 0)
{
......
-- Result does not make sense but UBSan report should not be triggered.
SELECT ignore(now() + INTERVAL 9223372036854775807 MONTH);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册