MXS-2265: Fix formatting of the zero timestamp
The UNIX timestamp 0 should be treated as a special value and must be interpreted as 0-00-00 00:00:00 instead of 1970-01-01 00:00:00.
This commit is contained in:
@ -99,8 +99,6 @@ static const char* datetime_types[] =
|
||||
"DATETIME(4)",
|
||||
"DATETIME(5)",
|
||||
"DATETIME(6)",
|
||||
// TODO: Fix test setup to use same timezone
|
||||
// "TIMESTAMP",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -112,6 +110,19 @@ static const char* datetime_values[] =
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char* timestamp_types[] =
|
||||
{
|
||||
"TIMESTAMP",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char* timestamp_values[] =
|
||||
{
|
||||
"'2018-01-01 11:11:11'",
|
||||
"'0-00-00 00:00:00'",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char* date_types[] =
|
||||
{
|
||||
"DATE",
|
||||
@ -156,6 +167,7 @@ struct
|
||||
{string_types, string_values},
|
||||
{binary_types, binary_values},
|
||||
{datetime_types, datetime_values},
|
||||
{timestamp_types, timestamp_values},
|
||||
{date_types, date_values},
|
||||
{time_types, time_values},
|
||||
{0, 0}
|
||||
|
||||
Reference in New Issue
Block a user