fix bug about 0000 is not leap year

This commit is contained in:
obdev
2023-11-14 12:10:48 +00:00
committed by ob-robot
parent 0dbabdd890
commit efbd4ccfce
3 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ static const int8_t DAYS_OF_MON[2][12 + 1] = {
{0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
};
#define IS_LEAP_YEAR(y) ((((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) ? 1 : 0)
#define IS_LEAP_YEAR(y) (y == 0 ? 0 : ((((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) ? 1 : 0))
ObExprAlignDate4Cmp::ObExprAlignDate4Cmp(common::ObIAllocator &alloc)
: ObFuncExprOperator(alloc, T_FUN_SYS_ALIGN_DATE4CMP, N_ALIGN_DATE4CMP, 3, VALID_FOR_GENERATED_COL, NOT_ROW_DIMENSION)

View File

@ -51,7 +51,7 @@ static const int8_t DAYS_PER_MON[2][12 + 1] = {
{0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
};
#define IS_LEAP_YEAR(y) ((((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) ? 1 : 0)
#define IS_LEAP_YEAR(y) (y == 0 ? 0 : ((((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) ? 1 : 0))
const char *ObExprTRDateFormat::FORMATS_TEXT[FORMAT_MAX_TYPE] =