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

35 lines
927 B
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-26 21:10:46 +01:00
"""
ID: issue-6205
ISSUE: 6205
TITLE: Bugcheck could happen when read-only database with non-zero linger is set to read-write mode
DESCRIPTION:
JIRA: CORE-5949
FBTEST: bugs.core_5949
2022-01-26 21:10:46 +01:00
"""
2021-04-26 20:07:00 +02:00
import pytest
2022-01-26 21:10:46 +01:00
from firebird.qa import *
2021-12-10 19:50:31 +01:00
from firebird.driver import DbAccessMode
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
act = python_act('db')
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0.5')
2022-01-26 21:10:46 +01:00
def test_1(act: Action):
with act.db.connect() as con:
2021-12-10 19:50:31 +01:00
con.execute_immediate('alter database set linger to 60')
con.commit()
#
2022-01-26 21:10:46 +01:00
with act.connect_server() as srv:
srv.database.set_access_mode(database=act.db.db_path, mode=DbAccessMode.READ_ONLY)
2021-12-10 19:50:31 +01:00
# Test
2022-01-26 21:10:46 +01:00
with act.db.connect() as con:
2021-12-10 19:50:31 +01:00
c = con.cursor()
c.execute('select r.rdb$linger, d.mon$read_only from rdb$database r cross join mon$database d')
result = c.fetchone()
con.commit()
assert result == (60, 1)