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

76 lines
2.1 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-22 21:59:15 +01:00
"""
ID: issue-3476
ISSUE: 3476
TITLE: Updating blob field cause server crash with ACCESS_VIOLATION exception
DESCRIPTION:
JIRA: CORE-3097
FBTEST: bugs.core_3097
2022-01-22 21:59:15 +01:00
"""
2021-04-26 20:07:00 +02:00
import pytest
2021-12-22 20:23:11 +01:00
from zipfile import Path
2022-01-22 21:59:15 +01:00
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
act = isql_act('db', '')
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
ID 32765
CHAR_LENGTH 32765
OCTET_LENGTH 32765
ID 32766
CHAR_LENGTH 32766
OCTET_LENGTH 32766
ID 32767
CHAR_LENGTH 32767
OCTET_LENGTH 32767
ID 32768
CHAR_LENGTH 32768
OCTET_LENGTH 32768
ID 32769
CHAR_LENGTH 32769
OCTET_LENGTH 32769
ID 65532
CHAR_LENGTH 65532
OCTET_LENGTH 65532
ID 65533
CHAR_LENGTH 65533
OCTET_LENGTH 65533
ID 65534
CHAR_LENGTH 65534
OCTET_LENGTH 65534
ID 65535
CHAR_LENGTH 65535
OCTET_LENGTH 65535
2021-12-22 20:23:11 +01:00
"""
2022-01-22 21:59:15 +01:00
expected_stderr = """
2021-04-26 20:07:00 +02:00
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-String literal with 65536 bytes exceeds the maximum length of 65535 bytes
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-22 21:59:15 +01:00
def test_1(act: Action):
script_file = Path(act.files_dir / 'core_3097.zip',
2021-12-22 20:23:11 +01:00
at='core_3097_script.sql')
2022-01-22 21:59:15 +01:00
act.script = script_file.read_text()
act.expected_stdout = expected_stdout
act.expected_stderr = expected_stderr
act.execute()
assert (act.clean_stderr == act.clean_expected_stderr and
act.clean_stdout == act.clean_expected_stdout)
2021-04-26 20:07:00 +02:00