Skip to content

Commit

Permalink
fix compile error (#2362)
Browse files Browse the repository at this point in the history
  • Loading branch information
leiysky authored Jul 9, 2021
1 parent fc39209 commit edd46f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dbms/src/Common/MyTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit edd46f4

Please sign in to comment.