[Fix](from_unixtime) Keep consistent with MySQL & bug fix (#25966)

Bug fix: implicit convert from int32 -> int64 makes negative time stamp valid, so change signature to int64
Consistent: keep consistent with mysql.
This commit is contained in:
zhiqiang
2023-10-31 01:31:24 -05:00
committed by GitHub
parent 8d7abf60f9
commit 0449a240f4
17 changed files with 112 additions and 52 deletions

View File

@ -179,9 +179,10 @@ TEST(VTimestampFunctionsTest, from_unix_test) {
std::string func_name = "from_unixtime";
TimezoneUtils::load_timezone_names();
InputTypeSet input_types = {TypeIndex::Int32};
InputTypeSet input_types = {TypeIndex::Int64};
DataSet data_set = {{{1565080737}, std::string("2019-08-06 16:38:57")}, {{-123}, Null()}};
DataSet data_set = {{{int64_t(1565080737)}, std::string("2019-08-06 16:38:57")},
{{int64_t(-123)}, Null()}};
static_cast<void>(check_function<DataTypeString, true>(func_name, input_types, data_set));
}