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_0091_test.py

47 lines
812 B
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-18 11:45:40 +01:00
"""
2022-01-18 20:45:21 +01:00
ID: issue-416
2022-01-18 11:45:40 +01:00
ISSUE: 416
TITLE: Recreate and self-referencing indexes
DESCRIPTION:
2022-01-18 20:45:21 +01:00
JIRA: CORE-91
FBTEST: bugs.core_0091
2022-01-18 11:45:40 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-18 11:45:40 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-18 11:45:40 +01:00
init_script = """recreate table t2 (
2021-04-26 20:07:00 +02:00
i integer not null primary key,
p integer references t2(i) on delete set null
);
commit;
"""
2022-01-18 11:45:40 +01:00
db = db_factory(init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-18 11:45:40 +01:00
test_script = """select * from t2;
2021-04-26 20:07:00 +02:00
insert into t2 values (1, null);
delete from t2 where i=1;
commit;
recreate table t2 (
i integer not null primary key,
p integer references t2(i) on delete set null
);
commit;
select * from t2;
insert into t2 values (1, null);
delete from t2 where i=1;
commit;
"""
2022-01-18 11:45:40 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-18 11:45:40 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action):
2022-01-25 22:55:48 +01:00
act.execute()
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00