diff --git a/tests/queries/0_stateless/01521_format_readable_time_delta2.reference b/tests/queries/0_stateless/01521_format_readable_time_delta2.reference new file mode 100644 index 00000000000..96b135cdc63 --- /dev/null +++ b/tests/queries/0_stateless/01521_format_readable_time_delta2.reference @@ -0,0 +1,20 @@ +-1 year, 1 month, 1 day, 1 hour, 1 minute and 1 second +-1 year, 1 month, 1 day, 1 hour, 1 minute and 1 second +-13 months, 1 hour, 1 minute and 1 second +-396 days, 13 hours, 1 minute and 1 second +-9517 hours, 1 minute and 1 second +-571021 minutes and 1 second +-34261261 seconds +-1 year, 1 month, 1 day, 1 hour and 1 minute +-1 year, 1 month, 1 day, 1 hour and 1 second +-1 year, 1 month, 1 day, 1 minute and 1 second +-1 year, 1 month, 1 hour, 1 minute and 1 second +-1 year, 1 day, 1 hour, 1 minute and 1 second +-1 month, 1 day, 1 hour, 1 minute and 1 second +3.1709791983764585e92 years +3.7947783849423193e93 months +1.1574074074074074e95 days +2.777777777777778e96 hours +1.6666666666666666e98 minutes +1e100 seconds +36558901084 years diff --git a/tests/queries/0_stateless/01521_format_readable_time_delta2.sql b/tests/queries/0_stateless/01521_format_readable_time_delta2.sql new file mode 100644 index 00000000000..cb432183fed --- /dev/null +++ b/tests/queries/0_stateless/01521_format_readable_time_delta2.sql @@ -0,0 +1,24 @@ +SELECT formatReadableTimeDelta(-(1 + 60 + 3600 + 86400 + 30.5 * 86400 + 365 * 86400)); +SELECT formatReadableTimeDelta(-(1 + 60 + 3600 + 86400 + 30.5 * 86400 + 365 * 86400), 'years'); +SELECT formatReadableTimeDelta(-(1 + 60 + 3600 + 86400 + 30.5 * 86400 + 365 * 86400), 'months'); +SELECT formatReadableTimeDelta(-(1 + 60 + 3600 + 86400 + 30.5 * 86400 + 365 * 86400), 'days'); +SELECT formatReadableTimeDelta(-(1 + 60 + 3600 + 86400 + 30.5 * 86400 + 365 * 86400), 'hours'); +SELECT formatReadableTimeDelta(-(1 + 60 + 3600 + 86400 + 30.5 * 86400 + 365 * 86400), 'minutes'); +SELECT formatReadableTimeDelta(-(1 + 60 + 3600 + 86400 + 30.5 * 86400 + 365 * 86400), 'seconds'); +SELECT formatReadableTimeDelta(-(1 + 60 + 3600 + 86400 + 30.5 * 86400 + 365 * 86400), 'second'); -- { serverError 36 } + +SELECT formatReadableTimeDelta(-(60 + 3600 + 86400 + 30.5 * 86400 + 365 * 86400)); +SELECT formatReadableTimeDelta(-(1 + 3600 + 86400 + 30.5 * 86400 + 365 * 86400)); +SELECT formatReadableTimeDelta(-(1 + 60 + 86400 + 30.5 * 86400 + 365 * 86400)); +SELECT formatReadableTimeDelta(-(1 + 60 + 3600 + 30.5 * 86400 + 365 * 86400)); +SELECT formatReadableTimeDelta(-(1 + 60 + 3600 + 86400 + 365 * 86400)); +SELECT formatReadableTimeDelta(-(1 + 60 + 3600 + 86400 + 30.5 * 86400)); + +SELECT formatReadableTimeDelta(1e100); +SELECT formatReadableTimeDelta(1e100, 'months'); +SELECT formatReadableTimeDelta(1e100, 'days'); +SELECT formatReadableTimeDelta(1e100, 'hours'); +SELECT formatReadableTimeDelta(1e100, 'minutes'); +SELECT formatReadableTimeDelta(1e100, 'seconds'); + +SELECT formatReadableTimeDelta(0x1000000000000000);