2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-27 20:08:36 +01:00
|
|
|
"""
|
|
|
|
ID: issue-2366
|
|
|
|
ISSUE: 2366
|
|
|
|
TITLE: ISQL: bad headers when text columns has >= 80 characters
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-6438
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_6438
|
2022-01-27 20:08:36 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-27 20:08:36 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-27 20:08:36 +01:00
|
|
|
db = db_factory()
|
2021-12-15 22:02:07 +01:00
|
|
|
|
2022-01-27 20:08:36 +01:00
|
|
|
act = python_act('db')
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-27 20:08:36 +01:00
|
|
|
expected_stdout = """
|
2021-04-26 20:07:00 +02:00
|
|
|
hdr_len: 65533
|
|
|
|
txt_len: 65533
|
2021-12-15 22:02:07 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
@pytest.mark.version('>=4.0')
|
2022-01-27 20:08:36 +01:00
|
|
|
def test_1(act: Action, capsys):
|
2021-12-15 22:02:07 +01:00
|
|
|
data = '1' * 65533
|
2022-01-27 20:08:36 +01:00
|
|
|
act.isql(switches=[], input=f'''select '{data}' as " ", 1 as " " from rdb$database;''')
|
|
|
|
for line in act.stdout.splitlines():
|
2021-12-15 22:02:07 +01:00
|
|
|
if line.startswith('='):
|
|
|
|
hdr_len = len(line.split()[0])
|
|
|
|
elif line.startswith('1'):
|
|
|
|
txt_len = len(line.split()[0])
|
|
|
|
print('hdr_len:', hdr_len)
|
|
|
|
print('txt_len:', txt_len)
|
|
|
|
#
|
2022-01-27 20:08:36 +01:00
|
|
|
act.reset()
|
|
|
|
act.expected_stdout = expected_stdout
|
|
|
|
act.stdout = capsys.readouterr().out
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|