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

49 lines
1.1 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-22 21:59:15 +01:00
"""
ID: issue-3585
ISSUE: 3585
TITLE: String truncation occurs when selecting from a view containing NOT IN inside
DESCRIPTION:
JIRA: CORE-3211
FBTEST: bugs.core_3211
2022-01-22 21:59:15 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
init_script = """CREATE TABLE T ( ID integer, FIELD1 varchar(30) );
2021-04-26 20:07:00 +02:00
COMMIT;
CREATE VIEW VT ( ID )
AS
select T1.ID from T as T1 where T1.FIELD1 not in ( select T2.FIELD1 from T as T2 where T2.FIELD1 = 'system1' )
;
COMMIT;
INSERT INTO T (ID, FIELD1) VALUES (1, 'system');
INSERT INTO T (ID, FIELD1) VALUES (2, 'system');
INSERT INTO T (ID, FIELD1) VALUES (3, 'system');
INSERT INTO T (ID, FIELD1) VALUES (4, 'system');
INSERT INTO T (ID, FIELD1) VALUES (5, 'system');
COMMIT;"""
2022-01-22 21:59:15 +01:00
db = db_factory(init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
act = isql_act('db', "select * from VT;")
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
ID
============
1
2
3
4
5
2022-01-22 21:59:15 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +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