2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-19 17:54:56 +01:00
|
|
|
"""
|
|
|
|
ID: issue-1677
|
|
|
|
ISSUE: 1677
|
|
|
|
TITLE: LIST(DISTINCT) concatenate VARCHAR values as CHAR
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-1253
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_1253
|
2022-01-19 17:54:56 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-19 17:54:56 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-19 17:54:56 +01:00
|
|
|
init_script = """CREATE TABLE T1 (C1 varchar(5));
|
2021-04-26 20:07:00 +02:00
|
|
|
COMMIT;
|
|
|
|
INSERT INTO T1 VALUES ('1');
|
|
|
|
INSERT INTO T1 VALUES ('2');
|
|
|
|
COMMIT;"""
|
|
|
|
|
2022-01-19 17:54:56 +01:00
|
|
|
db = db_factory(init=init_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-19 17:54:56 +01:00
|
|
|
test_script = """select list(distinct c1) from t1;
|
2021-04-26 20:07:00 +02:00
|
|
|
"""
|
|
|
|
|
2022-01-19 17:54:56 +01:00
|
|
|
act = isql_act('db', test_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-19 17:54:56 +01:00
|
|
|
expected_stdout = """LIST
|
2021-04-26 20:07:00 +02:00
|
|
|
=================
|
|
|
|
0:1
|
|
|
|
==============================================================================
|
|
|
|
LIST:
|
|
|
|
1,2
|
|
|
|
==============================================================================
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
2022-01-19 17:54:56 +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
|
2021-04-26 20:07:00 +02:00
|
|
|
|