[Bug](timediff) Fix wrong result for function timediff (#15312)
This commit is contained in:
@ -186,7 +186,7 @@ TEST(VTimestampFunctionsTest, timediff_test) {
|
||||
{{std::string("2019-00-18 12:00:00"), std::string("2019-07-18 13:01:02")}, Null()},
|
||||
{{std::string("2019-07-18 12:00:00"), std::string("2019-07-00 13:01:02")}, Null()}};
|
||||
|
||||
check_function<DataTypeFloat64, true>(func_name, input_types, data_set);
|
||||
check_function<DataTypeTime, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
TEST(VTimestampFunctionsTest, date_format_test) {
|
||||
@ -849,7 +849,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
|
||||
{{std::string("2019-00-18"), std::string("2019-07-18")}, Null()},
|
||||
{{std::string("2019-07-18"), std::string("2019-07-00")}, Null()}};
|
||||
|
||||
check_function<DataTypeFloat64, true>(func_name, input_types, data_set);
|
||||
check_function<DataTypeTime, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
{
|
||||
@ -860,7 +860,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
|
||||
{{std::string("2019-00-18"), std::string("2019-07-18")}, Null()},
|
||||
{{std::string("2019-07-18"), std::string("2019-07-00")}, Null()}};
|
||||
|
||||
check_function<DataTypeFloat64, true>(func_name, input_types, data_set);
|
||||
check_function<DataTypeTime, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
{
|
||||
@ -871,7 +871,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
|
||||
{{std::string("2019-00-18"), std::string("2019-07-18")}, Null()},
|
||||
{{std::string("2019-07-18"), std::string("2019-07-00")}, Null()}};
|
||||
|
||||
check_function<DataTypeFloat64, true>(func_name, input_types, data_set);
|
||||
check_function<DataTypeTime, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
{
|
||||
@ -883,7 +883,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
|
||||
{{std::string("2019-00-18 00:00:00"), std::string("2019-07-18")}, Null()},
|
||||
{{std::string("2019-07-18 00:00:00"), std::string("2019-07-00")}, Null()}};
|
||||
|
||||
check_function<DataTypeFloat64, true>(func_name, input_types, data_set);
|
||||
check_function<DataTypeTime, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
{
|
||||
@ -895,7 +895,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
|
||||
{{std::string("2019-00-18"), std::string("2019-07-18 00:00:00")}, Null()},
|
||||
{{std::string("2019-07-18"), std::string("2019-07-00 00:00:00")}, Null()}};
|
||||
|
||||
check_function<DataTypeFloat64, true>(func_name, input_types, data_set);
|
||||
check_function<DataTypeTime, true>(func_name, input_types, data_set);
|
||||
}
|
||||
{
|
||||
InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::DateTimeV2};
|
||||
@ -906,7 +906,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
|
||||
{{std::string("2019-00-18 00:00:00"), std::string("2019-07-18 00:00:00")}, Null()},
|
||||
{{std::string("2019-07-18 00:00:00"), std::string("2019-07-00 00:00:00")}, Null()}};
|
||||
|
||||
check_function<DataTypeFloat64, true>(func_name, input_types, data_set);
|
||||
check_function<DataTypeTime, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
{
|
||||
@ -918,7 +918,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
|
||||
{{std::string("2019-00-18 00:00:00"), std::string("2019-07-18")}, Null()},
|
||||
{{std::string("2019-07-18 00:00:00"), std::string("2019-07-00")}, Null()}};
|
||||
|
||||
check_function<DataTypeFloat64, true>(func_name, input_types, data_set);
|
||||
check_function<DataTypeTime, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
{
|
||||
@ -930,7 +930,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
|
||||
{{std::string("2019-00-18"), std::string("2019-07-18 00:00:00")}, Null()},
|
||||
{{std::string("2019-07-18"), std::string("2019-07-00 00:00:00")}, Null()}};
|
||||
|
||||
check_function<DataTypeFloat64, true>(func_name, input_types, data_set);
|
||||
check_function<DataTypeTime, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
{
|
||||
@ -942,7 +942,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
|
||||
{{std::string("2019-00-18 00:00:00"), std::string("2019-07-18 00:00:00")}, Null()},
|
||||
{{std::string("2019-07-18 00:00:00"), std::string("2019-07-00 00:00:00")}, Null()}};
|
||||
|
||||
check_function<DataTypeFloat64, true>(func_name, input_types, data_set);
|
||||
check_function<DataTypeTime, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
{
|
||||
@ -957,7 +957,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
|
||||
{{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-00 00:00:00")},
|
||||
Null()}};
|
||||
|
||||
check_function<DataTypeFloat64, true>(func_name, input_types, data_set);
|
||||
check_function<DataTypeTime, true>(func_name, input_types, data_set);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user