diff --git a/dbms/tests/queries/0_stateless/00060_date_lut.reference b/dbms/tests/queries/0_stateless/00060_date_lut.reference new file mode 100644 index 00000000000..aad30111128 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00060_date_lut.reference @@ -0,0 +1 @@ +1970-01-01 14:25:36 diff --git a/dbms/tests/queries/0_stateless/00060_date_lut.sql b/dbms/tests/queries/0_stateless/00060_date_lut.sql new file mode 100644 index 00000000000..1209be85fc5 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00060_date_lut.sql @@ -0,0 +1 @@ +SELECT toString(toDateTime('1970-01-01 14:25:36')) diff --git a/libs/libcommon/src/tests/date_lut4.cpp b/libs/libcommon/src/tests/date_lut4.cpp new file mode 100644 index 00000000000..0c6bcc82718 --- /dev/null +++ b/libs/libcommon/src/tests/date_lut4.cpp @@ -0,0 +1,20 @@ +#include +#include + + +int main(int argc, char ** argv) +{ + /** В DateLUT был глюк - для времён из дня 1970-01-01, возвращался номер часа больше 23. */ + static const time_t TIME = 66130; + + DateLUT & date_lut = DateLUT::instance(); + + std::cerr << date_lut.toHourInaccurate(TIME) << std::endl; + std::cerr << date_lut.toDayNum(TIME) << std::endl; + + const DateLUT::Values * values = reinterpret_cast(&date_lut); + + std::cerr << values[0].date << ", " << time_t(values[1].date - values[0].date) << std::endl; + + return 0; +}