6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00
firebird-qa/tests/bugs/core_1926_test.py

36 lines
1016 B
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-20 17:32:14 +01:00
"""
ID: issue-2360
ISSUE: 2360
TITLE: MON$DATABASE returns outdated transaction counters
DESCRIPTION:
Fields MON$NEXT_TRANSACTION etc contain incorrect (outdated) numbers on Classic if
there are other active attachments.
JIRA: CORE-1926
FBTEST: bugs.core_1926
2022-01-20 17:32:14 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
act = python_act('db')
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action):
with act.db.connect() as con:
2021-11-12 18:29:54 +01:00
c = con.cursor()
c.execute('SELECT 1 FROM RDB$DATABASE')
2022-01-20 17:32:14 +01:00
with act.db.connect() as con_detail:
2021-11-12 18:29:54 +01:00
con_detail.begin()
c_detail = con_detail.cursor()
c_detail.execute("select MON$NEXT_TRANSACTION from MON$DATABASE")
tra_1 = c_detail.fetchone()[0]
con_detail.commit()
c_detail.execute("select MON$NEXT_TRANSACTION from MON$DATABASE")
tra_2 = c_detail.fetchone()[0]
con_detail.commit()
assert tra_2 - tra_1 == 1