From fc94b3612ef9d4f94ccfdb4359df912c4698d2a3 Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Fri, 10 Nov 2023 19:16:42 +0300 Subject: [PATCH] Added/Updated tests\bugs\gh_7832_test.py: Checked on 6.0.0.107, 5.0.0.1264 -- all fine. --- tests/bugs/gh_7832_test.py | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/bugs/gh_7832_test.py diff --git a/tests/bugs/gh_7832_test.py b/tests/bugs/gh_7832_test.py new file mode 100644 index 00000000..4e6441f1 --- /dev/null +++ b/tests/bugs/gh_7832_test.py @@ -0,0 +1,43 @@ +#coding:utf-8 + +""" +ID: issue-7832 +ISSUE: https://github.com/FirebirdSQL/firebird/issues/7832 +TITLE: Firebird 5 and 6 crash on "... RETURNING * " without INTO in PSQL +DESCRIPTION: +NOTES: + [10.11.2023] pzotov + Confirmed crash on 6.0.0.104, 5.0.0.1259 + Checked on 6.0.0.107, 5.0.0.1264 -- all fine. +""" + +import pytest +from firebird.qa import * + +db = db_factory() + +test_script = """ + set term ^; + recreate table ttt (id int)^ + execute block + as + begin + delete from ttt returning *; + end^ + set term ;^ +""" +expected_stdout = """ + Statement failed, SQLSTATE = 42000 + Dynamic SQL Error + -SQL error code = -104 + -Unexpected end of command - +""" + +substitutions = [('line(:)? \\d+, col(umn)?(:)? \\d+', '')] +act = isql_act('db', test_script, substitutions = substitutions) + +@pytest.mark.version('>=5.0') +def test_1(act: Action): + act.expected_stdout = expected_stdout + act.execute(combine_output = True) + assert act.clean_stdout == act.clean_expected_stdout