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

46 lines
2.0 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-24 20:27:02 +01:00
"""
ID: issue-5176
ISSUE: 5176
TITLE: ISQL input command (or -i option) reads large (> 64K) lines incorrectly
DESCRIPTION:
This test verifies ability of parsing multiple statements that are going as `single-lined stream`.
Source for this test is file `/files/core_4882.sql`.
It contains almost all source code of test that emulates OLTP workload - without initial script for data filling.
Three files were taken from it: oltp30_DDL.sql, oltp30_sp.sql and oltp_main_filling.sql - with total size ~600 Kb.
Then all single-lined comments ("-- blah blah ...") were removed and remained source code was pulled out in single-line.
This single-line also could not be compiled up to WI-V3.0.0.31948, raising 'token unknown'.
No error on compiling should occur since buiild WI-V3.0.0.31981.
NOTE: before this file also contained lines with bulk of begin..end blocks but since CORE-4884 was fixed that number
is limited to 512. With this limit single-line statement of begin-end blocks will have length less than 64K. For that
reason these lines were removed from here to the test for CORE-4884.
JIRA: CORE-4882
FBTEST: bugs.core_4882
2022-01-24 20:27:02 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
import pytest
from firebird.qa import *
db = db_factory()
2021-11-26 19:20:43 +01:00
2022-01-24 20:27:02 +01:00
act = python_act('db', substitutions=[('exception [0-9]+', 'exception'),
('After line [0-9]+ in file.*', ''),
('CURRENT_TIMESTAMP.*', '')])
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
MSG oltp30_DDL.sql start
MSG oltp30_DDL.sql finish
MSG oltp30_sp.sql start
MSG oltp30_sp.sql finish
MSG oltp_main_filling.sql start
MSG oltp_main_filling.sql finish
2021-11-26 19:20:43 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-24 20:27:02 +01:00
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.isql(switches=[], input_file=act.files_dir / 'core_4882.sql')
assert act.clean_stdout == act.clean_expected_stdout
2021-04-26 20:07:00 +02:00