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

113 lines
2.8 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-18 20:45:21 +01:00
"""
ID: issue-522-A
ISSUE: 522
TITLE: Bugcheck 291
DESCRIPTION:
JIRA: CORE-195
FBTEST: bugs.core_0195
2022-01-18 20:45:21 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
create table tbl_bugcheck291
(
ID integer NOT NULL PRIMARY KEY,
DATA integer
);
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00
commit;
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00
insert into tbl_bugcheck291 (id, data) values (1,100);
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00
commit;
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00
set term ^;
create trigger bu_tbl_bugcheck291 for tbl_bugcheck291
before update
as
begin
if(new.data is not null) then
begin
if(new.data<110) then
begin
update tbl_bugcheck291 x set x.data=new.data+1 where x.id=new.id;
end
end
end
^
set term ;^
commit;
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00
update tbl_bugcheck291 set data=105 where id=1;
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00
commit;
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00
update tbl_bugcheck291 set data=105 where id=1;
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00
/*FB2.5: internal Firebird consistency check (cannot find record back version (291), file: vio.cpp line: 5014).*/
update tbl_bugcheck291 set data=105 where id=1;
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00
/*internal Firebird consistency check (can't continue after bugcheck).*/
update tbl_bugcheck291 set data=105 where id=1;
update tbl_bugcheck291 set data=105 where id=1;
update tbl_bugcheck291 set data=105 where id=1;
update tbl_bugcheck291 set data=105 where id=1;
commit;
------------------------------------------------
create table "TBL_BUGCHECK291B"
(
"DATA" integer,
"FLAG" integer
);
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00
set term ^;
create trigger "TRG_BUGCHECK291B" for "TBL_BUGCHECK291B"
active before update position 1
as
begin
if (new.Flag = 16 and new.Data = 1) then begin
update tbl_bugcheck291b set Data = 2 where Flag = 46;
update tbl_bugcheck291b set Data = 3 where Flag = 46;
end
if (new.Flag = 46 and new.Data = 2) then begin
update tbl_bugcheck291b set Data = 4 where Flag = 14;
update tbl_bugcheck291b set Data = 5 where Flag = 15;
end
if (new.Flag = 14 and new.Data = 4) then begin
update tbl_bugcheck291b set Data = 6 where Flag = 46;
end
if (new.Flag = 15 and new.Data = 5) then begin
update tbl_bugcheck291b set Data = 7 where Flag = 46;
end
if (new.Flag = 46 and new.Data = 3) then begin
update tbl_bugcheck291b set Data = 8 where Flag = 46;
end
end
^
set term ;^
commit;
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00
insert into tbl_bugcheck291b(Flag) values(14);
insert into tbl_bugcheck291b(Flag) values(15);
insert into tbl_bugcheck291b(Flag) values(16);
insert into tbl_bugcheck291b(Flag) values(46);
commit;
2022-01-18 20:45:21 +01:00
2021-04-26 20:07:00 +02:00
update tbl_bugcheck291b set Data=1 where Flag = 16;
commit;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action):
2022-01-25 22:55:48 +01:00
act.execute()