From de2237e06e25ad6606c6b74310f1912ea6c55c46 Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Thu, 28 Nov 2024 13:34:30 +0300 Subject: [PATCH] Added/Updated tests\bugs\gh_8323_test.py: see notes. --- tests/bugs/gh_8323_test.py | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/bugs/gh_8323_test.py diff --git a/tests/bugs/gh_8323_test.py b/tests/bugs/gh_8323_test.py new file mode 100644 index 00000000..22713c54 --- /dev/null +++ b/tests/bugs/gh_8323_test.py @@ -0,0 +1,49 @@ +#coding:utf-8 + +""" +ID: issue-8323 +ISSUE: https://github.com/FirebirdSQL/firebird/pull/8323 +TITLE: Add AUTO RELEASE TEMP BLOBID transaction option +NOTES: + [28.11.2024] pzotov + 1. Test verifies only syntax extension of SET TRANSACTION, i.e. ability to use 'AUTO RELEASE TEMP BLOBID' clause. + Handling with temporary BLOBID can not be tested in ISQL and will be checked when firebird-driver will support this. + 2. Presense of mon$transactions.mon$auto_release_temp_blobid column not checked: FB 5.x currently missed it. + + Discussed with Vlad, letters 28.11.2024. + + Checked on 6.0.0.535, 5.0.2.1569 +""" + +import pytest +from firebird.qa import * + +db = db_factory() + +test_script = """ + set bail on; + set list on; + set blob all; + recreate table test(b blob); + commit; + + -- makes the transaction release a temporary ID of a user BLOB just after its materialization + set transaction AUTO RELEASE TEMP BLOBID; + + insert into test values('qwerty') returning b as blob_column_id; + -- TEMPORARY (?) DISABLED: FB 5.X HAS NO SUCH FIELD: + -- select mon$auto_release_temp_blobid from mon$transactions where mon$transaction_id = current_transaction; + commit; +""" + +act = isql_act('db', test_script, substitutions = [('BLOB_COLUMN_ID .*', '')]) + +expected_stdout = """ + qwerty +""" + +@pytest.mark.version('>=5.0.2') +def test_1(act: Action): + act.expected_stdout = expected_stdout + act.execute(combine_output = True) + assert act.clean_stdout == act.clean_expected_stdout