From 30f3a65cb7881ac98537ea783750ae159ea7664c Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Tue, 18 Jul 2023 23:44:46 +0300 Subject: [PATCH] Added/Updated tests\bugs\gh_7665_test.py: Checked on 3.0.11.33695, 4.0.3.2966, 5.0.0.1121: all OK. --- tests/bugs/gh_7665_test.py | 63 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 tests/bugs/gh_7665_test.py diff --git a/tests/bugs/gh_7665_test.py b/tests/bugs/gh_7665_test.py new file mode 100644 index 00000000..27802666 --- /dev/null +++ b/tests/bugs/gh_7665_test.py @@ -0,0 +1,63 @@ +#coding:utf-8 + +""" +ID: issue-7665 +ISSUE: https://github.com/FirebirdSQL/firebird/issues/7665 +TITLE: Wrong result ordering in LEFT JOIN query +DESCRIPTION: +NOTES: + Confirmed bug on 3.0.11.33691, 4.0.3.2957 (FB 5.x seems not affected). + Checked on 3.0.11.33695, 4.0.3.2966, 5.0.0.1121: all OK. +""" + +import pytest +from firebird.qa import * + +db = db_factory() + +test_script = f""" + set list on; + create table tmain (x int primary key); + create table tdetl (x int primary key, y int references tmain); + commit; + + insert into tmain values (1); + insert into tmain values (2); + insert into tmain values (3); + insert into tmain values (4); + insert into tdetl values (1, 1); + insert into tdetl values (2, 1); + insert into tdetl values (3, 4); + insert into tdetl values (4, 2); + + select a.x, b.x + from tdetl a + left outer join tmain b + on + a.y = b.x + and a.x = b.x + order by a.x + ; +""" + +act = isql_act('db', test_script) + +expected_stdout = """ + X 1 + X 1 + + X 2 + X + + X 3 + X + + X 4 + X +""" + +@pytest.mark.version('>=3.0') +def test_1(act: Action): + act.expected_stdout = expected_stdout + act.execute(combine_output = True) + assert act.clean_stdout == act.clean_expected_stdout