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:
Markus Mäkelä
2019-02-05 14:04:27 +02:00
parent 554f1cc41c
commit cf4724d128
2 changed files with 40 additions and 4 deletions

View File

@ -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}