2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
"""
|
|
|
|
ID: issue-1493
|
|
|
|
ISSUE: 1493
|
|
|
|
TITLE: Server crashes instead of reporting the error "key size exceeds implementation restriction"
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-4127
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_4127
|
2022-01-23 20:41:55 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
init_script = """
|
2021-04-26 20:07:00 +02:00
|
|
|
recreate table tab1 (col1 int, col2 char(10));
|
|
|
|
create index itab1 on tab1 (col1, col2);
|
|
|
|
commit;
|
|
|
|
insert into tab1 values(1, 'a');
|
|
|
|
commit;
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
db = db_factory(init=init_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
test_script = """
|
2021-04-26 20:07:00 +02:00
|
|
|
set list on;
|
2021-10-21 19:29:23 +02:00
|
|
|
select * from tab1
|
2021-04-26 20:07:00 +02:00
|
|
|
where col1 = 1 and col2 = rpad('a', 32765)
|
|
|
|
union all
|
|
|
|
-- This part of query will NOT raise
|
|
|
|
-- Statement failed, SQLSTATE = 54000
|
|
|
|
-- arithmetic exception, numeric overflow, or string truncation
|
|
|
|
-- -Implementation limit exceeded
|
|
|
|
-- since WI-V3.0.0.31981
|
2021-10-21 19:29:23 +02:00
|
|
|
select * from tab1
|
2021-04-26 20:07:00 +02:00
|
|
|
where col1 = 1 and col2 = rpad('a', 32766);
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
act = isql_act('db', test_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
expected_stdout = """
|
2021-04-26 20:07:00 +02:00
|
|
|
COL1 1
|
|
|
|
COL2 a
|
|
|
|
COL1 1
|
|
|
|
COL2 a
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
@pytest.mark.version('>=3.0')
|
2022-01-23 20:41:55 +01:00
|
|
|
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
|
|
|
|