2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
#
|
|
|
|
# id: bugs.core_4645
|
|
|
|
# title: internal Firebird consistency check (cannot find tip page (165), file: tra.cpp line: 2375)
|
2021-11-26 19:20:43 +01:00
|
|
|
# decription:
|
2021-04-26 20:07:00 +02:00
|
|
|
# Both STDOUT and STDERR in this test should be empty.
|
|
|
|
# Confirmed:
|
|
|
|
# 1) bugcheck exception on 3.0.0.32378; 4.0.0.98:
|
|
|
|
# Statement failed, SQLSTATE = XX000
|
|
|
|
# internal Firebird consistency check (cannot find tip page (165), file: tra.cpp line: 2303)
|
|
|
|
# Statement failed, SQLSTATE = XX000
|
|
|
|
# internal Firebird consistency check (can't continue after bugcheck)
|
|
|
|
# 2) normal work on 3.0.0.32471; 4.0.0.127.
|
2021-11-26 19:20:43 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# tracker_id: CORE-4645
|
|
|
|
# min_versions: ['2.5']
|
|
|
|
# versions: 2.5.6
|
|
|
|
# qmid: None
|
|
|
|
|
|
|
|
import pytest
|
2021-11-26 19:20:43 +01:00
|
|
|
from firebird.qa import db_factory, python_act, Action
|
|
|
|
from firebird.driver import DbAccessMode
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
# version: 2.5.6
|
|
|
|
# resources: None
|
|
|
|
|
|
|
|
substitutions_1 = []
|
|
|
|
|
|
|
|
init_script_1 = """"""
|
|
|
|
|
|
|
|
db_1 = db_factory(page_size=4096, sql_dialect=3, init=init_script_1)
|
|
|
|
|
|
|
|
# test_script_1
|
|
|
|
#---
|
2021-11-26 19:20:43 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# db_conn.close()
|
|
|
|
# runProgram('gfix',[dsn,'-user',user_name,'-pas',user_password,'-mode','read_only'])
|
|
|
|
# script='''
|
|
|
|
# commit;
|
|
|
|
# set transaction read committed;
|
|
|
|
# set term ^;
|
|
|
|
# execute block as
|
|
|
|
# declare n int = 20000;
|
|
|
|
# begin
|
2021-11-26 19:20:43 +01:00
|
|
|
# while (n>0) do
|
2021-04-26 20:07:00 +02:00
|
|
|
# in autonomous transaction do
|
|
|
|
# select :n-1 from rdb$database into n;
|
|
|
|
# end
|
|
|
|
# ^
|
|
|
|
# set term ;^
|
|
|
|
# commit;
|
|
|
|
# '''
|
|
|
|
# runProgram('isql',[dsn,'-user',user_name,'-password',user_password],script)
|
2021-11-26 19:20:43 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
#---
|
|
|
|
|
2021-11-26 19:20:43 +01:00
|
|
|
act_1 = python_act('db_1', substitutions=substitutions_1)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
|
2021-11-26 19:20:43 +01:00
|
|
|
@pytest.mark.version('>=2.5.6')
|
|
|
|
def test_1(act_1: Action):
|
|
|
|
with act_1.connect_server() as srv:
|
2021-12-07 13:36:20 +01:00
|
|
|
srv.database.set_access_mode(database=act_1.db.db_path, mode=DbAccessMode.READ_ONLY)
|
2021-11-26 19:20:43 +01:00
|
|
|
script = """
|
|
|
|
commit;
|
|
|
|
set transaction read committed;
|
|
|
|
set term ^;
|
|
|
|
execute block as
|
|
|
|
declare n int = 20000;
|
|
|
|
begin
|
|
|
|
while (n>0) do
|
|
|
|
in autonomous transaction do
|
|
|
|
select :n-1 from rdb$database into n;
|
|
|
|
end
|
|
|
|
^
|
|
|
|
set term ;^
|
|
|
|
commit;
|
|
|
|
"""
|
|
|
|
act_1.isql(switches=[], input=script)
|
|
|
|
assert act_1.clean_stdout == act_1.clean_expected_stdout
|