6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 05:53:06 +01:00
firebird-qa/tests/bugs/core_0142_test.py

97 lines
2.5 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-18 20:45:21 +01:00
"""
ID: issue-469
ISSUE: 469
TITLE: Index breaks = ANY result
DESCRIPTION:
JIRA: CORE-142
FBTEST: bugs.core_0142
2022-01-18 20:45:21 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
-- Confirmed wrong output on WI-V1.5.6.5026.
-- Since 2.0.0 works fine.
recreate view v_test(k) as select 1 k from rdb$database;
commit;
2021-12-22 20:23:11 +01:00
2021-04-26 20:07:00 +02:00
recreate table customers (
cnum integer,
cname char(10),
city char(10),
rating integer,
snum integer
);
2021-12-22 20:23:11 +01:00
recreate view v_test(cnum, cname, city, rating, snum) as
2021-04-26 20:07:00 +02:00
select *
from customers c
where not c.rating = any
(select r.rating
from customers r
where r.city = 'san jose');
commit;
2021-12-22 20:23:11 +01:00
2021-04-26 20:07:00 +02:00
insert into customers values (2001, 'hoffman', 'london', 100, 1001);
insert into customers values (2002, 'giovanni', 'rome', 200, 1003);
insert into customers values (2003, 'lui', 'san jose', 200, 1002);
insert into customers values (2004, 'grass', 'berlin', 300, 1002);
insert into customers values (2006, 'clemens', 'london', null, 1001);
insert into customers values (2008, 'cisneros', 'san jose', 300, 1007);
insert into customers values (2007, 'pereira', 'rome', 100, 1004);
commit;
2021-12-22 20:23:11 +01:00
2021-04-26 20:07:00 +02:00
set list on;
select * from v_test order by cnum;
commit;
2021-12-22 20:23:11 +01:00
2021-04-26 20:07:00 +02:00
create index byrating on customers (rating);
commit;
2021-12-22 20:23:11 +01:00
2021-04-26 20:07:00 +02:00
select * from v_test order by cnum;
commit;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
CNUM 2001
2021-12-22 20:23:11 +01:00
CNAME hoffman
CITY london
2021-04-26 20:07:00 +02:00
RATING 100
SNUM 1001
CNUM 2007
2021-12-22 20:23:11 +01:00
CNAME pereira
CITY rome
2021-04-26 20:07:00 +02:00
RATING 100
SNUM 1004
CNUM 2001
2021-12-22 20:23:11 +01:00
CNAME hoffman
CITY london
2021-04-26 20:07:00 +02:00
RATING 100
SNUM 1001
CNUM 2007
2021-12-22 20:23:11 +01:00
CNAME pereira
CITY rome
2021-04-26 20:07:00 +02:00
RATING 100
SNUM 1004
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +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