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

59 lines
1.5 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-19 17:54:56 +01:00
"""
ID: issue-1420
ISSUE: 1420
TITLE: Local buffer overrun in DYN_error() that takes down the server
DESCRIPTION:
We have a local buffer overrun in DYN_error(), while copying tdbb_status_vector to
local_status. It seems to be the first time (DYN errors + stack trace facility) when 20
status words are not enough to store the complete error info.
JIRA: CORE-1010
FBTEST: bugs.core_1010
2022-01-19 17:54:56 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
-- Removed old code: all attempts to create triggers on SYSTEM tables now are prohibited, even for SYSDBA.
create exception ex_test '!!!';
commit;
2022-01-19 17:54:56 +01:00
2021-04-26 20:07:00 +02:00
set term ^ ;
create or alter trigger rdb$procedures_biu for rdb$procedures
active after update or delete position 0
as
begin
exception ex_test;
end
^
commit^
2022-01-19 17:54:56 +01:00
2021-04-26 20:07:00 +02:00
create or alter procedure proctest returns (result integer) as
begin
result = 0;
suspend;
end^
set term ; ^
commit;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
act = isql_act('db', test_script, substitutions=[('line:.*', ''), ('col:.*', '')])
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
expected_stderr = """
2021-04-26 20:07:00 +02:00
Statement failed, SQLSTATE = 28000
unsuccessful metadata update
-CREATE OR ALTER TRIGGER RDB$PROCEDURES_BIU failed
-no permission for ALTER access to TABLE RDB$PROCEDURES
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-19 17:54:56 +01:00
def test_1(act: Action):
act.expected_stderr = expected_stderr
act.execute()
assert act.clean_stderr == act.clean_expected_stderr
2021-04-26 20:07:00 +02:00