2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
"""
|
|
|
|
ID: issue-6199
|
|
|
|
ISSUE: 6199
|
|
|
|
TITLE: Server crashes preparing a query with both DISTINCT/ORDER BY and non-field expression in the select list
|
|
|
|
DESCRIPTION:
|
|
|
|
We run query from ticket and check that it does completed OK with issuing data and 'Records affected: 1'.
|
|
|
|
JIRA: CORE-5943
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_5943
|
2022-01-26 21:10:46 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
db = db_factory()
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
test_script = """
|
2021-04-26 20:07:00 +02:00
|
|
|
set list on;
|
|
|
|
set count on;
|
2022-01-26 21:10:46 +01:00
|
|
|
select distinct
|
2021-04-26 20:07:00 +02:00
|
|
|
'0' as f01
|
|
|
|
,a.mon$server_pid as f02
|
|
|
|
from mon$attachments a
|
2022-01-26 21:10:46 +01:00
|
|
|
order by a.mon$server_pid, a.mon$server_pid ;
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
act = isql_act('db', test_script, substitutions=[('F02\\s+\\d+', 'F02')])
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
expected_stdout = """
|
2021-04-26 20:07:00 +02:00
|
|
|
F01 0
|
|
|
|
F02 2344
|
|
|
|
Records affected: 1
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
@pytest.mark.version('>=3')
|
|
|
|
def test_1(act: Action):
|
|
|
|
act.expected_stdout = expected_stdout
|
|
|
|
act.execute()
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|