6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 14:03:06 +01:00
firebird-qa/tests/bugs/core_2766_test.py

55 lines
1.2 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-21 18:49:26 +01:00
"""
ID: issue-3158
ISSUE: 3158
TITLE: Error "page 0 is of wrong type (expected 6, found 1)" is thrown while accessing a non-corrupted table
DESCRIPTION:
JIRA: CORE-2766
FBTEST: bugs.core_2766
2022-01-21 18:49:26 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
init_script = """create table t_master (id int not null, name varchar(64));
2021-04-26 20:07:00 +02:00
alter table t_master add constraint PK_master primary key (id);
create table t_detail (id_master int not null, name varchar(64));
alter table t_detail add constraint FK_detail foreign key (id_master) references t_master (id);
commit;
insert into t_master values (1, '1');
insert into t_detail values (1, 'a');
commit;
"""
2022-01-21 18:49:26 +01:00
db = db_factory(charset='UTF8', init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
test_script = """insert into t_master values (3, '2');
2021-04-26 20:07:00 +02:00
delete from t_master where id = 3;
commit;
drop table t_detail;
commit;
delete from t_master;
select count(*) from t_master;
"""
2022-01-21 18:49:26 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
COUNT
=====================
0
"""
@pytest.mark.version('>=3.0')
2022-01-21 18:49:26 +01:00
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout
2021-04-26 20:07:00 +02:00