6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00

Added/Updated tests\bugs\core_1453_test.py: Reimplemented: we have to avoid to show result of LIST() call because unpredictable order of its tokens. This can cause fail if we change OptimizeForFirstRows = true config parameter.

This commit is contained in:
pavel-zotov 2024-08-23 15:43:59 +03:00
parent 01a2478ad2
commit 0417933393

View File

@ -7,45 +7,45 @@ TITLE: Allow usage of functions in LIST delimiter parameter
DESCRIPTION: DESCRIPTION:
JIRA: CORE-1443 JIRA: CORE-1443
FBTEST: bugs.core_1453 FBTEST: bugs.core_1453
NOTES:
[23.08.2024] pzotov
Reimplemented: we have to avoid to show result of LIST() call because unpredictable order of its tokens.
This can cause fail if we change OptimizeForFirstRows = true config parameter.
Instead, test apply char_len() to the result of list(<...>, <func>).
""" """
import pytest import pytest
from firebird.qa import * from firebird.qa import *
init_script = """CREATE TABLE T1 (ID INTEGER, NAME CHAR(20)); init_script = """
COMMIT; create table t1 (id integer, name char(20));
INSERT INTO T1 (ID,NAME) VALUES (1,'ORANGE'); commit;
INSERT INTO T1 (ID,NAME) VALUES (1,'APPLE'); insert into t1 (id,name) values (1,'orange');
INSERT INTO T1 (ID,NAME) VALUES (1,'LEMON'); insert into t1 (id,name) values (1,'apple');
INSERT INTO T1 (ID,NAME) VALUES (2,'ORANGE'); insert into t1 (id,name) values (1,'lemon');
INSERT INTO T1 (ID,NAME) VALUES (2,'APPLE'); insert into t1 (id,name) values (2,'orange');
INSERT INTO T1 (ID,NAME) VALUES (2,'PEAR'); insert into t1 (id,name) values (2,'apple');
COMMIT; insert into t1 (id,name) values (2,'pear');
commit;
""" """
db = db_factory(init=init_script) db = db_factory(init=init_script)
test_script = """select ID, LIST( trim(NAME), ASCII_CHAR(35) ) test_script = """
from T1 set list on;
group by 1; select id, char_length(list( trim(name), ascii_char(35) )) chr_len
from t1
group by id
order by id;
""" """
act = isql_act('db', test_script) act = isql_act('db', test_script, substitutions = [ ('[ \t]+', ' '), ])
expected_stdout = """ expected_stdout = """
ID LIST ID 1
============ ================= CHR_LEN 18
1 0:1 ID 2
============================================================================== CHR_LEN 17
LIST:
ORANGE#LEMON#APPLE
==============================================================================
2 0:2
==============================================================================
LIST:
PEAR#ORANGE#APPLE
==============================================================================
""" """
@pytest.mark.version('>=2.5.0') @pytest.mark.version('>=2.5.0')