From 02f6f92b199eb0d513fbd0673363d2dcb4574809 Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Mon, 31 Jul 2023 09:51:46 +0300 Subject: [PATCH] Added/Updated tests\bugs\gh_7683_test.py: Checked on 5.0.0.1145, 4.0.3.2975 -- all fine. --- tests/bugs/gh_7683_test.py | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tests/bugs/gh_7683_test.py diff --git a/tests/bugs/gh_7683_test.py b/tests/bugs/gh_7683_test.py new file mode 100644 index 00000000..df1ced23 --- /dev/null +++ b/tests/bugs/gh_7683_test.py @@ -0,0 +1,51 @@ +#coding:utf-8 + +""" +ID: issue-7683 +ISSUE: https://github.com/FirebirdSQL/firebird/issues/7683 +TITLE: rdb$time_zone_util.transitions returns an infinite resultset +DESCRIPTION: +NOTES: + Confirmed bug on 5.0.0.1132, 4.0.3.2966 + Checked on 5.0.0.1145, 4.0.3.2975 -- all fine. +""" + +import pytest +from firebird.qa import * + +db = db_factory() + +test_script = f""" + set list on; + select max(cnt) as max_cnt + from ( + select + rdb$start_timestamp start_timestamp, + rdb$end_timestamp stop_timestamp, + rdb$effective_offset tz_offset, + count(*) cnt + from ( + select * from + rdb$time_zone_util.transitions( + 'Europe/Moscow', + '0001-01-01 00:00:00.0000 +00:00', + '9999-12-31 23:59:59.9999 +00:00' + ) + rows 1000 + ) + group by 1,2,3 + ) + ; +""" + +act = isql_act('db', test_script) + +expected_stdout = """ + MAX_CNT 1 +""" + +@pytest.mark.version('>=4.0.3') +def test_1(act: Action): + act.expected_stdout = expected_stdout + act.execute(combine_output = True) + assert act.clean_stdout == act.clean_expected_stdout