6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00

Added/Updated D:\FB\firebird-qa\tests\bugs\gh_7446_check_regression_test.py: Checked on 3.0.11.33658; 4.0.3.2894 -- all fine. NOTE: Build 5.0.0.920: still has a problem with BUGCHECK

This commit is contained in:
zotov 2023-02-01 22:17:29 +03:00
parent b019556da0
commit 4d0ff477a7

View File

@ -0,0 +1,69 @@
#coding:utf-8
"""
ID: issue-7446
ISSUE: https://github.com/FirebirdSQL/firebird/issues/7446
DESCRIPTION:
Problem was reported privately by firebird user. As a visible result there were core dump and an error in firebird.log:
Operating system call pthread_mutex_lock failed. Error code 22
An error happens due to an attempt to cleanup (too late attempt - when processing disconnect in CS)
savepoint stored in metadata cache. Put attention that savepoints are always created in transaction memory pool and keeping
them after commit/rollback in metadata cache is bad idea.
NOTES:
[01.02.2023] pzotov
This test checks regression that was introduced by first attempt to solve problem described in the title.
SQL example was provided by dimitr, see letter 31-jan-2023 13:43. Running SQL script must NOT issue any output.
There is NO_FBT analog for this test.
Regression can be reproduced on:
* FB 3.0.11.33654 (17-jan-2023): "SQLSTATE = 3B000 / Unable to find savepoint with name S in transaction context".
* FB 5.0.0.907 (12-jan-2023): "consistency check (decompression overran buffer (179), file: sqz.cpp line: 487)"
Checked on:
3.0.11.33658; 4.0.3.2894 -- all fine.
::: ACHTUNG :::
Build 5.0.0.920 (01-feb-2022): still has a problem with BUGCHECK, see above for 5.0.0.907.
"""
import pytest
import locale
from firebird.qa import *
from firebird.driver import TraAccessMode, TPB
db = db_factory()
act = python_act('db')
@pytest.mark.version('>=3.0.11')
def test_1(act: Action):
sql_chk = """
set term ^;
create procedure p0 returns (r int)
as
begin
r = 0;
suspend;
end^
create procedure p returns (r int)
as
begin
in autonomous transaction do
begin
select p0.r from p0 into :r;
end
suspend;
end^
set term ;^
savepoint s;
set heading off;
select * from p;
release savepoint s;
"""
act.expected_stdout = "0"
act.isql(switches = ['-q'], input = sql_chk, combine_output = True, io_enc = locale.getpreferredencoding())
assert act.clean_stdout == act.clean_expected_stdout