2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
"""
|
|
|
|
ID: issue-4458
|
|
|
|
ISSUE: 4458
|
|
|
|
TITLE: Error when processing an empty data set by window function, if reading indexed
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-4131
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_4131
|
2023-07-29 20:30:16 +02:00
|
|
|
NOTES:
|
|
|
|
3.0.0.30472:
|
|
|
|
cursor identified in the UPDATE or DELETE statement is not positioned on a row. no current record for fetch operation
|
|
|
|
|
|
|
|
[29.07.2023] pzotov
|
|
|
|
Enclose query in execute block so that no output will be if it completes successfully.
|
|
|
|
Previous version of test issued execution plan which had no relation to test purpose and could be changed (thus caused test to be failed).
|
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
|
|
|
db = db_factory()
|
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
|
|
|
recreate table test(x char(31) character set unicode_fss unique using index test_x);
|
|
|
|
commit;
|
|
|
|
insert into test values('qwerty');
|
|
|
|
commit;
|
2022-01-23 20:41:55 +01:00
|
|
|
|
2023-07-29 20:30:16 +02:00
|
|
|
set term ^;
|
|
|
|
execute block as
|
|
|
|
declare rn int;
|
|
|
|
declare x type of column test.x;
|
|
|
|
begin
|
|
|
|
select row_number() over(order by x) as rn, x
|
|
|
|
from test
|
|
|
|
where x = 'qwerty'
|
|
|
|
into rn, x;
|
|
|
|
end ^
|
|
|
|
set term ;^
|
|
|
|
|
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
|
|
|
|
2023-07-29 20:30:16 +02:00
|
|
|
expected_stdout = ""
|
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
|
2023-07-29 20:30:16 +02:00
|
|
|
act.execute(combine_output = True)
|
2022-01-23 20:41:55 +01:00
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|