From edd46f4df53ef372680e2a1ab2b244c48250469f Mon Sep 17 00:00:00 2001 From: Yu Lei Date: Fri, 9 Jul 2021 15:48:16 +0800 Subject: [PATCH] fix compile error (#2362) --- dbms/src/Common/MyTime.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/Common/MyTime.cpp b/dbms/src/Common/MyTime.cpp index f4831a69e59..b249d2db136 100644 --- a/dbms/src/Common/MyTime.cpp +++ b/dbms/src/Common/MyTime.cpp @@ -936,7 +936,7 @@ void MyTimeBase::check(bool allow_zero_in_date, bool allow_invalid_date) const { if (!allow_zero_in_date && (month == 0 || day == 0)) { - char buff[] = "0000-00-00"; + char buff[32] = "0000-00-00"; std::sprintf(buff, "%04d-%02d-%02d", year, month, day); throw TiFlashException("Incorrect datetime value: " + String(buff), Errors::Types::WrongValue); } @@ -960,7 +960,7 @@ void MyTimeBase::check(bool allow_zero_in_date, bool allow_invalid_date) const } if (day > max_day) { - char buff[] = "0000-00-00"; + char buff[32] = "0000-00-00"; std::sprintf(buff, "%04d-%02d-%02d", year, month, day); throw TiFlashException("Incorrect datetime value: " + String(buff), Errors::Types::WrongValue); }