From 2e935208a851b44d20ecac0498753ab58643df25 Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Fri, 24 Feb 2023 19:41:30 +0300 Subject: [PATCH] Added/Updated tests\bugs\gh_7482_test.py: Checked on 5.0.0.958, intermediate build of 24-feb-2023. All OK. --- tests/bugs/gh_7482_test.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/bugs/gh_7482_test.py diff --git a/tests/bugs/gh_7482_test.py b/tests/bugs/gh_7482_test.py new file mode 100644 index 00000000..6f549037 --- /dev/null +++ b/tests/bugs/gh_7482_test.py @@ -0,0 +1,36 @@ +#coding:utf-8 + +""" +ID: issue-7482 +ISSUE: 7482 +TITLE: Simple SQL crashes firebird: select cast(rdb$db_key as integer) from rdb$database +NOTES: + [14.02.2023] pzotov + Checked on 5.0.0.958, intermediate build of 24-feb-2023. All OK. +""" + +import pytest +from firebird.qa import * + +db = db_factory() + +test_script = """ + set list on; + set blob all; + set sqlda_display on; + select blob_append(null, null) as blob_result from rdb$database; +""" + +act = isql_act('db', test_script, substitutions = [('^((?!sqltype:|BLOB_RESULT).)*$', ''), ('[ \t]+', ' ')]) + +expected_stdout = """ + 01: sqltype: 520 BLOB Nullable scale: 0 subtype: 0 len: 8 + : name: BLOB_APPEND alias: BLOB_RESULT + BLOB_RESULT +""" + +@pytest.mark.version('>=5.0') +def test_1(act: Action): + act.expected_stdout = expected_stdout + act.execute() + assert act.clean_stdout == act.clean_expected_stdout