2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
"""
|
|
|
|
ID: issue-5913
|
|
|
|
ISSUE: 5913
|
|
|
|
TITLE: Increase number of formats/versions of views from 255 to 32K
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-5647
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_5647
|
2022-01-25 22:55:48 +01:00
|
|
|
"""
|
2021-12-09 19:26:42 +01: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 = """
|
2021-12-09 19:26:42 +01:00
|
|
|
set bail on;
|
|
|
|
set list on;
|
|
|
|
set term ^;
|
|
|
|
execute block returns(ret_code smallint) as
|
|
|
|
declare n int = 300;
|
|
|
|
begin
|
|
|
|
while (n > 0) do
|
|
|
|
begin
|
|
|
|
if (mod(n, 2) = 0) then
|
|
|
|
begin
|
|
|
|
in autonomous transaction do
|
|
|
|
begin
|
|
|
|
execute statement 'create or alter view vw1 (dump1) as select 1 from rdb$database';
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
begin
|
|
|
|
in autonomous transaction do
|
|
|
|
begin
|
|
|
|
execute statement 'create or alter view vw1 (dump1, dump2) as select 1, 2 from rdb$database';
|
|
|
|
end
|
|
|
|
end
|
|
|
|
n = n - 1;
|
|
|
|
end
|
|
|
|
ret_code = -abs(n);
|
|
|
|
suspend;
|
|
|
|
end ^
|
|
|
|
set term ;^
|
|
|
|
quit;
|
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
act = isql_act('db', test_script)
|
|
|
|
|
|
|
|
expected_stdout = """
|
|
|
|
RET_CODE 0
|
|
|
|
"""
|
|
|
|
|
2021-12-30 19:43:52 +01:00
|
|
|
@pytest.mark.version('>=3.0.8')
|
2022-01-25 22:55:48 +01:00
|
|
|
def test_1(act: Action):
|
|
|
|
act.expected_stdout = expected_stdout
|
|
|
|
act.execute()
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|