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

57 lines
1.9 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-25 22:55:48 +01:00
"""
ID: issue-5497
ISSUE: 5497
TITLE: ISQL -x may crash while exporting an exception with message text length > 127 bytes
DESCRIPTION:
JIRA: CORE-5217
FBTEST: bugs.core_5217
2022-01-25 22:55:48 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
test_script = """
recreate exception exc_test_a
2021-04-26 20:07:00 +02:00
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123';
2022-01-25 22:55:48 +01:00
recreate exception exc_test_b
2021-04-26 20:07:00 +02:00
'12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234';
recreate exception exc_test_c
'123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345';
commit;
set list on;
set count on;
2022-01-25 22:55:48 +01:00
select rdb$exception_name, rdb$message
2021-04-26 20:07:00 +02:00
from rdb$exceptions
order by rdb$exception_name;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
RDB$EXCEPTION_NAME EXC_TEST_A
RDB$MESSAGE 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123
RDB$EXCEPTION_NAME EXC_TEST_B
RDB$MESSAGE 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234
RDB$EXCEPTION_NAME EXC_TEST_C
RDB$MESSAGE 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
Records affected: 3
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
@pytest.mark.version('>=3')
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