6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00
firebird-qa/tests/bugs/core_2966_test.py

75 lines
1.1 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-21 18:49:26 +01:00
"""
ID: issue-3348
ISSUE: 3348
TITLE: Wrong results or unexpected errors while sorting a large data set
DESCRIPTION:
JIRA: CORE-2966
FBTEST: bugs.core_2966
2022-01-21 18:49:26 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
init_script = """create table t (col varchar(32000));
2021-04-26 20:07:00 +02:00
commit;
set term !!;
execute block
as
declare variable i integer;
begin
i=0;
while (i < 200000) do begin
insert into t (col) values(mod(:i, 10));
i= i+1;
end
end!!
set term ;!!
commit;"""
2022-01-21 18:49:26 +01:00
db = db_factory(init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
test_script = """select col from t group by 1;
2021-04-26 20:07:00 +02:00
select cast(col as integer) from t group by 1;
"""
2022-01-21 18:49:26 +01:00
act = isql_act('db', test_script, substitutions=[('=.*', '=')])
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
COL
===============================================================================
0
1
2
3
4
5
6
7
8
9
CAST
============
0
1
2
3
4
5
6
7
8
9
"""
2022-01-21 18:49:26 +01:00
@pytest.mark.version('>=3.0')
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